- Home /
Question by
RuiFerreira · Aug 18, 2014 at 02:24 AM ·
javascriptguibox
JavaScript: GUI Box help
I'm getting a lot better in programming now. But I can't figure out the GUI problem that I am having. If you look down to function OnGUI() I want to display those lines that are in comments inside a single GUI box. Can anyone help me? Thanks! :)
//Rui Test JS.
//HealthBar
var currenthealth : int=100;
var maxhealth : int=100;
var display_1 : GUIText;
//MagicBar
var currentmagic : int=100;
var maxmagic : int=100;
var display_2 : GUIText;
function update() {
if (currenthealth < 0) {
currenthealth = 0;
}
}
if (currentmagic < 0) {
currentmagic = 0;
}
function OnGUI() {
//"Magic : " + currentmagic + "/" + maxmagic;
//"Health : " + currenthealth + "/" + maxhealth;
}
Comment
Best Answer
Answer by Grizzly · Aug 18, 2014 at 02:54 AM
I think you will find answer here http://docs.unity3d.com/Manual/gui-Basics.html
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
GuiTexture Width Change 1 Answer
GUIText Problem With MENU 1 Answer
GUI will not disappear 1 Answer
Help with points Algorithm? 2 Answers