Skip to content
pixi-silk
GitHub repository
Class

MiniTimeline

import { MiniTimeline } from 'pixi-silk/ui/timeline';

Experimental

A compact animation timeline: a ruler you scrub, key dots you select and drag, a loop range and a playhead. Scrubbing past either end stretches like a rubber band. Keys snap to frames. Shift adds to the selection, and a drag on empty track draws a selection box. The wheel zooms around the pointer (sideways or with Shift it pans). A double tap on the ruler zooms in or back out. The top-left corner is at (0, 0). Keys are points in time: there are no curves or values.

Experimental: the API may change in a minor release.

Extends#

  • Container

Constructors#

Constructor#

new MiniTimeline(options?: MiniTimelineOptions): MiniTimeline;

Experimental

Parameters#

ParameterType
optionsMiniTimelineOptions

Returns#

MiniTimeline

Overrides#

Container.constructor

Properties#

PropertyModifierTypeDescriptionDefined in
statereadonlyTimelineStateExperimental Playhead, playback, selection, loop range and view. Write to them to drive the timeline.ui/timeline.ts:139

Accessors#

keys#

Get Signature#

get keys(): TimelineKey[];

Experimental

A copy of the keys. Changing it does not change the timeline: use MiniTimeline.setKeys.

Returns

TimelineKey[]

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

dragTo()#

dragTo(x: number, _y?: number): void;

Experimental

Drags to a local point, as the pointer does.

Parameters#

ParameterTypeDefault value
xnumberundefined
_ynumber0

Returns#

void


panBy()#

panBy(frames: number): void;

Experimental

Shifts the view by frames, kept inside the track.

Parameters#

ParameterType
framesnumber

Returns#

void


pressAt()#

pressAt(
   x: number, 
   y: number, 
   shift?: boolean
): void;

Experimental

Presses at a local point, as the pointer does. shift adds to the selection.

Parameters#

ParameterTypeDefault value
xnumberundefined
ynumberundefined
shiftbooleanfalse

Returns#

void


release()#

release(): void;

Experimental

Releases the press, as the pointer does.

Returns#

void


setKeys()#

setKeys(keys: TimelineKey[]): void;

Experimental

Replaces the keys with copies. Selected ids that no longer exist leave the selection.

Parameters#

ParameterType
keysTimelineKey[]

Returns#

void


showAll()#

showAll(): void;

Experimental

Shows the whole track.

Returns#

void


tick()#

tick(dt: number): boolean;

Experimental

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

Parameters#

ParameterType
dtnumber

Returns#

boolean


timeAt()#

timeAt(x: number): number;

Experimental

Frame under a local x (in the target view, not the animated one).

Parameters#

ParameterType
xnumber

Returns#

number


toggle()#

toggle(): void;

Experimental

Starts or stops playback.

Returns#

void


xAt()#

xAt(time: number): number;

Experimental

Local x of a frame in the target view.

Parameters#

ParameterType
timenumber

Returns#

number


zoomBy()#

zoomBy(factor: number, aroundTime?: number): void;

Experimental

Zooms the view by factor (above 1 zooms in) around aroundTime (default the playhead). The span stays between minSpan and the whole track.

Parameters#

ParameterType
factornumber
aroundTimenumber

Returns#

void