x


Resolution question...

My game looks fine when it is played at the resolution 966 X 644, but when it is played at any other resolution once the game is published (or even when I change the size of the "Game" view in the unity scene editor) the screen gets distorted. The camera's viewing angle and height are messed up, GUI elements are displaced, etc. How can I make this not happen?

EDIT here is the code I was refering to. I developed my GUI using absolute pixel positions, but this is supposed to scale it to any resolution(this code goes in the OnGUI function).

GUI.matrix = Matrix4x4.Scale(Vector3(966 * Screen.width, 644 * Screen.height, 1));
more ▼

asked Feb 27 '11 at 08:28 AM

Tyler 2 gravatar image

Tyler 2
1.1k 211 246 264

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

for the GUIs you need a piece of script on each that lets each GUI scale with the screen http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=Screen

as for the camera problems make sure you havn't messed around with it's settings too much. check the clipping ranges are 0.3 for close and 1000 for far,if you cant see part of your level because of this change, it means your level maybe to big. check your field of view is around 60 too.

Let us know what happens when you try this, whether it works or the new problems you are having.

more ▼

answered Feb 27 '11 at 05:16 PM

AngryOldMan gravatar image

AngryOldMan
2.5k 12 21 47

My camera uses the default settings you mentioned and I have tried using a GUI scaling script(its in my edited question), I have no idea why this is happening? Could it be because my game was on free aspect when most of the stuff was designed? Although now when I put it on a 3:2 aspect ratio (or 966 X 644 for the resolution) it looks perfect.

Feb 27 '11 at 06:20 PM Tyler 2
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2999
x379

asked: Feb 27 '11 at 08:28 AM

Seen: 969 times

Last Updated: Feb 27 '11 at 06:21 PM