Lerpz scripting woes

Hey All,

I'm an artist and a brand-new Unity user. I'm working through the Lerpz tutorial and got stuck on the 'Creating the Start Menu' Splash screen starting on pg 56 of the tutorial... You're supposed to add a bunch of scripts to a JavaScript file called StartMenuGui. Anyway, I'm an artist, and scripting is not my strong suit. Could someone please show me how the StartMenuGUI.js is supposed to look? You can see how mine looks (below), I'm pretty sure it's wrong (Please no laughing):

// Make the script also execute in edit mode
@script ExecuteInEditMode()
function Update () {
var gSkin : GUISkin;
var backdrop : Texture2D; // our backdrop image goes in here.
}
private var isLoading = false; // if true, we'll display the "Loading..." message.
function OnGUI()
{
if (gSkin)
GUI.skin = gSkin;
else
Debug.Log("StartMenuGUI: GUI Skin object missing!");
var backgroundStyle : GUIStyle = new GUIStyle();
backgroundStyle.normal.background = backdrop;
GUI.Label ( Rect( (Screen.width - (Screen.height * 2)) * 0.75, 0, Screen.height * 2,
Screen.height), "", backgroundStyle);
GUI.Label ( Rect( (Screen.width/2)-197, 50, 400, 100), "Lerpz Escapes",
"mainMenuTitle");
}
if (GUI.Button( Rect( (Screen.width/2)-70, Screen.height - 160, 140, 70), "Play"))
{
isLoading = true;
Application.LoadLevel("TheGame"); // load the game level.
}
var isWebPlayer = (Application.platform == RuntimePlatform.OSXWebPlayer ||
Application.platform == RuntimePlatform.WindowsWebPlayer);
if (!isWebPlayer)
{
if (GUI.Button( Rect( (Screen.width/2)-70, Screen.height - 80, 140, 70), "Quit"))
Application.Quit();
}
if (isLoading)
{
GUI.Label ( Rect( (Screen.width/2)-110, (Screen.height / 2) - 60, 400, 70),
"Loading...", "mainMenuTitle");
}

Thanks for your help...I heard you laughing.

Stef

You might want to include a link to your identical post on the Unity forums so that people don't duplicate their efforts in answering.

1 Answer

1

You too Jesse, cause now im at this pointless page with no place to go...and you seemed to know all about it