Commit Graph

4 Commits

Author SHA1 Message Date
Elliot Smith
82ab00930b cookbook: Simplified and clarified example code
Modified the "animation reuse" sample code to provide
a simpler example to explain in the recipe.

Also modified variable names to mirror the names used
for the previous "complex animation" example and added
some more comments, to further simplify and support the
recipe.
2010-09-13 12:25:47 +01:00
Elliot Smith
d7a3e35f46 cookbook: Cleaned up the "animations reuse" example
With some help from pippin, moved variable declarations
into more sensible positions within their functions,
changed a function name, and found a better way
to unref a script once its associated actor has
been destroyed.
2010-09-13 12:25:47 +01:00
Elliot Smith
d4190cbf8c cookbook: Refactored reusable animation example
Extracted the animation into its own JSON definition,
then create a new script and get the animation each
time a rectangle is clicked.

Removes the need to reparent onto the background and
copy property values to the rectangle after the animation,
and generally much cleaner.
2010-09-13 12:25:47 +01:00
Elliot Smith
acc28cf60c cookbook: Added example for animation reuse recipe
Added an example showing how to reuse a ClutterAnimator
instance to animate multiple actors at different times
using an animatable rig, combined with reparenting.
2010-09-13 12:25:47 +01:00