A segmented bonus wheel that spins clockwise to the segment the maths already chose and stops with it under a pointer at 12 o'clock. Browser only, inside the Pixi stage; it decides nothing and never reaches the RGS.
Wheel is the visual half of a wheel bonus. Wheel Spin picks the segment; this node only animates to it. Wire Wheel Spin's segmentIndex (or any 0-based index) into Target Index, then fire Spin To: the disc turns clockwise for at least Extra Turns whole turns over Duration (ms) with the chosen Easing, then snaps so the centre of the target segment sits exactly under the pointer.
The angle convention is shared with Wheel Spin. With N segments, segment i spans [i, i + 1) * 360 / N degrees clockwise from 12 o'clock, its centre is at (i + 0.5) * 360 / N, and the pointer is fixed at 12 o'clock. A Target Index outside 0..N-1 is wrapped and warned about in the console: the maths and the wheel disagree on N, so fix the segment list, not the index.
Segments takes an array of strings, of { label, colour } objects, a JSON string of either, or a number N for N segments labelled 1..N. Segment 0 starts at 12 o'clock and the rest run clockwise. A segment without its own colour takes the next entry of Colours, cycled, or a built-in eight-colour palette when Colours is empty. Labels run radially from the hub and shrink to fit their segment. An empty wheel is still drawn as a grey disc, so a missing wire is obvious.
The spin runs on the Pixi ticker, drawn with plain graphics and text, and survives a hidden tab: the frame delta is clamped, so a background spin simply takes longer. Spin To while already spinning restarts from the current angle toward the new target, and the abandoned spin fires no On Spin Complete. With no segments, Spin To warns and does nothing. Without a ticker (not yet mounted under a Pixi stage) the wheel warns once and jumps straight to its target, so Current Index and On Spin Complete still arrive. Changing Segments, Colours, Radius or the label and pointer inputs rebuilds the disc but keeps its rotation.
Segments
| Data | Description |
|---|
| Segments (array) | Strings, { label, colour } objects, a JSON string of either, or a number of segments. Segment 0 starts at 12 o'clock, running clockwise. |
| Colours (array) | Colours cycled over the segments that carry none of their own, as hex strings or numbers; invalid entries are skipped. Empty uses the built-in palette. |
| Radius (number) | Radius of the disc in px; labels sit at 60% of it. Default 200, minimum 1. |
Labels
| Data | Description |
|---|
| Label Colour (color) | Colour of the segment labels, as a hex string. Default #FFFFFF. |
| Label Font Size (number) | Font size of the labels in px, bold sans-serif; long labels shrink to fit. Default 20, minimum 1. |
Pointer
| Data | Description |
|---|
| Show Pointer (boolean) | Draws the triangular pointer at 12 o'clock. Default true. |
| Pointer Colour (color) | Fill colour of the pointer, as a hex string. Default #FF3B30. |
Spin
| Data | Description |
|---|
| Target Index (number) | The 0-based segment to stop on, from the maths (Wheel Spin's segmentIndex). Rounded; out-of-range values wrap with a console warning. Default 0. |
| Extra Turns (number) | Whole clockwise turns before landing; the travel is at least this many turns and less than one more. Default 3, minimum 0. |
| Duration (ms) (number) | Length of the spin in ms. Default 3000, minimum 1. |
| Easing (enum) | Progress curve of the spin; an unknown name uses the default. Default easeOutCubic. Options: linear, easeOutCubic, easeOutQuint. |
| Signal | Description |
|---|
| Spin To | Starts a clockwise spin to Target Index; while spinning, restarts toward the new target. Needs at least one segment. |
| Data | Description |
|---|
| X (number) | X of the wheel's centre inside its Pixi parent, in px. Default 0. |
| Y (number) | Y of the wheel's centre inside its Pixi parent, in px. Default 0. |
Appearance
| Data | Description |
|---|
| Z-Index (number) | Sort order among siblings when the parent has Sort Children by Z on. Default 0. |
| Visible (boolean) | Shows or hides the wheel. Default true. |
| Alpha (number) | Opacity of the whole wheel, 0..1. Default 1. |
Outputs
General
| Data | Description |
|---|
| Container (object) | The root PIXI.Container, positioned at X / Y, for other Pixi nodes. |
Spin
| Data | Description |
|---|
| Current Index (number) | The segment under the pointer once stopped; 0 at rest before any spin. |
| Is Spinning (boolean) | True from Spin To until the wheel has landed. |
| Rotation (deg) (number) | The disc's rotation, 0..360 clockwise, updated every frame — drive a tick sound or a light chase from it. |
Events
| Signal | Description |
|---|
| On Spin Start | Fires on every accepted Spin To, including one that restarts a running spin. |
| On Spin Complete | Fires when the wheel has landed; an abandoned spin, or one cut short by unmounting, never fires it. |
Usage
- Place Wheel inside a Pixi stage or container and set X / Y to where its centre should be.
- Give Segments one entry per segment of the maths, in the same order, so both agree on
N.
- Wire Wheel Spin's
segmentIndex into Target Index and its Done into Spin To.
- Drive the payout and the next step from On Spin Complete; use Rotation (deg) for a tick sound or a light chase while it turns.
Fire the payout and next-step logic from On Spin Complete, never from Wheel Spin's own Done — otherwise the win shows before the wheel has stopped.