Un-drawing

How do you hide text that you've draw using the drawing blocks?


Don't draw it.
So, your saying that once text is there, there isn't a way to hide it?

Hectate

  • *
  • Posts: 4643
To clarify, if you put the "draw text" inside of an "IF" block, you can check for conditions to determine if the texts gets drawn or not.

The "while drawing" wrapper is just like the "always" wrapper. It gets run repeatedly during the game and if something changes how it's code is interpreted, the drawing commands will as well.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

To clarify, if you put the "draw text" inside of an "IF" block, you can check for conditions to determine if the texts gets drawn or not.

The "while drawing" wrapper is just like the "always" wrapper. It gets run repeatedly during the game and if something changes how it's code is interpreted, the drawing commands will as well.
But once text is drawn, there is no way to hide it?

Hectate

  • *
  • Posts: 4643
You're thinking of it the wrong way. The text is not a permanent object on the screen simply because you put a drawing command in there.

Every frame is drawn completely over from scratch, every time.

Thus, if you have the following code in your While Drawing blocks...

Code: [Select]
IF ( DrawMyText == True)
{ Draw Text "This is a line of text!" at X, Y }

... then the statement "This is a line of text!" will only be drawn to the screen for any frames that happen while DrawMyText is true.

That means if you change it to false, the text won't be drawn to the screen for any more frames until you change it back.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

thegenericbanana

  • *
  • Posts: 494
To clarify, if you put the "draw text" inside of an "IF" block, you can check for conditions to determine if the texts gets drawn or not.

The "while drawing" wrapper is just like the "always" wrapper. It gets run repeatedly during the game and if something changes how it's code is interpreted, the drawing commands will as well.
But once text is drawn, there is no way to hide it?
Look, if you stop drawing it, it disappears. Example:

If boolean=true
draw text Testing


That way, if boolean is true, it draws testing. If after it drew that boolean turns to false, it erases the text. If it stops drawing it, it erases itself.
EDIT: Ninja'd.
Johnny Turbo's Surgery Frenzy

You're thinking of it the wrong way. The text is not a permanent object on the screen simply because you put a drawing command in there.

Every frame is drawn completely over from scratch, every time.

Thus, if you have the following code in your While Drawing blocks...

Code: [Select]
IF ( DrawMyText == True)
{ Draw Text "This is a line of text!" at X, Y }

... then the statement "This is a line of text!" will only be drawn to the screen for any frames that happen while DrawMyText is true.

That means if you change it to false, the text won't be drawn to the screen for any more frames until you change it back.

Ah, makes sense. Thanks!