- Home /
Question by
Emanuel19861 · Oct 08, 2017 at 03:12 PM ·
spritespriterendererscaling
Sprite renderer scaling
Any idea how to scale a sprite so that it scales depending on the screen ratio?
For example if the screen is in portrait mode it expands to fill the width while maintaining the aspect ratio, and if the screen is in landscape mode it expands to fill the height while maintaining the aspect ratio.
Basically the behavior the Rect Transform provides for images but apparently does not apply to sprites.
I'm trying to use this method because the parent GameObject is already a child of a canvas so it scales automatically with the screen and it's placed exactly where I need it to be so it would be extremely convenient if I could just place the sprite in the middle of it and not have to worry about it.
Thank you.
Comment