Enumerations #

Name Values

This class exposes no enumerations.

Constants #

Name Type Value

This class exposes no constants.

Events #

Definition Description

This class exposes no events.

Delegates #

AtKeyframe(currentKeyframe as GraffitiAnimatorKeyframe)
AnimationProgress(animControl as GraffitiAnimatorControl, animOp as GraffitiAnimatorOperation, newValue as Double)

Methods #

Definition Description
AddKeyframe(Name as String, waitTime as Integer = 0) as GraffitiAnimatorControl Adds a new keyframe.
AddKeyframe(newKeyframe as GraffitiAnimatorKeyframe) as GraffitiAnimatorControl
AddKeyframe(waitTime as Integer = 0) as GraffitiAnimatorControl
AddOperation(animOp as GraffitiAnimatorOperation) as GraffitiAnimatorControl Adds a new animation operation to the stack.
Constructor(Target as DesktopContainer) Instantiates a new instance of the class.
Move(newLeft as Double, newTop as Double, animationLength as Integer, easing as GraffitiAnimator.Easings) as GraffitiAnimatorControl Moves the control to the specified position.
OnComplete(finishFunction as AnimationComplete) Invokes the provided delegate when all animation has completed.
OnKeyframe(keyframeFunction as AtKeyframe) Invokes the provided delegate when the animation encounters a keyframe.
OnProgress(changeFunction as AnimationProgress) Invokes the provided delegate as animation operations progress.
Play(DestroyWhenComplete as Boolean = True) Plays the provided animation stack, optionally destructs itself when complete.
Resize(newWidth as Double, newHeight as Double, animationLength as Integer, easing as GraffitiAnimator.Easings) Resizes the RectControl using the specified values.
Shake(numberOfShakes as Integer = 5, deltaX as Integer = 5, deltaY as Integer = 0, animationLength as Integer = 800) Causes the RectControl to shake violently along the X-axis.
Stop() as GraffitiAnimatorControl Cancels all running animations and immediately applies the requested end values for those operations.

Properties #

Name Type Default Value Description
State GraffitiAnimator.States Idle The current running state of the animator.
Target DesktopContainer Nil The UI element to be animated.

Examples #

Chaining #

This class was developed to make animation chaining simple for enthralling UI animations. Below is an example directly from the demo project that demonstrates how this is done. Me is a PushButton:

'// This is meant to show you how to use animation
'   chaining with a dynamically created object.
'   It makes use of Delegates for callbacks when
'   keyframes are reached or when the animation
'   chain is complete. Play() should always be the
'   the last command.
dim animControl as new GraffitiAnimatorControl( me )
Call animControl._
AddOperation( new GraffitiAnimatorOperation( "textsize", me.TextSize, me.TextSize * 2, 1000, GraffitiAnimator.Easings.BounceOut ) )._
Move( me.Left, 52, 1000, GraffitiAnimator.Easings.BounceOut )
Call animControl._
AddKeyframe( "MidBounce", 1000 )._
AddOperation( new GraffitiAnimatorOperation( "textsize", me.TextSize * 2, me.TextSize, 1000, GraffitiAnimator.Easings.BounceOut ) )._
Move( me.Left, 3, 1000, GraffitiAnimator.Easings.BounceOut )
Call animControl._
AddKeyframe( "BeforeResize", 0 )._
Resize( me.Width * 2, me.Height, 1000, GraffitiAnimator.Easings.ElasticOut )._
Move( me.Left - (me.Width / 2), me.Top, 1000, GraffitiAnimator.Easings.ElasticOut )._
Call animControl._
AddKeyframe( "MidResize", 1000 )._
Resize( me.Width, me.Height, 1000, GraffitiAnimator.Easings.ElasticOut )._
Move( me.Left, me.Top, 1000, GraffitiAnimator.Easings.ElasticOut )._
call animControl._
OnProgress( GraffitiAnimatorControl.AnimationProgress( WeakAddressOf bounceProgress ) )._
OnKeyframe( GraffitiAnimatorControl.AtKeyframe( WeakAddressOf bounceKeyframe ) )._
OnComplete( GraffitiAnimatorControl.AnimationComplete( WeakAddressOf bounceFinished ) )._
Play( True )

Notes #

This class currently has no notes.