(Redirected from Clear (block))

Erase All
erase all
Category Pen
Type Stack

The Erase All block is a Pen block and a stack block. The block removes all marks made by the pen or stamping. This block is the only Pen block that the Stage can use.

This block was named "Clear" in older versions of Scratch (Scratch 1.4 and 2.0).

Example Uses

This block is used in most projects involving the pen, as clearing the screen once the project starts would be a main priority.

Some common uses for the Erase All block are:

  • Clearing the screen in a paint program
when this sprite clicked
switch costume to [pressed v]
erase all
wait until <not <mouse down?>>
switch costume to [not pressed v]
  • Resetting the penning ground in a pattern maker
wait until <(dots made) > [50]>
set [dots made v] to [0]
erase all
  • Removing stamps in a maze generator or something similar
when I receive [next maze v]
erase all
broadcast [generate v]
  • Clearing the screen to draw the next frame in a pen animation
when gf clicked
forever
    draw
end

define draw
erase all
. . .

See Also