Skip to content

Instantly share code, notes, and snippets.

@doskoi
Created July 7, 2011 10:12
Show Gist options
  • Save doskoi/1069240 to your computer and use it in GitHub Desktop.
Save doskoi/1069240 to your computer and use it in GitHub Desktop.
Unity3D GUI Resolution
function OnGUI() {
var screenScale: float = Screen.width / 480.0;
var scaledMatrix: Matrix4x4 = Matrix4x4.identity.Scale(Vector3(screenScale,screenScale,screenScale));
GUI.matrix = scaledMatrix;
// then do the rest of your GUI as per normal, using the 480x320 screen size you had for your standard res iPhone app
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment