- Home /
Getting on screen sizes of a UI element in Unity 4.6 (while using CanvasScaler),Get the real size on screen of an UI element in Unity 4
I setted up my UI with Unity 4.6. Assuming that I have a button, I can access to the size of this button using:
rectTransform.sizeDelta
The size obtained here is the same that I can see in the editor. If I use the CanvasScaler enabled with "Scale with screen size", the actual size on the screen of this component may differ from rectTransform.sizeDelta
. How can I get the real sizes of it on screen?,
Comment
if you are able to access to scale factor that CanvasScaler uses at a specific time, you can simply multiply it with rectTransform.sizeDelta. I am not pretty sure however:)
Hey @ProG$$anonymous$$, have you found a solution for this one?