API reference
DebugPlaque
pixi-reels / debug / DebugPlaque
Defined in: debug/DebugPlaque.ts:133
A small readable card: rows of monospace text on a smooth rounded plate,
with optional swatches (legends) and meters (a speed, a progress). The
building block of every readout in pixi-reels/debug, and the one the
recipes on the docs site use for their own labels.
The plate is a SilkGraphics from pixi-silk, so its edges stay exact at
any scale the reel set is fitted to. Text is ordinary Pixi Text on top.
const plaque = new DebugPlaque({
title: 'reel 2',
rows: ['phase stop', { text: 'speed', meter: 0.4 }],
accent: 0xf59e0b,
anchor: { x: 0.5, y: 0 },
});
plaque.position.set(x, y);
reelSet.addChild(plaque);
plaque.update({ rows: ['phase landed'] }); // cheap enough to call per frame
Extends#
Container
Implements#
Constructors#
Constructor#
new DebugPlaque(options?: DebugPlaqueOptions): DebugPlaque;
Defined in: debug/DebugPlaque.ts:141
Parameters#
| Parameter | Type |
|---|---|
options | DebugPlaqueOptions |
Returns#
DebugPlaque
Overrides#
Container.constructor
Accessors#
isDestroyed#
Get Signature#
get isDestroyed(): boolean;
Defined in: debug/DebugPlaque.ts:150
Returns
boolean
Implementation of#
plateHeight#
Get Signature#
get plateHeight(): number;
Defined in: debug/DebugPlaque.ts:169
Height of the plate in local px.
Returns
number
plateWidth#
Get Signature#
get plateWidth(): number;
Defined in: debug/DebugPlaque.ts:164
Width of the plate in local px, from the character count.
Returns
number
text#
Get Signature#
get text(): string;
Defined in: debug/DebugPlaque.ts:189
The body as one string, rows joined by newlines. Assigning replaces the
rows, so a plaque drops in where a Text was: plaque.text = 'held 3/15'.
Returns
string
Set Signature#
set text(value: string): void;
Defined in: debug/DebugPlaque.ts:195
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
void
Methods#
destroy()#
destroy(options?: DestroyOptions): void;
Defined in: debug/DebugPlaque.ts:158
Destroy the plaque with its plate and text: it owns everything in it, so
a plain destroy() frees them too. Calling it again does nothing.
Parameters#
| Parameter | Type |
|---|---|
options? | DestroyOptions |
Returns#
void
Implementation of#
Overrides#
Container.destroy
setRows()#
setRows(rows: readonly (string | DebugPlaqueRow)[]): this;
Defined in: debug/DebugPlaque.ts:181
Replace the body rows. The same as update({ rows }).
Parameters#
| Parameter | Type |
|---|---|
rows | readonly (string | DebugPlaqueRow)[] |
Returns#
this
update()#
update(options: DebugPlaqueOptions): this;
Defined in: debug/DebugPlaque.ts:174
Merge options into the current ones and lay the plaque out again.
Parameters#
| Parameter | Type |
|---|---|
options | DebugPlaqueOptions |
Returns#
this