Introduction
An Animation
is a class that implements a temporary user interaction in a view. Examples of common animations are:
InsertAnimation
Insert aSnapper
, including positioning it and snapping to other objects.DragAnimation
Move the selection.StretchAnimation
StretchSnapper
s, for instance, change width or height with a dragging gesture.Move3DAnimation
Pan in a 2D view.Rotate3DAnimation
Pan, move or circle target in a 3D view.SnapClickAnimation
DisconnectSnapper
s.
An Animation
takes over the normal behavior of the program while it's running. For instance, when you are inserting a Snapper
, clicking somewhere normally means to place / drop the Snapper
being inserted. When no Animation
is running, clicking in a view selects what you click on.
Implementations
The most common implementations are automatic by overriding Snapper
's animation methods:
insertAnimation()
leftDragAnimation()
rotateAnimation()
- etc. methods that return
Animation
There are also times you want users to select something in the library toolbox to start an Animation
, and for that, you use the AnimationLimb
class.
For any other uses, the best way would be to use the animate()
function in cm/core/animationStack.cm
Noteworthy Things You Can Customize
Mouse Information
As the main purpose of an Animation
is to use as an intuitive method of manipulation using mostly the mouse, you can extract mouse information to customize what you want to do based on this information.
Multiple Stage Animation
If you have an idea to make an input that has multiple stages (i.e. First click it to set a coordinate, Second click to place a stretched coordinate point of a wall). You can refer to SpawningAnimation
.
Multiple Snappers
If in some situations you need to manipulate multiple Snapper
s in one Animation
(i.e. Inserting multiple Snapper
s in a single InsertAnimation
), you can add the Snapper
s with appending using <<.
Core Properties
If the Animation
is G2, you can implement Core Properties into your custom Animation
object. For more information, refer to the Core Properties article.
Graphics in Animation
Placing graphics into an Animation
can assist in improving the intuitive understanding while using a custom Animation
. This can be done in overriding the drawGraphs()
/get3D()
method in the Animation
class.
Others
Most Animation
s that are G2 will be implemented from CoreAnimation
, therefore reading through the class's methods can give you a more updated and detailed picture of what can be customized.
Comments
0 comments
Please sign in to leave a comment.