Skip to content

Variables functions

Free functions you can call directly in sprite code.

createVar(name: string, initialValue: any, options?: { label?: string; style?: "normal" | "large" | "slider"; visible?: boolean; setValue?: (value: any) => void; step?: number; min?: number; max?: number; x?: number; y?: number; width?: number; height?: number }): void

Create a variable, optionally with a watcher.

Delegates to Sprite.createVar

hideVar(name: string): void

Hide a variable’s watcher.

Delegates to Sprite.hideVar

moveVar(name: string, x: number, y: number): void

Move a variable’s watcher to a position on the stage.

Delegates to Sprite.moveVar

setVar(name: string, value: any): void

Set the value of a variable.

Delegates to Sprite.setVar

showVar(name: string): void

Show a variable’s watcher on the stage.

Delegates to Sprite.showVar