SectionLabels
pixi-wheels / index / SectionLabels
Class: SectionLabels
Defined in: skins/labels.ts:25
One label per section, placed at the section’s middle angle. Shared by the graphics, texture and Spine skins so labels behave the same everywhere: radial, tangential or upright, fitted to the room the section has, and re-centred every time a dynamic section moves.
A label is the section’s label string as a Text, or its content: any
container (an icon, a bitmap text, a Spine instance, a group). Content is
built once per section, fitted with labelFit, and rebuilt when the
section is given a different content.
Constructors#
Constructor#
new SectionLabels(_parent: Container): SectionLabels;
Defined in: skins/labels.ts:30
Parameters#
| Parameter | Type |
|---|---|
_parent | Container |
Returns#
SectionLabels
Methods#
destroy()#
destroy(): void;
Defined in: skins/labels.ts:133
Returns#
void
get()#
get(id: string): Container<ContainerChild> | undefined;
Defined in: skins/labels.ts:115
The label view of a section: its Text, or the content container.
Parameters#
| Parameter | Type |
|---|---|
id | string |
Returns#
Container<ContainerChild> | undefined
layout()#
layout(
sections: readonly ResolvedSection[],
outerRadius: number,
innerRadius: number
): void;
Defined in: skins/labels.ts:32
Parameters#
| Parameter | Type |
|---|---|
sections | readonly ResolvedSection[] |
outerRadius | number |
innerRadius | number |
Returns#
void
syncRotation()#
syncRotation(discRotationDeg: number): void;
Defined in: skins/labels.ts:104
Keep 'upright' labels upright as the disc turns.
Parameters#
| Parameter | Type |
|---|---|
discRotationDeg | number |
Returns#
void
text()#
text(id: string): Text | undefined;
Defined in: skins/labels.ts:120
The Text of a plain text label; undefined for rich content.
Parameters#
| Parameter | Type |
|---|---|
id | string |
Returns#
Text | undefined