m (→‎Blocks: note added)
m (→‎Blocks: note fixed)
Line 20: Line 20:
* [[Pen Down (block)|<sb>pen down</sb>]]
* [[Pen Down (block)|<sb>pen down</sb>]]
* [[Pen Up (block)|<sb>pen up</sb>]]
* [[Pen Up (block)|<sb>pen up</sb>]]
* [[Set Pen Color to () (color input block)|<sb>set pen color to [#F3A533]</sb>]] // you can change the color
* [[Set Pen Color to () (color input block)|<sb>set pen color to [#F3A533] // you can change the color</sb>]]
* [[Set Pen () to () (block)|<sb>set pen [color v] to (50)</sb>]]
* [[Set Pen () to () (block)|<sb>set pen [color v] to (50)</sb>]]
* [[Change Pen () by () (block)|<sb>change pen [color v] by (10)</sb>]]
* [[Change Pen () by () (block)|<sb>change pen [color v] by (10)</sb>]]

Revision as of 01:27, 18 August 2019

SandCastleIcon.png This article has links to websites or programs not trusted by Scratch or hosted by Wikipedia. Remember to stay safe while using the internet, as we cannot guarantee the safety of other websites.
The image for the Pen Extension in the Extensions Menu.

The Pen Extension is a Scratch 3.0 extension allowing sprites to control their pens, as well as stamp themselves onto the stage and remove all pen marks. Before Scratch 3.0, these blocks were in a category called Pen Blocks.[1] To use them, they must be enabled in the "Extensions" section of the editor. Older blocks are kept but hidden.[2] There are 9 blocks. Pen blocks are useful when creating a one sprite one script project, allowing one to take various actions:

  • Stamp the sprite
  • Put the pen down
  • Release the pen

One example of a one sprite one script project is a simple drawing program.

Pen Blocks can also used to make Games and Simulations, as well as other things.


Note Note: Click on a block to learn more about it!

Scratch 3.0 has the following 9 Pen Stack blocks:

Suggested Pen Blocks

<pen down?:: pen>
(pen color:: pen)
(pen shade:: pen)
(pen size:: pen)
switch to canvas: [canvas1 v] ::pen //allows switching to a particular canvas for editing

clear [canvas1 v] ::pen //clears selected canvas (also includes options all and current)

show canvas [canvas1 v] ::pen //would display selected canvas (also includes options all and current)

hide canvas [canvas1 v] ::pen //would stop displaying selected canvas (also includes options all and current)

bring [canvas1 v] to front ::pen //would shift the selected canvas to the front(also includes options current)

move [canvas1 v] to layer (1 v) ::pen //would reorder the canvases (also includes options current)

These are wanted by many Scratchers, as they would make programming much easier.[3] The first would return the Boolean value of true if the pen is down. The second would return the pen color value; the third, the pen shade value; the last, the pen size value. Some Scratch Modifications have at least one of these.[citation needed] Workarounds are possible by maintaining variables to that keep up with these values and updating them whenever the pen state/color/size/shade are changed, possibly by leaving a separate script running that alters the pen when the variables are changed, and only modify the variables in other scripts instead of changing the pen attributes directly. Pen canvases would be independent from each other allowing them to be modified without affecting the others.[4]


  1. ericrosenbaum. (3/10/2017). "We are moving the pen blocks to an extension." https://github.com/LLK/scratch-gui/issues/725
  2. ericrosenbaum. (31/10/2017). "Part of this support involves the ability to define 2.0-compatible blocks that do not show up in the palette, but which can load in a project that uses them." https://github.com/LLK/scratch-vm/issues/735
  3. ar-topic:118
  4. topic:234935

See also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.