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

PlayTime

The session’s time.

frames(count?): Promise<void>

Waits for the page to draw count frames, 1 by default: a held world draws them without a step.

Parameter Type
count? number

Promise<void>


sample<Value>(read, request): Promise<FrameSample<Value>[]>

Reads read on each frame the page draws while the session runs steps or seconds, a room at real time, and answers each frame’s value.

Type Parameter
Value
Parameter Type
read (scope) => Value
request Pick<PlayStepRequest, "steps" | "seconds">

Promise<FrameSample<Value>[]>


step(request): Promise<PlayStepReading>

Steps the session, as spawnite play step does, and says where it stopped.

Parameter Type
request PlayStepRequest

Promise<PlayStepReading>