Runs animations in a CanvasComponent.
Remarks
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.Animator
See Also
Constructors
Initializes a new instance of the Animator class for the given CanvasComponent.
Remarks
false
. The animation is not started until animate or animate is called.Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The canvas control.
- allowUserInteraction - boolean
Whether user interaction should be allowed during the animation. This option sets the allowUserInteraction property on the created object.
- autoInvalidation - boolean
A value indicating whether to automatically invalidate the control this instance has been created for. This option sets the autoInvalidation property on the created object.
Properties
Gets or sets whether user interaction should be allowed during the animation.
Remarks
false
, the WaitInputMode is queried from the CanvasComponent and waiting is enabled during the animation. The default is false
.Gets or sets a value indicating whether to automatically invalidate the control this instance has been created for.
Remarks
Gets the control the animations are run on.
Gets or sets a value indicating whether the animator should pause or resume.
Remarks
Methods
Starts animating the given animation for the specified duration.
Parameters
A map of options to pass to the method.
- callback - function(number):void
- The callback to use for the animation.
Signature Details
function(time: number)
A callback method for animations.This can be used in animate as a simpler alternative to implementing IAnimation. The interface offers more flexibility for reusable animations as well as lifecycle management (initialize, cleanUp) and a preferred duration. But if the intent is to just run a simple one-off animation, animation callback is a useful alternative.Parameters
- time - number
- The current (relative) animation time which is a double between 0.0 for the start of the animation and 1.0 for the end of the animation.
- duration - TimeSpan
- The duration that the animation should last.
Returns
Animates the given animation.
Parameters
A map of options to pass to the method.
- animation - IAnimation
- The animation to perform.
Returns
Invalidates the control if autoInvalidation is set to true
.
Remarks
Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The control.