- Home /
Question by
gangafinti · May 04, 2016 at 04:39 PM ·
screensize
Finding the size of an image after it has been scaled to screen size.
I have a canvas that is an overlay on my screen, in that canvas I have an image. The canvas scales everything to screen size, but that doesnt adjust the width and heigt of my image's rectTransform.rect. How can I get that scaled size(width/height) of my Image?
Comment
Answer by FortisVenaliter · May 04, 2016 at 04:53 PM
Check out the RectTransformUtility class. It has a bunch of cool stuff, including a function or two for exactly what you need. Although, Intellisense will tell you it has several more useful functions than the Unity docs, which is odd.