Say I have drawn a texture for my button and it has a certain aspect ratio, however I want to scale it up and down depending on screen size.
How would I do that? The anchor options as far as I can see change the aspect ratio.
Say I have drawn a texture for my button and it has a certain aspect ratio, however I want to scale it up and down depending on screen size.
How would I do that? The anchor options as far as I can see change the aspect ratio.
Hey there,
You can do this pretty easily (to my dismay after writing my own way in beta
). You just have to add a AspectRatioFitter component to your image object. It gets the aspect ratio of the image and you pick how it scales (Width Controls Height, Height Controls Width, Fit in Parent, or Envelope Parent)
Regards,
thank you, I knew there had to be a simple way.
It has been a big change for me to leave OnGUI.
No problem ![]()
I still like imGUI and I enjoy using it for all editor window stuff.