I am setting up a basic HUD using as much auto-layout as I can for it to play at various screen resolutions.
I like the control that I can get with the layout areas and horizontal controls.
However - function calls don’t seem to work if they are within the layout areas as below.
If I move the same button out of the GuiLayout.BeginArea -EndArea it works.
So how do you call a funtion using button that have been defined in these layout areas?
+++++++++++++++++++++sample snip
function OnGUI ()
{
GUI.skin = customSkin;
GUILayout.BeginArea (Rect (60,Screen.height - 112,1900,128));
GUILayout.BeginHorizontal ();
GUILayout.Button (“Chat”,“ChatStyle”);
GUILayout.Button (“Teacher”,“TeacherStyle”);
GUILayout.Button (“NotePad”,“NotePadStyle”);
GUILayout.Button (“Locker”,“LockerStyle”);
GUILayout.Button (“Map”,“MapStyle”);
GUILayout.Button (“Navagtor”,“NavagatorStyle”);
GUILayout.Button (“Alert”,“AlertStyle”);
if (GUILayout.Button (“Main Menu”,“MainMenuStyle”))
** {**
** isLoading = true;**
** Application.LoadLevel(0);**
** print (“you clicked me!”);**
** }**
GUILayout.EndHorizontal ();
GUILayout.EndArea();