Created
March 11, 2013 09:42
-
-
Save HiromichiYamada/5133098 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var screenScale : float; | |
private var scaledMatrix : Matrix4x4; // for scaling. | |
function Start () { | |
// for scaling. | |
screenScale = Screen.width / 320.0f; // for portlait only. | |
scaledMatrix = Matrix4x4.identity.Scale(Vector3(screenScale,screenScale,screenScale)); | |
} | |
function OnGUI () { | |
// for scaling. | |
GUI.matrix = scaledMatrix; | |
var sw : int = Screen.width/screenScale; | |
var sh : int = Screen.height/screenScale; | |
// layout GUI parts as 320x480 screen. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment