Pen Up | |
pen up | |
Category | Pen |
Type | Stack |
The Pen Up block is a pen block and a stack block. If a sprite is currently using the pen because of the Pen Down block, the block will cause the sprite to stop drawing a trail. (Otherwise it has no effect.)
Example Uses
Its main use is to raise the sprite's pen in scripts.
Some common uses for the Pen Up block:
- Helping draw strings in animations
pen down repeat (10) change x by (5) end pen up
- Drawing patterns on the screen
pen down repeat (50) set x to (pick random (-240) to (240)) set y to (pick random (-180) to (180)) end pen up
- Penning bars in One Sprite One Script Projects
go to x: (0) y: (0) set pen color to [#CCCCCC] set pen size to (20) pen down change x by (150) pen up go to x: (5) y: (0) set pen color to [#5555FF] set pen size to (12) pen down change x by (140) pen up
Note: | All these examples include the Pen Down block as well; generally, they are used together. |
Workaround
There is no direct workaround for this block, as it is a primitive function of Scratch. However, the set pen color to () block can set the pen color to the backdrop color. It only works on single color backdrops.