I am trying to set up a GUI for a fixed Screen Ratio. I know my game will only be playing on a 1024x768 screen and I know my image is the same ratio, but when it I test it out my image doesn't fit. ANy one know how to do this. FOr now I don't need anything complex. My GUI design isn't done yet but I just want to get a .png in there to see how it looks.
If your screen size and image size are 1024x768, then you could do this:
var texture : Texture2D; // Assign it via the inspector
function OnGUI()
{
GUI.DrawTexture(Rect(0.0f, 0.0f, Screen.width, Screen.height), texture);
}
It should then fit. You could also say 1024.0f and 768.0f instead of Screen.width and Screen.height.