I’ve been up for the last two hours scaling a single menu on my game. This is the start menu and composes of a Window, Two buttons, a Label, and 5 Textures.
Oh.
My.
Freaking.
God.
Please tell me there is an easier way than this, granted this works… it just feels all too messy.
GUI.DrawTexture (new Rect (Screen.width / 2 - (Screen.width / 16), Screen.height / 28, Screen.width / 7, Screen.height / 10), SkullFlare);
GUI.DrawTexture (new Rect (Screen.width / 2 - (Screen.width / 32), Screen.height / 28, Screen.width / 13, Screen.height / 13), SkullFrame);
GUI.DrawTexture (new Rect (Screen.width / 2 - (Screen.width / 41), Screen.height / 22, Screen.width / 18, Screen.height / 18), SkullIcon);
GUI.Label(new Rect(
Screen.width / 3 - (Screen.width / 22),
Screen.height / 4 - (Screen.height / 75) ,
Screen.width / 3 + (Screen.width / 10),
Screen.height / 7),
"GameNameHidden");
// Left Dragon
GUI.DrawTexture(new Rect (
Screen.width / 16,
Screen.height / 4 - (Screen.height / 31),
Screen.width / 4 + (Screen.width / 54),
Screen.height / 3 + (Screen.height / 10)
), PlayerSprite
);
// Right Dragon
GUI.DrawTexture (new Rect (
Screen.width - (Screen.width / 3) + (Screen.width / 100),
Screen.height / 4 - (Screen.height / 31),
Screen.width / 4 + (Screen.width / 54),
Screen.height / 3 + (Screen.height / 10)
), PlayerSpriteFlipped
);
// Buttons
GUI.Button (new Rect (
Screen.width / 3,
Screen.height / 2 - (Screen.height / 16),
Screen.width / 3 + (Screen.width / 75),
Screen.height / 14),
"Play Now!");
GUI.Button (new Rect (
Screen.width / 3,
Screen.height / 2 + (Screen.height / 16),
Screen.width / 3 + (Screen.width / 75),
Screen.height / 14),
"Highscores!");
Please ignore the conventions, I kept everything on it’s own line while I was tweaking it.
(( This is to make the menu look the same, regardless of the resolution of the device ))