Skip to content

Layers functions

Free functions you can call directly in sprite code.

goBackwardLayers(layers: number): void

Move this sprite backward a number of layers (Scratch-style).

Delegates to Sprite.moveBehind

goForwardLayers(layers: number): void

Move this sprite forward a number of layers (Scratch-style).

Delegates to Sprite.moveAhead

goToBack(): void

Move this sprite to the back layer (Scratch-style alias).

Delegates to Sprite.moveBehind

goToFront(): void

Move this sprite to the front layer (Scratch-style alias).

Delegates to Sprite.moveAhead

moveAhead(value?: number): void

Move this sprite ahead by a number of layers.

Delegates to Sprite.moveAhead

moveBackward(layers?: number): void

Move this sprite backward a number of layers.

Delegates to Sprite.moveBehind

moveBehind(value?: number): void

Move this sprite behind by a number of layers.

Delegates to Sprite.moveBehind

moveForward(layers?: number): void

Move this sprite forward a number of layers.

Delegates to Sprite.moveAhead

moveToBack(): void

Move this sprite to the back layer.

Delegates to Sprite.moveBehind

moveToFront(): void

Move this sprite to the front layer.

Delegates to Sprite.moveAhead