Skip to content

SpriteComponentOptions

Defined in: renderer/src/SpriteComponent.ts:20

Options for creating a SpriteComponent.

optional alpha?: number

Defined in: renderer/src/SpriteComponent.ts:32

Alpha (opacity). Default: 1.


optional anchor?: object

Defined in: renderer/src/SpriteComponent.ts:24

Anchor point (0-1).

x: number

y: number


optional interactive?: object

Defined in: renderer/src/SpriteComponent.ts:45

Make the sprite interactive. When set, Pixi eventMode is configured so the sprite participates in pointer hit-testing — required for any sprite.on("pointerdown", ...) listener to fire.

consumeOnInteraction: true additionally marks the sprite as a UI-input surface (via @yagejs/core’s consume registry), so a pointerdown over the sprite is auto-claimed by @yagejs/input — preventing the same press from also firing gameplay action-map edges like MouseLeft. Default false: by default an interactive sprite still propagates the action, matching the “I want both Pixi events AND the action map” use case.

optional consumeOnInteraction?: boolean

When true, claim pointer events landing on this sprite. Default false.

optional eventMode?: "static" | "dynamic"

Pixi event mode. Defaults to "static" when the option object is set (interactive sprite, no children-recurse cost). Pass "dynamic" for Pixi behavior where event-mode propagates to children automatically.


optional layer?: string

Defined in: renderer/src/SpriteComponent.ts:26

Render layer name. Default: “default”.


texture: TextureInput

Defined in: renderer/src/SpriteComponent.ts:22

Texture or texture key string.


optional tint?: number

Defined in: renderer/src/SpriteComponent.ts:30

Tint color.


optional visible?: boolean

Defined in: renderer/src/SpriteComponent.ts:28

Initial visibility. Default: true.