Results 1 to 5 of 5

Thread: HUD not working

  1. #1
    Sergeant EvoloZz's Avatar
    Join Date
    Sep 2012
    Location
    Helsinki, Finland
    Posts
    360
    Thanks
    314
    Thanked 167 Times in 120 Posts

    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

    ~EvoloZz

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    You called ShowText()?
    timescale 0.01

  3. The Following User Says Thank You to kung foo man For This Useful Post:

    EvoloZz (17th November 2012)

  4. #3
    Sergeant EvoloZz's Avatar
    Join Date
    Sep 2012
    Location
    Helsinki, Finland
    Posts
    360
    Thanks
    314
    Thanked 167 Times in 120 Posts
    Quote Originally Posted by kung foo man View Post
    You called ShowText()?
    The problem was so simple, thanks

  5. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    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.

  6. The Following 2 Users Say Thank You to Tally For This Useful Post:

    EvoloZz (17th November 2012),kung foo man (17th November 2012)

  7. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Usage will be cleared at the end of the function, which is very very soon (cause no waits)

  8. The Following User Says Thank You to IzNoGoD For This Useful Post:

    kung foo man (17th November 2012)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •