September 2010
Beginner
384 pages
8h 49m
English
In order to center the button on the screen, you need to adjust the TitleGUI script.
OnGUI function:function OnGUI () {
// button width:
var buttonW:int = 100;
// button height:
var buttonH:int = 50;
// half of the Screen width:
var halfScreenW:float = Screen.width/2;
// half of the button width:
var halfButtonW:float = buttonW/2;
if(GUI.Button(Rect(halfScreenW-halfButtonW,560,buttonW,buttonH), "Play Game"))
The code is just a touch hairier now, ...
Read now
Unlock full access