Ok I have a few questions:
a) When code has this: (new Rect(0,0,0,0));
That really means: (new Rect(width,height,total width, total height)); correct?
b) what does total height and total width stand for?
c) If my screen resolution is 1366x768 what would be dead center if I was writing GUI for a label?
Here is the code I have so far for C if it helps (Also if you see anything wrong with it please point it out):
using UnityEngine;
using System.Collections;
public class TitleScreenGUI : MonoBehaviour {
private float originalWidth = 1366.0f; //My screen width
private float originalHieght = 768.0f; //My screen height
private Vector3 scale;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI () {
scale.y = Screen.height/originalHieght; //Calculates Verticle Scale
scale.x = Screen.width/originalWidth; //Keeps ratio based on verticle scale
scale.z = 1;
var svMat = GUI.matrix; //save current matrix
GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, scale); //Sets up new matrix
GUI.Label(new Rect(650,384,1366,768), "Press Enter");
GUI.matrix = svMat; //restore original matrix
}
}