Skip to content

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

Spritesheet data structure.

Animation-related fields are optional: a sheet built by SpriteSheetLoader always populates them, but synthetic sheets (test fixtures, hand-built mocks, runtime-generated sheets without animation metadata) can omit them. Consumers should defensively check sheet.animations?.size rather than assume presence.

optional alphaMap?: AlphaMap

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

CPU alpha hitmask, co-registered with texture. Populated when the loader is given alpha: true. Consumed by hitTestMode: 'alpha' (assign to sprite.alphaMap). Spec §8.4.


optional animations?: Map<string, SpriteAnimation>

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

Named animations from the source JSON. Populated by SpriteSheetLoader from meta.animations (our shape) or normalized from meta.frameTags + per-frame duration (Aseprite shape). Optional to keep synthetic sheets simple.


frames: Map<string, SpriteFrame>

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

Map of frame name to frame data


height: number

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

Atlas height in pixels


optional meshIndices?: Uint16Array<ArrayBufferLike>

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

Concatenated per-frame mesh indices (see meshVerts).


optional meshVerts?: Float32Array<ArrayBufferLike>

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

Concatenated per-frame mesh vertex data ([x,y,u,v] interleaved) across all frames that carry a mesh. Frame offsets live on frame.mesh.vertexOffset / indexOffset. Undefined when no frame has mesh data.


optional normalMap?: Texture <unknown, TextureEventMap >

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

Tangent-space normal map, 1:1 co-registered with texture.

Populated when the loader is given normals: true (or a descriptor). Binds to NormalMapProvider.normalMap on a lit sprite.


texture: Texture 

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

The texture atlas


width: number

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

Atlas width in pixels

optional getAnimation(name): SpriteAnimation | undefined

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

Get an animation by name. Returns undefined if not present.

string

SpriteAnimation | undefined


optional getAnimationNames(): string[]

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

Get all animation names.

string[]


getFrame(name): SpriteFrame

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

Get a frame by name

string

SpriteFrame


getFrameNames(): string[]

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

Get all frame names

string[]