How would you convert this script:
var originalWidth = 640.0;
var originalHeight = 400.0;
private var scale: Vector3;
function OnGUI(){
scale.x = Screen.width/originalWidth; // calculate hor scale
scale.y = Screen.height/originalHeight; // calculate vert scale
scale.z = 1;
var svMat = GUI.matrix; // save current matrix
GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, scale);
GUI.Box(Rect(10,10,200,50), "Box");
GUI.Button(Rect(400,180,230,50), "Button");
GUI.matrix = svMat; // restore matrix
}
into C#?
The origonal post: Script gui units - Questions & Answers - Unity Discussions