SpriteComponentOptions
Defined in: renderer/src/SpriteComponent.ts:20
Options for creating a SpriteComponent.
Properties
Section titled “Properties”alpha?
Section titled “alpha?”
optionalalpha?:number
Defined in: renderer/src/SpriteComponent.ts:32
Alpha (opacity). Default: 1.
anchor?
Section titled “anchor?”
optionalanchor?:object
Defined in: renderer/src/SpriteComponent.ts:24
Anchor point (0-1).
x:
number
y:
number
interactive?
Section titled “interactive?”
optionalinteractive?: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.
consumeOnInteraction?
Section titled “consumeOnInteraction?”
optionalconsumeOnInteraction?:boolean
When true, claim pointer events landing on this sprite. Default false.
eventMode?
Section titled “eventMode?”
optionaleventMode?:"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.
layer?
Section titled “layer?”
optionallayer?:string
Defined in: renderer/src/SpriteComponent.ts:26
Render layer name. Default: “default”.
texture
Section titled “texture”texture:
TextureInput
Defined in: renderer/src/SpriteComponent.ts:22
Texture or texture key string.
optionaltint?:number
Defined in: renderer/src/SpriteComponent.ts:30
Tint color.
visible?
Section titled “visible?”
optionalvisible?:boolean
Defined in: renderer/src/SpriteComponent.ts:28
Initial visibility. Default: true.