Hello, what I’m trying to wonder is how do I make a Start Menu that behaves like one. We know what they are like, you click on the “New Game” button and a box appears on what game slot you would like to save and such. What I’m trying to do, is make this happen. By simply clicking on button which then draws the texture of the GUI 2D thing. Here’s my code.
var newGame : Texture2D;
var loadGame : Texture2D;
var options : Texture2D;
var skirmish : Texture2D;
var multiplayer : Texture2D;
var quitGame : Texture2D;
var newGameTemplate : Texture2D;
/*var loadGameTemplate : Texture2D;
var optionTemplate : Texture2D;
var skirmishTemplate : Texture2D;
var multiplayTemplate : Texture2D;
var quitGameTemplate : Texture2D;*/
function OnGUI()
{
if (GUI.Button(Rect(13,80,250,50), "")) //New Game Button
{
}
if (GUI.Button(Rect(18,190,250,50), "")) // Button Load Game
{
}
if (GUI.Button(Rect(13,308,195,50), "")) //Button Options
{
}
if (GUI.Button(Rect(16,420,200,50), "")) //Button Skirmish
{
}
if (GUI.Button(Rect(13,515,310,50), "")) //Button Multiplayer
{
}
if (GUI.Button(Rect(10,620,260,30), "")) //Button Quit
{
Application.Quit();
}
}
The Buttons fit over my set of Textures if your wondering why I have the comments laid out as it is. So I’ll say this again to be clear. What would be the code if the GUI button gets hit?.
I was thinking, I have already tried this I think if not similar.
In between the
if (GUI.Button(Rect(13,80,250,50), "")) //New Game Button
{
GUI.DrawTexture(newGameTemplate);
}
But of course there has to be a “Rect” to make a Rectangle around it and a position… I’m tired seeing errors and wasting time trying to make a simple Start Menu. If you have any idea on what I’m rambling about, then please help me.