Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

PlayInput

A player’s input, as spawnite play press, hold, release and move give it: each answers what is held after it.

hold(controls, options?): Promise<HeldInput>

Holds each control down until release.

Parameter Type
controls Controls
options? { at?: PagePoint; }
options.at? PagePoint

Promise<HeldInput>


move(control, options): Promise<HeldInput>

Moves the mouse, the wheel, a stick, a trigger or a finger: by an amount, or to a place.

Parameter Type
control string
options { by?: number[]; to?: number[]; }
options.by? number[]
options.to? number[]

Promise<HeldInput>


press(controls, options?): Promise<HeldInput>

Presses each control and lets it go, in order; a chord such as Shift+KeyW presses together. hold keeps each down that many seconds of the game’s time, which the session steps.

Parameter Type
controls Controls
options? { at?: PagePoint; hold?: number; }
options.at? PagePoint
options.hold? number

Promise<HeldInput>


release(controls?): Promise<HeldInput>

Lets each control go; with none, everything held.

Parameter Type
controls? Controls

Promise<HeldInput>