Emmanuele Bassi > Clutter-0.820 > xs/ClutterEffect.xs

Download:
Clutter-0.820.tar.gz

Annotate this POD

CPAN RT

New  3
Open  2
View/Report Bugs
Source  

DESCRIPTION ^

Clutter::Effect contains a set of functions for simple, one-off animations involving a single actor. It is a convenience wrapper around the more complex an powerful animations objects, Clutter::Behaviour, Clutter::Alpha and Clutter::Timeline.

Effects are created from a template, which binds a Clutter::Timeline and an alpha function, similarly to how Clutter::Alpha works. You can reuse a template for multiple animations.

After you have created a Clutter::EffectTemplate you can call one of the simple class methods, providing the template object and the parameters for the animation. You can optionally pass a function reference, which will be invoked when the animation stops; the function reference has this signature:

  sub effect_complete {
      my $actor = shift;
      my $data  = shift;

      # ...
  }

Every Clutter::Effect class method returns a copy of the Clutter::Timeline used in the template, so you can control the animation with it. NOTE: you cannot loop an effect.

syntax highlighting: