Hello,
I posted this on Unity Answers but since it's concerning NGUI I figured I might get a more accurate response here:
I'm creating an item tooltip for my game using NGUI - consisting of a sprite background and multiple UILabels.
I'm moving these UILabels down/up depending on the number of rows of the previous ones - for instance, if an item has a longer description, the label showing its stats will be moved lower down to not overlap. I'm using this simple code to move the labels - labelText4 is a UILabel:
labelText4
.transform.position = new Vector3
(
labelText4.transform.position.x, labelText4.transform.position.y-0.055f,
labelText4.transform.position.z
);
This code for instance moves the fourth label down a bit.
However, this does not move the label in absolute pixel values - in other words, if I change the screen resolution it will not be moved correctly. How can I move an UILabel through script like I move any NGUI element in the Unity Editor?