Scrubber
import { Scrubber } from 'pixi-silk/ui/dial';
Experimental
A number field you drag, like the ones in 3D and compositing tools. Drag sideways to scrub the
value. Shift scrubs finely, Ctrl or Cmd snaps to the step. A tap on the left or right end steps
down or up. With min and max the field fills like a slider. The top-left corner is at (0, 0).
Experimental: the API may change in a minor release.
Extends#
Container
Constructors#
Constructor#
new Scrubber(options?: ScrubberOptions): Scrubber;
Experimental
Parameters#
| Parameter | Type |
|---|---|
options | ScrubberOptions |
Returns#
Scrubber
Overrides#
Container.constructor
Properties#
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
state | readonly | DialState | Experimental Value and drag flag. Writing value redraws the field without calling onChange. | ui/dial.ts:513 |
Methods#
destroy()#
destroy(options?: DestroyOptions): void;
Experimental
Stops the animation. Destroys children unless options says otherwise.
Parameters#
| Parameter | Type |
|---|---|
options? | DestroyOptions |
Returns#
void
Overrides#
Container.destroy
nudge()#
nudge(count: number): void;
Experimental
Steps by count steps (negative steps down), clamps, flashes the field and calls onCommit.
Parameters#
| Parameter | Type |
|---|---|
count | number |
Returns#
void
scrubTo()#
scrubTo(
dx: number,
fine?: boolean,
snap?: boolean
): void;
Experimental
Scrubs to a drag offset of dx pixels from the press. fine and snap stand for Shift and
Ctrl / Cmd. Pointer moves call this.
Parameters#
| Parameter | Type | Default value |
|---|---|---|
dx | number | undefined |
fine | boolean | false |
snap | boolean | false |
Returns#
void
tick()#
tick(dt: number): boolean;
Experimental
Advances the animation by dt seconds (only needed with ticker: null). Returns true while moving.
Parameters#
| Parameter | Type |
|---|---|
dt | number |
Returns#
boolean