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

SpriteBaseProps

Type Parameter Default type
Clip extends string string
Property Type Default value Description
blend? "alpha" | "additive" | SpriteBlendMode | "cutout" SpriteBlendMode.Cutout How its pixels draw over what is behind it.
blobShadow? boolean | SpriteBlobShadow false An ellipse under the feet, the blob shadow every sprite game draws, since a flat quad casts no shadow worth having.
castShadow? boolean | SpriteShadowCasting | "self" | "proxy" false Casts into the sun’s shadow map, beside the blobShadow under its feet, which still draws: true casts through a proxy turned to the light, SpriteShadowCasting.Self the quad the camera sees. A sprite casts in the sun’s two live cascades, not its far map.
flash? SpriteFlash undefined A hit flash mixed over the frame, started each time its plays rises.
flipX? boolean false Mirrors the frame about its pivot, Unity’s flipX and Godot’s flip_h, so a character walking left keeps its feet where they were.
flipY? boolean false -
lean? number | BillboardLeanOptions { view: 1, shadow: 0 } How far a sprite facing the camera leans back: a share of the camera’s pitch, from 0, standing upright, to 1, square to the view, and in the shadow pass a share of the light’s elevation the proxy leans back. A number sets the view’s share alone. A sprite lying flat on the 2D plane takes none.
lit? boolean | SpriteLightingOptions false Lit by the scene’s lights with a bent normal and wrap, so a sprite stands in the sun and the shade as the ground around it does, taking the look’s fog: true for the reference’s values, or the values to change. Unlit, the art’s colours draw as painted.
onClipEnd? (clip) => void undefined As a one-shot ends without holding, or a Once loop ends.
onFrameChange? (frame) => void undefined Each time the frame it shows changes, on the page that draws it, for a footstep sound.
opacity? number 1 From 1, whole, to 0, gone. A cut out sprite fades through a 4 by 4 ordered dither, so a fading sprite still writes depth and casts its shadow; a blended one fades by its alpha.
pivot? SpritePivotOption undefined Where the entity’s origin sits on the frame: a SpritePivot, or fractions from the frame’s bottom left. Left out, the frame’s own pivot where the file has one, else SpritePivot.BottomCenter, the feet a character stands on.
receiveShadow? boolean true when lit Takes the shadows other things cast. Only a lit sprite takes light, so only a lit one takes shadow.
sheet SpriteSheet<Clip> undefined The sheet it draws, which defineSpriteSheet declared.
sortingLayer? number 0 A whole number from −4 to 3 that draws over every lower layer whatever the feet say, as a roof over the characters under it.
sortingOrder? number 0 A whole number from −64 to 63 within the layer, ahead of the feet, the range a tile layer takes too.
speed? number 1 The loop’s play rate, Godot’s speed_scale: a change carries on from the frame it stands at. A playClip one-shot keeps its own speed.
tint? ColorRepresentation white A colour multiplied into the frame, Unity’s and Phaser’s color and tint.
upright? boolean false Stands on the ground plane facing the camera, about its feet, for a tilted 2.5D look, as Godot’s Sprite3D billboard. Under a 3D camera every sprite faces the camera so.