Runs animations in a CanvasComponent.
Inheritance Hierarchy
Animator
Remarks
For running IAnimation instances the method animate can be used. For simpler cases of custom animations there are also overloads that take an animation callback.
Type Details
- yFiles module
- view
See Also
Constructors
Initializes a new instance of the Animator class for the given CanvasComponent.
Remarks
Using this constructor, this instance will query an instance of WaitInputMode from the canvas's context to automatically set the waiting property during animations if allowUserInteraction is set to
false
. The animation is not started until animate or animate is called.Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- canvasComponent - CanvasComponent
- The canvas component.
- 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
If
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
The default is true.
Property Value
true
if invalidation should happen automatically; false
otherwise.Gets the control the animations are run on.
Gets or sets a value indicating whether the animator should pause or resume.
Remarks
Adding an animation in a suspended animator does not start the animation unless Pause is set to
true
.Methods
Starts animating the given animation for the specified duration.
Parameters
options - Object
A map of options to pass to the method.
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
options - Object
A map of options to pass to the method.
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
This implementation calls invalidate.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- canvasComponent - CanvasComponent
- The component.