- Home /
Question by
Nightlord491 · Oct 16, 2012 at 12:27 AM ·
guirpgtoolbar
Toolbar Selection
Hello, I was making my character selection screen but got stuck on a probably stupid problem. The thing is that I want to be able to click one of the options, either Assassin, Mage, or Tank and then have a GuiText appear. I have the GuiText ready, but I just have to find out how to make the toolbar toggle it. Here is my code. var originalWidth = 640.0; // define here the original resolution var originalHeight = 400.0; // you used to create the GUI contents var toolbarInt = 3; var toolbarStrings : String[] = ["Assassin", "Tank", "Mage"];
private var scale: Vector3;
function OnGUI(){
scale.x = Screen.width/originalWidth; // calculate hor scale
scale.y = Screen.height/originalHeight; // calculate vert scale
scale.z = 1;
var svMat = GUI.matrix; // save current matrix
toolbarInt = GUI.Toolbar (Rect (450, 25, 400, 50), toolbarInt, toolbarStrings);
}
Comment
Your answer
Follow this Question
Related Questions
Paper, Rock, Scissor 3 Answers
Add a button to toolbar/selection grid? 1 Answer
Attaching Scripts to GUI Components 1 Answer
Toolbar question... 1 Answer