m (made it clearer)
m (argh)
Line 1: Line 1:
 
{{block
 
{{block
 
| name      = Erase All (Clear)
 
| name      = Erase All (Clear)
| image      = File:2.0 Clear.png
+
| image      = erase all
 
| category  = [[Pen Extension|Pen Extension]]
 
| category  = [[Pen Extension|Pen Extension]]
 
| type      = [[Stack Block|Stack]]
 
| type      = [[Stack Block|Stack]]
}}The '''Erase all''' [[Blocks|block]] is a [[Pen Extension|Pen block]] and a [[Stack Block|Stack block]]. The block removes all marks made by the [[pen]] or [[stamps]]. This block is the only Pen block that the [[Stage]] can use.
+
| sb        = yes
 +
}}
 +
The '''Erase all''' [[Blocks|block]] is a [[Pen Extension|Pen block]] and a [[Stack Block|Stack block]]. The block removes all marks made by the [[pen]] or [[stamps]]. This block is the only Pen block that the [[Stage]] can use.
  
 
This block was named "Clear" in older versions of Scratch (Scratch [[Scratch 1.4|1.4]]/[[Scratch 2.0|2.0]]).
 
This block was named "Clear" in older versions of Scratch (Scratch [[Scratch 1.4|1.4]]/[[Scratch 2.0|2.0]]).

Revision as of 10:08, 20 February 2019

Erase All (Clear)
erase all
Category Pen Extension
Type Stack

The Erase all block is a Pen block and a Stack block. The block removes all marks made by the pen or stamps. 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/2.0).

Example Uses

This block is used in almost all projects involving the pen (especially graphic editor simulations), 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]
  • Refreshing the screen to draw the next frame in a pen animation
when GF clicked
forever
    tick::custom
end
define tick
erase all //Clear the screen
... //Code for redrawing the updated animations

See Also