API

Interface SpritePickInfo

Result of a successful pickSprite2D hit.

interface SpritePickInfo {
    layer: Sprite2DLayer;
    spriteIndex: number;
    u: number;
    v: number;
}
Index

The layer that owns the hit sprite.

spriteIndex: number

Index-API slot of the hit sprite within layer (the value returned by addSprite2DIndex).

u: number

Sprite-local hit coordinate in [0, 1]: (0, 0) is the quad's first corner and (1, 1) the opposite one, corrected for the layer's pivot and the sprite's rotation. It equals the within-quad UV fraction at the hit point, so a caller can map it to a frame-relative texel.

v: number