Sprite types
SpriteFrame
Section titled “SpriteFrame”Opaque immutable handle with a stable name and original logical width/height. Its sheet owns image data.
SpriteRectangle
Section titled “SpriteRectangle”Source pixel rectangle with x, y, width, and height.
SpriteFrameData
Section titled “SpriteFrameData”Normalized adapter record: name, optional page, packed rectangle, original size, trim offset, and rotation flag.
SpriteAnimationFrameData
Section titled “SpriteAnimationFrameData”Normalized frame name and positive duration in milliseconds.
SpriteSheetData
Section titled “SpriteSheetData”Adapter result containing relative image URLs, frame records, and optional named timed clips.
SpriteSheetFormat
Section titled “SpriteSheetFormat”Explicit parser object with parse(unknown) returning normalized sheet data.
SpriteSheet
Section titled “SpriteSheet”Shared decoded images exposed through readonly frame and animation maps, with idempotent disposal.
SpriteGrid
Section titled “SpriteGrid”Positive integer frameWidth/frameHeight and optional nonnegative integer margin/spacing, measured in pixels.
SpriteProps
Section titled “SpriteProps”Frame, sampling, normalized anchor, flipX/flipY, and ordinary drawing event props. Declared primitive inputs accept signals.
SpriteStyle
Section titled “SpriteStyle”Logical width, height, opacity, and ordinary Pibbl system style. Default size is the frame’s original untrimmed size.
API details from source
Section titled “API details from source”
SpriteProps
Section titled “SpriteProps”Drawing inputs; frame also accepts a signal through Pibbl’s declared primitive inputs. See SpriteFrame.
interface SpriteProps extends ImagePropsRelated API: SpriteProps, ImageProps.
View source — packages/core/src/features/sprites/sprite.ts:8
Properties and methods
Section titled “Properties and methods”
frame
readonly frame: SpriteFrameRelated API: SpriteFrame.
Atlas frame to draw; its sheet must remain undisposed.
View source — packages/core/src/features/sprites/sprite.ts:9
sampling (optional)
readonly sampling?: "linear" | "nearest" | undefinedImage interpolation; defaults to linear.
View source — packages/core/src/features/sprites/sprite.ts:10
anchor (optional)
readonly anchor?: Readonly<{ x: number; y: number; }> | undefinedNormalized origin within the original frame, defaulting to the top-left.
View source — packages/core/src/features/sprites/sprite.ts:11
flipX (optional)
readonly flipX?: boolean | undefinedMirror the frame horizontally.
View source — packages/core/src/features/sprites/sprite.ts:12
flipY (optional)
readonly flipY?: boolean | undefinedMirror the frame vertically.
View source — packages/core/src/features/sprites/sprite.ts:13
pointerEvents (optional)
readonly pointerEvents?: PibblPointerEvents | undefinedRelated API: PibblPointerEvents.
Whether this content participates in pointer targeting. See PibblPointerEvents.
keyboardFocusable (optional)
readonly keyboardFocusable?: boolean | undefinedWhether the target may receive keyboard focus. See PibblEventFocusOptions.
keyboardNavigationBounds (optional)
readonly keyboardNavigationBounds?: Readonly<LayoutBox> | undefinedRelated API: LayoutBox.
Logical rectangle used for directional keyboard navigation. See LayoutBox.
physics (optional)
readonly physics?: PibblPhysicsAttachment2D | undefinedRelated API: PibblPhysicsAttachment2D.
View source — packages/core/src/features/physics/lib/2d/types.ts:321
SpriteStyle
Section titled “SpriteStyle”Logical size overrides; omitted dimensions use the original untrimmed frame size. See SpriteFrame.
interface SpriteStyle extends SystemStyleRelated API: SpriteStyle, SystemStyle.
View source — packages/core/src/features/sprites/sprite.ts:16
Properties and methods
Section titled “Properties and methods”
width (optional)
readonly width?: number | undefinedView source — packages/core/src/features/sprites/sprite.ts:16
height (optional)
readonly height?: number | undefinedView source — packages/core/src/features/sprites/sprite.ts:16
opacity (optional)
readonly opacity?: number | undefinedRelated API: opacity.
View source — packages/core/src/features/sprites/sprite.ts:16
transition (optional)
transition?: PibblTransitionBinding | undefinedRelated API: PibblTransitionBinding.
Visibility-transition binding applied to this primitive and its captured descendants. See SystemStyle.
custom (optional)
custom?: unknownApplication-defined style payload passed through the runtime. See SystemStyle.
filter (optional)
filter?: PibblFilter | readonly PibblFilter[] | undefinedRelated API: PibblFilter.
Ordered pixel-only filters applied to the receiving primitive and its descendants. See PibblFilter.
SpriteSheet
Section titled “SpriteSheet”Shared decoded atlas and immutable frames/clips. Dispose after all consumers unmount. See SpriteFrame.
interface SpriteSheetRelated API: SpriteSheet.
View source — packages/core/src/features/sprites/loader.ts:4
Properties and methods
Section titled “Properties and methods”
frames
readonly frames: Readonly<Record<string | number, SpriteFrame>>Related API: SpriteFrame.
Frames indexed by atlas name or numeric grid index.
View source — packages/core/src/features/sprites/loader.ts:5
animations
readonly animations: Readonly<Record<string, PibblAnimationDefinition<SpriteFrame>>>Related API: PibblAnimationDefinition, SpriteFrame.
Named, seekable animation definitions from the atlas.
View source — packages/core/src/features/sprites/loader.ts:6
dispose
readonly dispose: () => voidRelease decoded images; unmount every consumer before calling.
View source — packages/core/src/features/sprites/loader.ts:7
SpriteGrid
Section titled “SpriteGrid”Dimensions of a regular grid, in image pixels. See SpriteFrame.
interface SpriteGridRelated API: SpriteGrid.
View source — packages/core/src/features/sprites/loader.ts:10
Properties and methods
Section titled “Properties and methods”
frameWidth
readonly frameWidth: numberView source — packages/core/src/features/sprites/loader.ts:10
frameHeight
readonly frameHeight: numberView source — packages/core/src/features/sprites/loader.ts:10
margin (optional)
readonly margin?: number | undefinedView source — packages/core/src/features/sprites/loader.ts:10
spacing (optional)
readonly spacing?: number | undefinedView source — packages/core/src/features/sprites/loader.ts:10
SpriteFrame
Section titled “SpriteFrame”Immutable atlas frame. Obtain frames from loadSpriteSheet; images belong to the sheet. See SpriteFrame.
class SpriteFrameRelated API: SpriteFrame.
View source — packages/core/src/features/sprites/model.ts:32
Properties and methods
Section titled “Properties and methods”
width
readonly width: numberOriginal logical frame width, before transparent borders were trimmed.
Returns
Section titled “Returns”Width in logical pixels.
View source — packages/core/src/features/sprites/model.ts:37
height
readonly height: numberOriginal logical frame height, before transparent borders were trimmed.
Returns
Section titled “Returns”Height in logical pixels.
View source — packages/core/src/features/sprites/model.ts:41
name
readonly name: stringStable name supplied by the atlas or numeric grid index.
Returns
Section titled “Returns”The frame name.
View source — packages/core/src/features/sprites/model.ts:45
SpriteRectangle
Section titled “SpriteRectangle”Pixel rectangle within an atlas page or original frame. See SpriteFrame.
interface SpriteRectangleRelated API: SpriteRectangle.
View source — packages/core/src/features/sprites/model.ts:5
Properties and methods
Section titled “Properties and methods”
SpriteFrameData
Section titled “SpriteFrameData”Normalized frame information returned by a format adapter. See SpriteFrame.
interface SpriteFrameDataRelated API: SpriteFrameData.
View source — packages/core/src/features/sprites/model.ts:7
Properties and methods
Section titled “Properties and methods”
name
readonly name: stringUnique frame name in this sheet.
page (optional)
readonly page?: number | undefinedZero-based atlas page index; defaults to zero.
rect
readonly rect: SpriteRectangleRelated API: SpriteRectangle.
Packed rectangle within the atlas page.
View source — packages/core/src/features/sprites/model.ts:10
sourceSize (optional)
readonly sourceSize?: Readonly<{ width: number; height: number; }> | undefinedOriginal frame dimensions before trimming.
View source — packages/core/src/features/sprites/model.ts:11
trim (optional)
readonly trim?: Readonly<{ x: number; y: number; }> | undefinedTrimmed content offset within the original frame.
View source — packages/core/src/features/sprites/model.ts:12
rotated (optional)
readonly rotated?: boolean | undefinedWhether the packed rectangle is rotated clockwise.
View source — packages/core/src/features/sprites/model.ts:13
SpriteAnimationFrameData
Section titled “SpriteAnimationFrameData”One normalized timed frame reference. Durations are milliseconds. See SpriteFrame.
interface SpriteAnimationFrameDataRelated API: SpriteAnimationFrameData.
View source — packages/core/src/features/sprites/model.ts:16
Properties and methods
Section titled “Properties and methods”
SpriteSheetData
Section titled “SpriteSheetData”Adapter result. Image paths resolve relative to the metadata URL. See SpriteFrame.
interface SpriteSheetDataRelated API: SpriteSheetData.
View source — packages/core/src/features/sprites/model.ts:18
Properties and methods
Section titled “Properties and methods”
images
readonly images: readonly string[]Atlas image URLs, relative to the metadata URL.
View source — packages/core/src/features/sprites/model.ts:19
frames
readonly frames: readonly SpriteFrameData[]Related API: SpriteFrameData.
Normalized frame records for this sheet.
View source — packages/core/src/features/sprites/model.ts:20
animations (optional)
readonly animations?: Readonly<Record<string, readonly SpriteAnimationFrameData[]>> | undefinedRelated API: SpriteAnimationFrameData.
Named sequences of timed frame references.
View source — packages/core/src/features/sprites/model.ts:21
SpriteSheetFormat
Section titled “SpriteSheetFormat”Import adapter; loaders invoke this directly without a format registry. See SpriteFrame.
interface SpriteSheetFormatRelated API: SpriteSheetFormat.
View source — packages/core/src/features/sprites/model.ts:24
Properties and methods
Section titled “Properties and methods”
parse
readonly parse: (data: unknown) => SpriteSheetDataRelated API: SpriteSheetData.
View source — packages/core/src/features/sprites/model.ts:27
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Authoring, signals, and lifecycle companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Animated sprite atlas: Generate a two-frame atlas, animate a shared sheet, and dispose it after unmounting. Plain source
- Sprite format adapters: Compare normalized Aseprite, TexturePacker, and application-owned atlas metadata. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.