Textdraw GUI dissapears
#1

After some creating and destroying textdraws, it seems that uddenly the textdraws dissappear. And by disappear I mean they litteraly are not visible, either clickable. I think this is because Im creating destroying too many textdraws very often. What's going on?
Reply
#2

Important Notes:

Maximum length of textdraw is 800 characters. Longer text will crash the client.
If you use color codes (such as ~R~ ~G~) beyond 255th character the client will crash trying to display the textdraw.
If you choose values for y that are less than 1, the first text row will be invisible and only the shadow is visible.
text[] must NOT be empty or the server will crash! If you need a textdraw that shows nothing, use " " (a space) or _ (underscore)
If the last character in the text is a space (" "), the text will all be blank.
If part of the text is off-screen, the colour of the text will not show, only the shadow (if enabled) will.
Notes:

The x,y coordinate is the top left coordinate for the text draw area based on a 640x480 "canvas" (irrespective of screen resolution). If you plan on using TextDrawAlignment with alignment 3 (right), the x,y coordinate is the top right coordinate for the text draw.
This function merely CREATES the textdraw, you must use TextDrawShowForPlayer to show it.
Reply
#3

There really aren't many instances where it is useful to destroy a textdraw since they usually need to reappear later. What are you trying to achieve?
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
There really aren't many instances where it is useful to destroy a textdraw since they usually need to reappear later. What are you trying to achieve?
It's a GUI for a screen I'm making. Every click changes textdraws. Somewhere I read earlier, it said that you don't destroy a created textdraw, it will crreate alot of unneccessary textdraws. (I was using textdrawhide)
Reply
#5

Help
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
There really aren't many instances where it is useful to destroy a textdraw since they usually need to reappear later. What are you trying to achieve?
Agree with this point 100 percent, if your deleting textdraws it should be for a good reason namely playertextdraws which are automatically destroyed when a player logs out which means you'll almost never need to delete textdraws unless it's in OnGameModeExit().

Note: Using OnGameModeExit() will often cause client bugs I recommend a auto-restart script so you might not need to ever delete textdraws.

I'll have to dig out my post on organizing textdraws.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)