Skip to content

Sprite2DOptions

Defined in: packages/three-flatland/src/sprites/types.ts:61

Options for creating a Sprite2D.

optional alpha?: number

Defined in: packages/three-flatland/src/sprites/types.ts:71

Opacity 0-1, default 1


optional anchor?: [number, number] | Vector2 

Defined in: packages/three-flatland/src/sprites/types.ts:67

Anchor/pivot point (0-1), default [0.5, 0.5] (center)


optional castsShadow?: boolean

Defined in: packages/three-flatland/src/sprites/types.ts:87

Whether this sprite contributes to the shadow-caster occlusion pre-pass (default: false — opt in)


optional flipX?: boolean

Defined in: packages/three-flatland/src/sprites/types.ts:73

Flip horizontally


optional flipY?: boolean

Defined in: packages/three-flatland/src/sprites/types.ts:75

Flip vertically


optional frame?: SpriteFrame

Defined in: packages/three-flatland/src/sprites/types.ts:65

Initial frame (optional, defaults to full texture)


optional lit?: boolean

Defined in: packages/three-flatland/src/sprites/types.ts:83

Whether this sprite receives lighting from Flatland’s LightEffect (default: true)


optional material?: Sprite2DMaterial

Defined in: packages/three-flatland/src/sprites/types.ts:99

Custom material (sprites with same material instance batch together)


optional pixelPerfect?: boolean

Defined in: packages/three-flatland/src/sprites/types.ts:81

Snap final projected translation to physical pixels (default: true)


optional receiveShadows?: boolean

Defined in: packages/three-flatland/src/sprites/types.ts:85

Whether this sprite receives shadows from the SDF shadow pipeline (default: true)


optional shadowRadius?: number

Defined in: packages/three-flatland/src/sprites/types.ts:97

Per-sprite occluder radius in world units. Consumed by shadow- casting LightEffects (e.g., the SDF sphere-tracer uses it as the self-silhouette escape distance). When omitted (default), the batch layer auto-resolves to max(scale.x, scale.y) each frame, which tracks scale changes and animation frame size swaps. Set explicitly to override — useful when the visible body is tighter than the quad bounds.


optional sortLayer?: SortLayerValue

Defined in: packages/three-flatland/src/sprites/types.ts:77

Sort layer — registered name or numeric order


optional texture?: Texture <unknown, TextureEventMap >

Defined in: packages/three-flatland/src/sprites/types.ts:63

Texture to use (can be set later via texture property for R3F compatibility)


optional tint?: string | number | [number, number, number] | Color 

Defined in: packages/three-flatland/src/sprites/types.ts:69

Tint color, default white. Accepts Color, hex string, hex number, or [r, g, b] array (0-1)


optional zIndex?: number

Defined in: packages/three-flatland/src/sprites/types.ts:79

Z-index within sortLayer