- Home /
Android Resolution Problem
Hello. I have a problem:
When I run my game on PC looks fine but when I run game on Android the game has a lower resolution so not seen a two joysticks or any GUITexture. What can I do to move the GUI to resolution?
Thanks in advance;)
You should change the draw rectangles of your GUI. You could make them resolution-dependant
Answer by Andre Barbosa · Aug 06, 2013 at 10:06 AM
If you don't mind the aspect ratio you can do the following:
Get the two resolution modifiers (x,y), based on your working resolution:
var resolution = new Vector2(Screen.width, Screen.height);
var resx = resolution.x/1280.0f; // 1280 is the x value of the working resolution (as described in the first point)
var resy = resolution.y/800.0f; // 800 is the y value of the working resolution (as described in the first point
And then just use this modifier to resize/relocate the Rects which contain your textures:
targetRect = Rect(70*resx,370*resy,150*resx,140*resy);
Your answer
Follow this Question
Related Questions
Screen Resolution and GUI cutoff issue. Android. 1 Answer
How to make Canvas appear after GUI texture? Unity 4.7 0 Answers
How to set GUI X and Y point according to accelerometer input.? 0 Answers
Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer
Strange GUITexture prefab problem with pixelInset.width 1 Answer