This recipe explains how to use the three animation
approaches (implicit, State, Animator) to animate movement
of actors.
Includes some guidelines about which approach to use when, with
a full code example for each approach.
The discussion section covers some subtleties around animated
movement; namely: moving actors out of their containers; anchor
points and movement; moving in the depth axis; interactions
between animated movement and constraints.
This recipe explains how to "reuse" the same animation
definition for different actors, by creating a new
instance of a "rig" (empty container) and animation
for the rig each time the animation is required.
An actor is then re-parented to the rig and animated
using it, rather than being animated directly.
JSON is used to define the rig + animator, to make
creating new instances of them simpler. The recipe
also discusses various caveats around using this
approach, rather than directly animating an actor.
Uses ClutterAnimator to implement a reasonably complex
animation of a single actor (movement along a path with
simultaneous scaling).
Provides a metaphor for thinking about ClutterAnimator
animations (stage directions) and explains keys and key
frames in some depth. Also compares ClutterAnimator
with other possible approaches to this type of animation
(implicit animations, ClutterState).
Added a video showing the two texture cross-fade.
Modified the example code to animate on key press, so
this video could be captured.
Also altered the stage size to minimise the video size.
New recipe covering how to animate rotation of
an actor (in all axes).
Covers various factors affecting rotation animation
(like orientation of axes, parent rotation/orientation),
as well as trying to make rotations easier to visualise
(e.g. describing how rotation direction is affected by
those factors, how a rotation can be expected to look
when animated). Uses implicit animations for code examples.
Also refers to a full code example which uses ClutterState.
* elliot/cookbook-include-videos:
cookbook: Tweak so that videos sit inside a paragraph for better spacing
docs: Note the P_() macro in the HACKING file
cookbook: Added support for inline video
Conflicts:
doc/cookbook/Makefile.am
Amended Makefile to copy content of videos directory into
installation directories. Also copies videos and images
into the html/ directory during the build, so that the
built cookbook can be viewed locally (for testing without
having to install).
Added an XSLT template to transform Docbook <inlinemediaobject>
elements into HTML 5 <video> elements, with a fallback to
link to the video displayed for browsers without HTML 5 support.
Added note to "Contributing" appendix explaining how to put
video into a recipe.