hi everybody, I’m trying to move vertically a simple gui button, but I can’t figure it out. I’m not a programmer and my gui is very simple, I’ve tried to move a cube through animation and itween and it works, but how i can move the button? here’s my code
var controlTexture : Texture;
var customSkin : GUISkin;
function OnGUI () {
GUI.Label (Rect (Screen.width/2-250, Screen.height/2-65, 500, 150), controlTexture);
GUI.Box (Rect (0,0,150,100), "Top-left");
GUI.Box (Rect (Screen.width - 150,0,150,100), "Top-right");
GUI.Box (Rect (0,Screen.height - 100,150,100), "Bottom-left");
GUI.Box (Rect (Screen.width - 150,Screen.height - 100,150,100), "Bottom-right");
if (GUI.Button (Rect (Screen.width/2-250, Screen.height/2 - 170, 500, 100), "collocazione A")) {
isLoading = true;
Application.LoadLevel("level1"); // load the game level.
print ("you clicked collocazione A");
}
if (GUI.Button (Rect (Screen.width/2-250, Screen.height/2 + 70, 500, 100), "collocazione B")) {
print ("you clicked collocazione B");
}
}
and another question: I used Application.LoadLevel to load a level with another gui, how can I simply load a new window or label when I click the button?
thank you!