Optional
dataOptional
delayHow many milliseconds to wait before starting the tween.
Optional
durationHow many milliseconds to animate for.
Optional
easingThis value can be one of several different types:
string
: Name of the standardEasingFunctions to apply to all properties
of the tween.Record<string, string | EasingFunction>
: Keys are tween property
names. Values are the standardEasingFunctions string IDs to be applied to
each tween property, or a EasingFunction. Any tween properties not
explicitly included in the Record
default to 'linear'
.Array.<number>
: The array must contain four number
values that
correspond to the [x1, y1, x2, y2]
values of a Bezier
curve.You can learn more about this in the Easing Curves in Depth tutorial.
Optional
finishOptional
fromStarting position. If omitted, state is used.
Optional
promisePromise implementation constructor for when you want to use Promise library or polyfill Promises in environments where it is not already defined.
Optional
renderExecutes on every tick. Shifty assumes a retained
mode rendering environment,
which in practice means that render
only gets called when the tween
state changes. Importantly, this means that render
is not called when
a tween is not animating (for instance, when it is paused or waiting to
start via the delay
option). This works naturally with DOM environments,
but you may need to account for this design in more custom environments
such as <canvas>
.
Optional
startExecutes when the tween begins.
Optional
toEnding position. The keys of this Object should match those of to
.
Generated using TypeDoc
Data that is passed to StartFunction, RenderFunction, and PromisedData.