- Home /
Multi-resolution!!! Sprite and GUI
I solved the problem, I created a GUITexture and put all indicators of position and texture size to zero, put the scala x and y size to zero too. Once positioned the alert by the GameObject transform object and made a script with parameters of height and width of the image and size you want to adiconar every GUI that calculates the size of the gui according to the resolution.
X = 0.5 / (Screen.Width / Screen.Height) * (ImageScaleX / ImageScaleY) Y = 0.5
It worked perfectly.
It really is necessary to treat all my sprites, texture and background for GUI code to comply with the resolution of my screen? There is nothing automatic? I've looked all do 2 days and find only solutions to be applied to all objects in all of the screen. There is at least one solution?
Answer by Romano · May 19, 2014 at 02:26 PM
Funnily enough I had the same problem recently and totally forgot I downloaded this ages ago: https://www.assetstore.unity3d.com/en/#!/content/9224
Free download from the Unity asset store called Asset Importer. You just need to treat one sprite how you want the rest of them to be and then use that as a template for the others. This method does require reimporting the sprites.
The other method would be to ctrl click all the sprites you want to change and then mess with the settings en masse in the inspector.
Unless maybe I'm misunderstanding the problem?
Thanks for trying to help, however I have expressed myself wrong. What I want is that all objects on the screen to behave the same way and change its size regardless of resolution.
Ah ok sorry. If you edit your question and rephrase it a little bit it should go back up to the top of the questions and someone else might be able to give you the right answer :)