Clutter::Alpha(3pm)
NAME
Clutter::Alpha - A class for calculating a value as a function of time
DESCRIPTION
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)
- o $timeline (Clutter::Timeline)
- o $mode (scalar)
- double = $alpha->get_alpha $alpha->set_func ($func, $data=undef)
- o $func (scalar) a code reference or undef
- o $data (scalar) a scalar to pass to func or undef
- Sets the alpha function for alpha.
- scalar = $alpha->get_mode
$alpha->set_mode ($mode) - o $mode (scalar)
- unsigned = $class->register_func ($func, $data)
- o $func (scalar)
- o $data (scalar)
- timeline = $alpha->get_timeline $alpha->set_timeline ($timeline)
- o $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
- o 'custom-mode' / 'CLUTTER_CUSTOM_MODE'
- o 'linear' / 'CLUTTER_LINEAR'
- o 'ease-in-quad' / 'CLUTTER_EASE_IN_QUAD'
- o 'ease-out-quad' / 'CLUTTER_EASE_OUT_QUAD'
- o 'ease-in-out-quad' / 'CLUTTER_EASE_IN_OUT_QUAD'
- o 'ease-in-cubic' / 'CLUTTER_EASE_IN_CUBIC'
- o 'ease-out-cubic' / 'CLUTTER_EASE_OUT_CUBIC'
- o 'ease-in-out-cubic' / 'CLUTTER_EASE_IN_OUT_CUBIC'
- o 'ease-in-quart' / 'CLUTTER_EASE_IN_QUART'
- o 'ease-out-quart' / 'CLUTTER_EASE_OUT_QUART'
- o 'ease-in-out-quart' / 'CLUTTER_EASE_IN_OUT_QUART'
- o 'ease-in-quint' / 'CLUTTER_EASE_IN_QUINT'
- o 'ease-out-quint' / 'CLUTTER_EASE_OUT_QUINT'
- o 'ease-in-out-quint' / 'CLUTTER_EASE_IN_OUT_QUINT'
- o 'ease-in-sine' / 'CLUTTER_EASE_IN_SINE'
- o 'ease-out-sine' / 'CLUTTER_EASE_OUT_SINE'
- o 'ease-in-out-sine' / 'CLUTTER_EASE_IN_OUT_SINE'
- o 'ease-in-expo' / 'CLUTTER_EASE_IN_EXPO'
- o 'ease-out-expo' / 'CLUTTER_EASE_OUT_EXPO'
- o 'ease-in-out-expo' / 'CLUTTER_EASE_IN_OUT_EXPO'
- o 'ease-in-circ' / 'CLUTTER_EASE_IN_CIRC'
- o 'ease-out-circ' / 'CLUTTER_EASE_OUT_CIRC'
- o 'ease-in-out-circ' / 'CLUTTER_EASE_IN_OUT_CIRC'
- o 'ease-in-elastic' / 'CLUTTER_EASE_IN_ELASTIC'
- o 'ease-out-elastic' / 'CLUTTER_EASE_OUT_ELASTIC'
- o 'ease-in-out-elastic' / 'CLUTTER_EASE_IN_OUT_ELASTIC'
- o 'ease-in-back' / 'CLUTTER_EASE_IN_BACK'
- o 'ease-out-back' / 'CLUTTER_EASE_OUT_BACK'
- o 'ease-in-out-back' / 'CLUTTER_EASE_IN_OUT_BACK'
- o 'ease-in-bounce' / 'CLUTTER_EASE_IN_BOUNCE'
- o 'ease-out-bounce' / 'CLUTTER_EASE_OUT_BOUNCE'
- o 'ease-in-out-bounce' / 'CLUTTER_EASE_IN_OUT_BOUNCE'
- o 'animation-last' / 'CLUTTER_ANIMATION_LAST'
SEE ALSO
Clutter, Glib::Object, Glib::InitiallyUnowned
COPYRIGHT
Copyright (C) 2006, 2007, 2008 OpenedHand Ltd
Copyright (C) 2009 Intel Corporation
This module is free software; you can redistribute it and/or modify it
under the terms of either:
o the GNU Lesser General Public Library version 2.1; or
o the Artistic License, version 2.0.
- See Clutter for the full copyright notice.