SpriteSheet
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.
Properties
Section titled “Properties”alphaMap?
Section titled “alphaMap?”
optionalalphaMap?: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.
animations?
Section titled “animations?”
optionalanimations?: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
Section titled “frames”frames:
Map<string,SpriteFrame>
Defined in: packages/three-flatland/src/sprites/types.ts:135
Map of frame name to frame data
height
Section titled “height”height:
number
Defined in: packages/three-flatland/src/sprites/types.ts:146
Atlas height in pixels
meshIndices?
Section titled “meshIndices?”
optionalmeshIndices?:Uint16Array<ArrayBufferLike>
Defined in: packages/three-flatland/src/sprites/types.ts:169
Concatenated per-frame mesh indices (see meshVerts).
meshVerts?
Section titled “meshVerts?”
optionalmeshVerts?: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.
normalMap?
Section titled “normalMap?”
optionalnormalMap?: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
Section titled “texture”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
Methods
Section titled “Methods”getAnimation()?
Section titled “getAnimation()?”
optionalgetAnimation(name):SpriteAnimation|undefined
Defined in: packages/three-flatland/src/sprites/types.ts:175
Get an animation by name. Returns undefined if not present.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”SpriteAnimation | undefined
getAnimationNames()?
Section titled “getAnimationNames()?”
optionalgetAnimationNames():string[]
Defined in: packages/three-flatland/src/sprites/types.ts:177
Get all animation names.
Returns
Section titled “Returns”string[]
getFrame()
Section titled “getFrame()”getFrame(
name):SpriteFrame
Defined in: packages/three-flatland/src/sprites/types.ts:171
Get a frame by name
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”getFrameNames()
Section titled “getFrameNames()”getFrameNames():
string[]
Defined in: packages/three-flatland/src/sprites/types.ts:173
Get all frame names
Returns
Section titled “Returns”string[]