![]() |
![]() |
![]() |
![]() |
The ClutterAnimation class, along with the ClutterActor wrappers
clutter_actor_animate()
, clutter_actor_animate_with_timeline()
and
clutter_actor_animate_with_alpha()
, has been deprecated in Clutter 1.12,
and should not be used in newly written code.
The direct replacement for a ClutterAnimation is the ClutterPropertyTransition class, which allows the transition of a single GObject property from an initial value to a final value over a user-defined time using a user-defined easing curve.
The ClutterPropertyTransition class inherits from ClutterTransition, which allows setting the transition interval, as well as the animatable instance to be transitioned; and from ClutterTimeline, which allows setting the duration and easing curve of the transition.
For instance, the following ClutterAnimation set up:
1 |
Can be replaced by ClutterPropertyTransition:
1 |
It is important to note that only ClutterAnimatable implementations can be used directly with ClutterTransition.
A ClutterPropertyTransition can only animate a single property; if more than one property transition is required, you can use the ClutterTransitionGroup class to group the transitions together.
clutter_actor_animate()
ClutterActor animatable properties can use implicit transitions
through their setter functions. The duration and easing curve of the
animation is controlled by clutter_actor_set_easing_duration()
and by
clutter_actor_set_easing_mode()
, respectively; for instance, the
equivalent of the following clutter_actor_animate()
call:
1 |
Can be replaced by the following:
1 |
The default easing duration for the 1.0 API series is set to 0, which means no transition at all.
It is possible to set the easing state of a ClutterActor to its
default values by using clutter_actor_save_easing_state()
, and return
to the previous values by calling clutter_actor_restore_easing_state()
instead. The easing state affects all the animatable properties that
are modified after changing it; so, for instance:
1 |
The animation above will implicitly transition the opacity from its current value to 255 in 500 milliseconds using the default easing curve; at the same time, the size of the actor will be transitioned in 500 milliseconds after a delay of 500 milliseconds to the new size stored in the variables width and height.