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

readSpriteFrame

readSpriteFrame<Clip>(step, entity, sheet): Readonly<SpriteFrameResult<Clip>> | null

The frame of sheet a room shows entity at step.tick: the frame of the one-shot playClip plays on it, or null where none of sheet’s clips plays, before its first tick, or once it ends. What loops under the one-shot is the view’s, and a room has none. Reads the sheet’s data alone, so a room, which loads no image, reads it. Written in place: read it at once.

Type Parameter
Clip extends string
Parameter Type
step SystemStep
entity Entity
sheet SpriteSheet<Clip>

Readonly<SpriteFrameResult<Clip>> | null