Sprite2DOptions
Defined in: packages/three-flatland/src/sprites/types.ts:61
Options for creating a Sprite2D.
Properties
Section titled “Properties”alpha?
Section titled “alpha?”
optionalalpha?:number
Defined in: packages/three-flatland/src/sprites/types.ts:71
Opacity 0-1, default 1
anchor?
Section titled “anchor?”
optionalanchor?: [number,number] |Vector2
Defined in: packages/three-flatland/src/sprites/types.ts:67
Anchor/pivot point (0-1), default [0.5, 0.5] (center)
castsShadow?
Section titled “castsShadow?”
optionalcastsShadow?: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)
flipX?
Section titled “flipX?”
optionalflipX?:boolean
Defined in: packages/three-flatland/src/sprites/types.ts:73
Flip horizontally
flipY?
Section titled “flipY?”
optionalflipY?:boolean
Defined in: packages/three-flatland/src/sprites/types.ts:75
Flip vertically
frame?
Section titled “frame?”
optionalframe?:SpriteFrame
Defined in: packages/three-flatland/src/sprites/types.ts:65
Initial frame (optional, defaults to full texture)
optionallit?:boolean
Defined in: packages/three-flatland/src/sprites/types.ts:83
Whether this sprite receives lighting from Flatland’s LightEffect (default: true)
material?
Section titled “material?”
optionalmaterial?:Sprite2DMaterial
Defined in: packages/three-flatland/src/sprites/types.ts:99
Custom material (sprites with same material instance batch together)
pixelPerfect?
Section titled “pixelPerfect?”
optionalpixelPerfect?:boolean
Defined in: packages/three-flatland/src/sprites/types.ts:81
Snap final projected translation to physical pixels (default: true)
receiveShadows?
Section titled “receiveShadows?”
optionalreceiveShadows?:boolean
Defined in: packages/three-flatland/src/sprites/types.ts:85
Whether this sprite receives shadows from the SDF shadow pipeline (default: true)
shadowRadius?
Section titled “shadowRadius?”
optionalshadowRadius?: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.
sortLayer?
Section titled “sortLayer?”
optionalsortLayer?:SortLayerValue
Defined in: packages/three-flatland/src/sprites/types.ts:77
Sort layer — registered name or numeric order
texture?
Section titled “texture?”
optionaltexture?: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)
optionaltint?: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)
zIndex?
Section titled “zIndex?”
optionalzIndex?:number
Defined in: packages/three-flatland/src/sprites/types.ts:79
Z-index within sortLayer