Well so here it is. I have created the GUI and I want to create a slide effect. For example, when the user click the Start Button, the GUI elements should slide over 1000 pixels to the left and reveal the level select menu. When the users click the Return button, the GUI elements should slide back to the right. I have created the GUI but am having trouble with the sliding part. Here is my script.
var customSkin : GUISkin;
function OnGUI ()
{
GUI.skin = customSkin;
///Main Menu
if (GUI.Button (Rect (0,350,250,50), "Start Game"))
{
ShowLevels();
}
///LevelSelect Menu///
GUI.BeginGroup(Rect(1125,125,750,500));
GUI.Box(Rect(0,0,750,425),"");
///Set One
GUI.Box(Rect(25,25,200,200),"Snapshot Here");
GUI.Label(Rect(50,250,150,75), "The level description goes here!");
if (GUI.Button(Rect(25,350,200,50),">>Select<<"))
{
Application.LoadLevel(2);
}
///Set Two
GUI.Box(Rect(275,25,200,200),"Snapshot Here");
GUI.Label(Rect(300,250,150,75), "The level description goes here!");
if (GUI.Button(Rect(275,350,200,50),">>Select<<"))
{
Application.LoadLevel(3);
}
///Set Three
GUI.Box(Rect(525,25,200,200),"Snapshot Here");
GUI.Label(Rect(550,250,150,75), "The level description goes here!");
if (GUI.Button(Rect(525,350,200,50),">>Select<<"))
{
Application.LoadLevel(4);
}
///Bottom Buttons
if (GUI.Button(Rect(0,450,375,50),"<<Return To Main Menu<<"))
{
ShowMenu();
}
GUI.Box(Rect(375,450,375,50),"More Levels Coming Soon!");
///End Group
GUI.EndGroup();
}
/// moves GUI over to show level menu
function ShowLevels()
{
}
/// moves GUI back to main menu
function ShowMenu()
{
}
Notice that I have yet to define the ShowLevels and ShowMenu functions. That is my area of need. I have experimented with Tom Higgin’s template but it was not the result I wished for.
Thanks,
Geek377