Clutter::Alpha3pm
A class for calculating a value as a function of time
Overview
The Clutter::Alpha class binds together a Clutter::Timeline and a function. At each frame of the timeline, the Alpha object will call the given function, which will receive the value of the frame and must return a value between -1.0 and 2.0.
This is an example of a simple alpha function that increments linearly:
sub linear {my ($alpha) = shift;return $alpha->get_timeline()->get_progress();}
A slightly more useful example:
use Math::Trig;sub sine {my ($alpha) = @_;return sin($alpha->get_timeline()->get_progress() * pi);}
Instead of using real functions you can use a logical id for common easing functions, like: Clutter::LINEAR, Clutter::EASE_IN_CUBIC, Clutter::EASE_OUT_BOUNCE, etc. See Clutter::AnimationMode.
Alphas are used by Clutter::Behaviours and Clutter::Animationss to create implicit animations. By changing the alpha function inside a "Clutter::Alpha" object it's possible to change the progress of the animation.
Hierarchy
Glib::Object+----Glib::InitiallyUnowned+----Clutter::Alpha
Methods
alpha = Clutter::Alpha->new ($timeline=undef, $mode=undef)
•
|
|
|---|---|
•
|
|
double = $alpha->get_alpha
$alpha->set_func ($func, $data=undef)
•
|
|
|---|---|
•
|
|
Sets the alpha function for alpha.
scalar = $alpha->get_mode
$alpha->set_mode ($mode)
- •
-
$mode(scalar)
unsigned = $class->register_func ($func, $data)
•
|
|
|---|---|
•
|
|
timeline = $alpha->get_timeline
$alpha->set_timeline ($timeline)
- •
-
$timeline(Clutter::Timeline)
Properties
'alpha' (double : readable / private)
|
Alpha value |
|---|---|
'mode' (Glib::ULong : readable / writable / construct / private)
|
Progress mode |
'timeline' (Clutter::Timeline : readable / writable / private)
|
Timeline used by the alpha |
Enums and flags
enum Clutter::AnimationMode
•
|
'custom-mode' / 'CLUTTER_CUSTOM_MODE' |
|---|---|
•
|
'linear' / 'CLUTTER_LINEAR' |
•
|
'ease-in-quad' / 'CLUTTER_EASE_IN_QUAD' |
•
|
'ease-out-quad' / 'CLUTTER_EASE_OUT_QUAD' |
•
|
'ease-in-out-quad' / 'CLUTTER_EASE_IN_OUT_QUAD' |
•
|
'ease-in-cubic' / 'CLUTTER_EASE_IN_CUBIC' |
•
|
'ease-out-cubic' / 'CLUTTER_EASE_OUT_CUBIC' |
•
|
'ease-in-out-cubic' / 'CLUTTER_EASE_IN_OUT_CUBIC' |
•
|
'ease-in-quart' / 'CLUTTER_EASE_IN_QUART' |
•
|
'ease-out-quart' / 'CLUTTER_EASE_OUT_QUART' |
•
|
'ease-in-out-quart' / 'CLUTTER_EASE_IN_OUT_QUART' |
•
|
'ease-in-quint' / 'CLUTTER_EASE_IN_QUINT' |
•
|
'ease-out-quint' / 'CLUTTER_EASE_OUT_QUINT' |
•
|
'ease-in-out-quint' / 'CLUTTER_EASE_IN_OUT_QUINT' |
•
|
'ease-in-sine' / 'CLUTTER_EASE_IN_SINE' |
•
|
'ease-out-sine' / 'CLUTTER_EASE_OUT_SINE' |
•
|
'ease-in-out-sine' / 'CLUTTER_EASE_IN_OUT_SINE' |
•
|
'ease-in-expo' / 'CLUTTER_EASE_IN_EXPO' |
•
|
'ease-out-expo' / 'CLUTTER_EASE_OUT_EXPO' |
•
|
'ease-in-out-expo' / 'CLUTTER_EASE_IN_OUT_EXPO' |
•
|
'ease-in-circ' / 'CLUTTER_EASE_IN_CIRC' |
•
|
'ease-out-circ' / 'CLUTTER_EASE_OUT_CIRC' |
•
|
'ease-in-out-circ' / 'CLUTTER_EASE_IN_OUT_CIRC' |
•
|
'ease-in-elastic' / 'CLUTTER_EASE_IN_ELASTIC' |
•
|
'ease-out-elastic' / 'CLUTTER_EASE_OUT_ELASTIC' |
•
|
'ease-in-out-elastic' / 'CLUTTER_EASE_IN_OUT_ELASTIC' |
•
|
'ease-in-back' / 'CLUTTER_EASE_IN_BACK' |
•
|
'ease-out-back' / 'CLUTTER_EASE_OUT_BACK' |
•
|
'ease-in-out-back' / 'CLUTTER_EASE_IN_OUT_BACK' |
•
|
'ease-in-bounce' / 'CLUTTER_EASE_IN_BOUNCE' |
•
|
'ease-out-bounce' / 'CLUTTER_EASE_OUT_BOUNCE' |
•
|
'ease-in-out-bounce' / 'CLUTTER_EASE_IN_OUT_BOUNCE' |
•
|
'animation-last' / 'CLUTTER_ANIMATION_LAST' |
Releases
2 releases since Debian 5.0 (Lenny); the text changed 1 time.