Skip to content

Pen functions

Free functions you can call directly in sprite code.

changePenSize(amount: number): void

Change the pen size by an amount.

Delegates to Sprite.penSize

clearPen(): void

Clear all pen marks from the stage.

Delegates to Sprite.clearPen

getPenColor(): Color

Get the current pen color.

Delegates to Sprite.penColor

getPenDown(): boolean

Get whether the pen is currently down.

Delegates to Sprite.penDown

getPenSize(): number

Get the current pen size.

Delegates to Sprite.penSize

penDown(): void

Put the pen down so the sprite draws as it moves.

Delegates to Sprite.penDown

penUp(): void

Lift the pen up so the sprite stops drawing.

Delegates to Sprite.penDown

setPenColor(color: Color): void

Set the pen color.

Delegates to Sprite.penColor

setPenSize(size: number): void

Set the pen size.

Delegates to Sprite.penSize

stamp(): void

Stamp this sprite’s image onto the pen layer.

Delegates to Sprite.stamp