- Home /
NGUI - move label in absolute pixels
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 an 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?
Your answer
Follow this Question
Related Questions
Positioning Label with NGUI 1 Answer
NGUI countdown in label 0 Answers
NGUI labels are fading out on iOS device 0 Answers
Getting the text from UIInput 1 Answer
NGUI score counter 4 Answers