Skip to content
pixi-silk
GitHub repository
Class

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#

ParameterType
optionsScrubberOptions

Returns#

Scrubber

Overrides#

Container.constructor

Properties#

PropertyModifierTypeDescriptionDefined in
statereadonlyDialStateExperimental 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#

ParameterType
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#

ParameterType
countnumber

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#

ParameterTypeDefault value
dxnumberundefined
finebooleanfalse
snapbooleanfalse

Returns#

void


tick()#

tick(dt: number): boolean;

Experimental

Advances the animation by dt seconds (only needed with ticker: null). Returns true while moving.

Parameters#

ParameterType
dtnumber

Returns#

boolean