Interface Sprite2DProps
clip?: unknown;
color?: [number, number, number, number];
flipX?: boolean;
flipY?: boolean;
frame?: number;
positionPx: [number, number];
rotation?: number;
sizePx?: [number, number];
visible?: boolean;
z?: number;
}
Properties
Optionalclip
Reserved for clip animation. Accepted but unused today.
Optionalcolor
Optionalflip X
Absolute horizontal orientation, not a toggle: true mirrors the sprite, false
restores it, and omitting the flag preserves whatever orientation the sprite already
has (including across a frame change). Re-sending the same value every frame is a
no-op.
Optionalflip Y
Absolute vertical orientation. See Sprite2DProps.flipX.
Optionalframe
position Px
Optionalrotation
Optionalsize Px
Optionalvisible
Optionalz
Per-sprite NDC depth (0 = near, 1 = far). Only stored and consumed by depth-hosted
layers (depth: "test" | "test-write"); pure-2D HUD layers use a 13-float layout and
do not allocate a Z slot. When omitted on add for a depth-hosted layer, defaults to the
owning layer's layerZ at the moment of insertion. When omitted on update, the
sprite's existing Z is preserved. Mutate freely — the next binding update will re-upload
only the dirty range.
Per-sprite init record passed to
addSprite2DIndex/updateSprite2DIndex.