-
HUD not working
I wanted to make a HUD that would show some text on the bottom of the screen, but I dont seem to get it working
Here's where i precached it:
Code:
game["hud_text"] = &"RAndom TeXt";
precacheString(game["hud_text"]);
Under spawnPlayer() I have:
Code:
ShowText()
{
self endon("disconnect");
self endon("joined_spectators");
if(!isDefined(self.text_right))
{
self.text_right = newClientHudElem(self);
self.text_right.x = 249;
self.text_right.y = 471;
self.text_right.alignX = "left";
self.text_right.alignY = "middle";
self.text_right.sort = 1;
self.text_right.alpha = 1;
self.text_right.fontScale = 1.2;
self.text_right.archived = true;
self.text_right setText(game["hud_text"]);
}
}
Tell me if something is wrong, again I say that I am newb :D
~EvoloZz
-
-
Quote:
Originally Posted by
kung foo man
You called ShowText()?
The problem was so simple, thanks :D
-
1 more thing - don't use endon() unless there is a wait time of some sorts: either wait( time ) or waittill( event ). The use of endon() uses up script variables, and when you hit the limit, it will shut down your server.
-
Usage will be cleared at the end of the function, which is very very soon :) (cause no waits)