Click or drag to resize
AB4D logo

AnimationController Methods

The AnimationController type exposes the following members.

Methods
 NameDescription
Public methodDump Writes details about this AnimationNodeBase to the Visual Studio Output window. This method calls the GetDumpString method to get details about each keyframe.
Public methodGetAnimationPauseTimeInSeconds Returns total elapsed time in seconds in which the animation was paused (time during PauseAnimation and ResumeAnimation method calls).
Public methodGetAnimationTimeInSeconds Returns time in seconds that elapsed from the start of the animation (time after calling StartAnimation(Boolean) or StartAnimation(Double, Boolean)). The pause time is not included in the returned time. If animation was not started, 0 is returned. To get the elapsed time to some specified time use the GetAnimationTimeInSeconds(DateTime) method that takes time as parameter.
Public methodGetAnimationTimeInSeconds(DateTime) Returns time in seconds that elapsed from the start of the animation to the time specified as a parameter to this method. The pause time is not included in the returned time. When animation is started with startFrameNumber parameter, then the animation time is increased by the startFrameNumber divided by FramesPerSecond. If animation was not started, 0 is returned.
Public methodGetDumpString GetDumpString virtual method can be overridden to provide detailed description of this object.
Public methodGetFrameNumber GetFrameNumber returns a double that specifies the current frame number (can be a fraction between two integer values). The number is calculated based on the current animation time (get with calling GetAnimationTimeInSeconds method). If the animation was not yet starter or first frame was not yet reached, then -1 us returned. When animation has passed the last frame and the animation is not repeating, then the last frame number is returned.
Public methodGetFrameNumber(Double) GetFrameNumber returns a double that specifies the frame number at the specified animationTimeInSeconds (can be a fraction between two integer values). If the animation was not yet starter or first frame was not yet reached, then -1 us returned. When animation has passed the last frame and the animation is not repeating, then the last frame number is returned.
Public methodGoToFrame GoToFrame method updates the objects animated with this animation node based on the specified frame number. The method calls GoToFrame(Double) method on all AnimationNodes objects.
Protected methodOnAfterFrameUpdated OnAfterFrameUpdated fires AfterFrameUpdated event
Protected methodOnAnimationCompleted OnAnimationCompleted fires AnimationCompleted event
Protected methodOnAnimationStarted OnAnimationStarted fires AnimationStarted event
Protected methodOnAnimationStopped OnAnimationStopped fires AnimationStopped event
Protected methodOnBeforeFrameUpdated OnBeforeFrameUpdated fires BeforeFrameUpdated event
Public methodPauseAnimation PauseAnimation method pauses the animation. After pausing the animation, the call to GetFrameNumber method will return the frame number at the moment of pausing the animation. To resume the animation call the ResumeAnimation method.
Public methodResumeAnimation ResumeAnimation method resumes the animation after it was paused with PauseAnimation method.
Public methodStartAnimation(Boolean) StartAnimation method starts the animation in this AnimationController. If the animation was paused, this method continues the animation (is the same as ResumeAnimation method). When the subscribeToRenderingEvent parameter is true (by default), then animation controller subscribes to the WPF's RenderingEvent and automatically updates the animated objects by calling GetFrameNumber and GoToFrame(Double) methods. If subscribeToRenderingEvent is false, user needs to manually call GetFrameNumber or other methods to update the animated objects.
Public methodStartAnimation(Double, Boolean) StartAnimation method starts the animation in this AnimationController. If the animation was paused, this method continues the animation (is the same as ResumeAnimation method). When the subscribeToRenderingEvent parameter is true (by default), then animation controller subscribes to the WPF's RenderingEvent and automatically updates the animated objects by calling GetFrameNumber and GoToFrame(Double) methods. If subscribeToRenderingEvent is false, user needs to manually call GetFrameNumber or other methods to update the animated objects.
Public methodStopAnimation StopAnimation method stops the animation. After animation has been stopped, the call to GetFrameNumber method will return the first frame (index = 0).
Top
See Also