Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: zippo227 on May 26, 2014, 12:37:03 AM
-
I'm dynamically creating a label and anchoring it to an object that moves. I'm calling the UILabel.SetAnchor(myObj) function. For some objects, even if the object is standing in idle, assigning the object as the anchor causes the label to move upwards off the screen very quickly.
This didn't happen with my previous version of NGUI. I am on 3.6.0, and this has been happening for the last couple of versions.
-
I made an interesting class to solve this problem. Message me privately if you are interested in putting the solution into NGUI.
-
How would I reproduce this on my end?
-
Essentially, anchor the UILabel to an animating character. That's what did it for me.
-
I just ran into this too, with a UISprite anchored in code to another UISprite's background whose size changes. However, even when the size of the target doesn't change, it keeps shooting the transform's y to infinity.
-
I can see this happening if you create a circular anchor: something anchored to a parent object that includes the child in its bounds, so basically something that effectively gets anchored to itself. I'll need an actual step by step guide or a repro case to examine this further as "anchor a label to an animating character" doesn't give me anything.
-
I fixed the problem with an interesting workaround, so I don't have anything to send you. I'm sure you are right in that it is some kind of circular dependency. Hopefully the other commenter has a fresh project that can be sent to you!