- Home /
Question by
Proximal-Pyro · Mar 05, 2013 at 08:36 PM ·
rpggui.box
GUI RPG box on keypress
Hey!
I have a problem that I hope I can get help with.
Basicly im trying to make a RPG type of game. I need it like when I press [z] on the keyboard it comes a popup window for skillpoints. I am using a GUI.Box now so that's fine, no custom texture needed. I'm coding in javascript and I would be glad if anybody tried to help me :). This is how my code looks now:
#pragma strict
var skillIsOpen : boolean = false;
function OnGUI () {
if(Input.GetKeyDown(KeyCode.Z)) {
if(skillIsOpen == false) {
skillIsOpen = true;
}
else {
skillIsOpen = false;
}
}
if(skillIsOpen == true) {
GUI.Box(Rect(5, 5, 750, 750), "");
}
}
Thanks //Proximal-Pyro
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
error CS1023: An embedded statement may not be declaration or labeled statement 1 Answer
Targetting Script Error Help 1 Answer
Subtitles in fps game 2 Answers
RPG Levelling Script using GUI Text help 0 Answers