Optional
config: TweenableConfigConfiguration object to be passed to setConfig.
Static
easingYou can define custom easing curves by attaching EasingFunctions to this static object.
Tweenable.easing['customEasing'] = (pos: number) => Math.pow(pos, 2)
Static
filtersWhether or not a tween has completed.
Whether or not a tween is running (not paused or completed).
Returns the current state of the tween.
Get and optionally set the data that gets passed as data
to StartFunction, FinishFunction and RenderFunction.
Optional
onFinally: ((onfinally?: null | (() => void)) => Promise<any>)Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
A Promise for the completion of the callback.
Optional
onfinally: null | (() => void)The callback to execute when the Promise is settled (fulfilled or rejected).
Move the state of the animation to a specific point in the tween's timeline. If the animation is not running, this will cause the tween's render handler to be called.
The millisecond of the animation to seek to. This must not be less than
0
.
Configures a tween without starting it. Aside from delay, from, and to, each configuration option will automatically default to the same option used in the preceding tween of the Tweenable instance.
Set the current tween state.
The state to set.
Stops a tween. If a tween is not running, this is a no-op. This method does not reject the tween Promise. For that, use cancel.
If false
or not provided, the tween just stops at its current state.
If true
, the tweened object's values are instantly set to the target values.
Overrides any finish
function passed via a TweenableConfig.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then
Optional
onFulfilled: FulfillmentHandlerOptional
onRejected: RejectionHandlerConfigure and start a tween. If this Tweenable's instance is already running, then it will stop playing the old tween and immediately play the new one.
Optional
config: TweenableConfigStatic
nowStatic
setSets a custom schedule function.
By default, Shifty uses
requestAnimationFrame
is used if available, otherwise setTimeout is used.
The function to be used to schedule the next frame to be rendered.
Generated using TypeDoc
The values that the initial tween should start at if a from value is not provided to tween or setConfig.