Jump to content


Photo

Erasing Text


  • Please log in to reply
5 replies to this topic

#1 jakethecreator

jakethecreator

    GMC Member

  • New Member
  • 68 posts

Posted 08 October 2009 - 05:02 PM

I know its a simple problem,
but whats the code to erase drawn text?

Edited by jakethecreator, 08 October 2009 - 05:09 PM.

  • 0

#2 A saurus1

A saurus1

    GMC Member

  • Sandbox Moderators
  • 1608 posts
  • Version:GM8.1

Posted 08 October 2009 - 05:05 PM

I know its a simple problem,
but whats the code to erase drawn text?


If you are talking about erasing text drawn in the draw event, you must first know that the things drawn in the draw event are cleared and redrawn every step, and so it's not a matter of erasing drawn text, but of not drawing it. You can do this with a variable that you check in the draw event, and draw the text only if the variable is a certain value. Do you understand?
  • 0

#3 ramses12

ramses12

    6

  • GMC Member
  • 5769 posts
  • Version:GM8.1

Posted 08 October 2009 - 05:07 PM

You have to use a variable for example
text_drawn=true; //in the create event
if(text_drawn==true)draw_text(...) //in the draw event
text_drawn=false //in the event where you want to remove the text

Edited by ramses12, 08 October 2009 - 05:08 PM.

  • 0

#4 Colton530

Colton530

    GMC Member

  • GMC Member
  • 421 posts

Posted 08 October 2009 - 05:08 PM

if you want to delete the whole text then in any event that you want to cause it to go blank,

keyboard_string = ''

Change keyboard string to whatever string you use.
  • 0

#5 jakethecreator

jakethecreator

    GMC Member

  • New Member
  • 68 posts

Posted 08 October 2009 - 05:09 PM

I know its a simple problem,
but whats the code to erase drawn text?


If you are talking about erasing text drawn in the draw event, you must first know that the things drawn in the draw event are cleared and redrawn every step, and so it's not a matter of erasing drawn text, but of not drawing it. You can do this with a variable that you check in the draw event, and draw the text only if the variable is a certain value. Do you understand?


Ah,
thanks.
  • 0

#6 vv3k70r

vv3k70r

    GMC Member

  • New Member
  • 103 posts

Posted 08 October 2009 - 05:10 PM

You can even use ascii code for sign DEL :whistle:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users