- Home /
The question is answered, right answer was accepted
unity UI rectTransform and Canvas
Hi, someone have issues with recttransform values driven by canvas ?
I want to get the "width / height" values from a RectTransform component which is associated with "Canvas/CanvasScaler" but the values that I get are the initial ones not the ones driven by the canvas scaler.
Someone already encountered this issue ? There is something special to do to get them ?
Thanks in advance for your answer.
Just curious about it... when you get canvas localScale properties do you get different values from the ones you expect?
Regards
Yes. 1.0 / 1.0 / 1.0. I notice somethings really strange... It seems all the values are setup only when the canvas is truely display on the screen... So I can't get his value in an Awake state for exemple... even start seems touchy...
But if I try this in an update state it's ok :/. But I want set all of this value before it's rendered on the screen
Answer by Liszt · Feb 19, 2015 at 04:45 PM
It seems I did something wrong in my code workflow. Now it works !
Thanks again
Follow this Question
Related Questions
Scaling UI position 0 Answers
Force UIImage to stay on viewport? 0 Answers
stopping an ui element from moving if the y axis value is too low 0 Answers
Canvas rectTransform randomly resetting in the Editor 3 Answers