Skip to content

TextComponentOptions

Defined in: renderer/src/TextComponent.ts:17

Options for creating a TextComponent.

optional alpha?: number

Defined in: renderer/src/VisualComponent.ts:47

Alpha (opacity). Default: 1.

VisualComponentOptions.alpha


optional anchor?: object

Defined in: renderer/src/TextComponent.ts:39

Anchor point (0-1). Default: { x: 0, y: 0 } (top-left).

x: number

y: number


optional bitmap?: boolean

Defined in: renderer/src/TextComponent.ts:29

Render with a bitmap font instead of canvas-rasterised Text — the pixel-art escape hatch that stays crisp at non-integer scale. Pixi bakes or looks up the glyph atlas from style.fontFamily (the name an installBitmapFont call registered, or any font for a dynamic bake) at style.fontSize.


optional blendMode?: BLEND_MODES

Defined in: renderer/src/VisualComponent.ts:53

How this object’s pixels combine with what is drawn beneath it. Default: "normal". See BlendMode for the modes that need import "pixi.js/advanced-blend-modes".

VisualComponentOptions.blendMode


optional interactive?: VisualInteractiveOptions

Defined in: renderer/src/VisualComponent.ts:66

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

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

VisualComponentOptions.interactive


optional layer?: string

Defined in: renderer/src/VisualComponent.ts:41

Render layer name. Default: “default”.

VisualComponentOptions.layer


optional resolution?: number

Defined in: renderer/src/TextComponent.ts:37

Per-text render resolution. Mirrors the Pixi v8 Text constructor option — note resolution is NOT a TextStyle property in v8, so setting it here is the only way to get crisp canvas text without a prototype patch. Ignored when bitmap is set (bitmap resolution is fixed at font-bake time).


optional style?: TextStyleOptions

Defined in: renderer/src/TextComponent.ts:21

Text style — forwards to PixiJS TextStyleOptions (CSS-like font properties).


text: string

Defined in: renderer/src/TextComponent.ts:19

The text string to render.


optional tint?: ColorSource

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

Tint color.

VisualComponentOptions.tint


optional visible?: boolean

Defined in: renderer/src/VisualComponent.ts:43

Initial visibility. Default: true.

VisualComponentOptions.visible