pixi-wheels

RingSkin

pixi-wheels


pixi-wheels / index / RingSkin

Interface: RingSkin

Defined in: skins/RingSkin.ts:32

How a ring looks. The ring owns the motion (rotation, sections, pointers); a skin owns the pixels. Swap GraphicsRingSkin for TextureRingSkin or a Spine skin and nothing about the spin changes.

attach() is called once at build; layout() whenever the geometry changes (a dynamic-section transition calls it every frame, so keep it proportional to the section count).

Extends#

Properties#

PropertyModifierTypeInherited fromDefined in
isDestroyedreadonlybooleanDisposable.isDestroyedutils/Disposable.ts:9

Methods#

attach()#

attach(ctx: RingSkinContext): void;

Defined in: skins/RingSkin.ts:33

Parameters#

ParameterType
ctxRingSkinContext

Returns#

void


destroy()#

destroy(): void;

Defined in: utils/Disposable.ts:8

Returns#

void

Inherited from#

Disposable.destroy


highlight()?#

optional highlight(sectionId: string | null): void;

Defined in: skins/RingSkin.ts:38

Turn a highlight on one section (or off with null).

Parameters#

ParameterType
sectionIdstring | null

Returns#

void


layout()#

layout(): void;

Defined in: skins/RingSkin.ts:34

Returns#

void


onLanded()?#

optional onLanded(section: ResolvedSection): void;

Defined in: skins/RingSkin.ts:42

Parameters#

ParameterType
sectionResolvedSection

Returns#

void


onSpinStart()?#

optional onSpinStart(): void;

Defined in: skins/RingSkin.ts:40

Hooks the ring calls from its own event stream, for skins with spin / win states.

Returns#

void


onSpinStop()?#

optional onSpinStop(): void;

Defined in: skins/RingSkin.ts:41

Returns#

void


syncRotation()?#

optional syncRotation(rotationDeg: number): void;

Defined in: skins/RingSkin.ts:36

Every frame, the disc rotation in degrees. For upright labels and bone-driven skins.

Parameters#

ParameterType
rotationDegnumber

Returns#

void