Interface SpriteAtlasFrameSource
height: number;
name?: string;
pivot?: readonly [number, number];
pixels: Uint8Array;
srcStrideBytes?: number;
srcX?: number;
srcY?: number;
width: number;
}
Properties
Readonlyheight
Height of the frame to pack (texels written to the atlas).
Optional Readonlyname
Recorded on the emitted SpriteFrame.name.
Optional Readonlypivot
Pivot in [0,1] of the frame. Default [0.5, 0.5].
Readonlypixels
RGBA8 bytes, row-major, top-to-bottom, straight alpha. When srcX / srcY /
srcStrideBytes are all defaulted, this must be exactly width * height * 4 bytes;
when sub-rect fields are supplied, it must be large enough to cover the rect
(see those fields' docs).
Optional Readonlysrc Stride Bytes
Bytes between consecutive rows of pixels. Default width * 4 (tightly packed).
Must satisfy (srcX + width) * 4 <= srcStrideBytes — i.e. each row's sub-rect window
must fit within one stride, so reads do not spill into the next row.
Optional Readonlysrc X
Top-left x of the sub-rect to pack, in texels into pixels. Default 0.
Optional Readonlysrc Y
Top-left y of the sub-rect to pack, in texels into pixels. Default 0.
Readonlywidth
Width of the frame to pack (texels written to the atlas).
One source frame for
createSpriteAtlasFromFrames/appendSpriteAtlasFrames. The packed region iswidth × heighttexels. By default the source is read as a tightly-packed RGBA8 buffer of exactly that size starting at byte 0; the optionalsrcX/srcY/srcStrideBytesfields let the source describe a sub-rectangle of a larger buffer without forcing the caller to copy out the sub-rect first.