Clutter::Alpha.3pm

Langue: en

Version: 2008-07-23 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

Clutter::Alpha

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 0 and Clutter::Alpha::MAX_ALPHA.

This is an example of a simple alpha function that increments linearly:

   sub linear {
       my $alpha    = shift;
       my $timeline = $alpha->get_timeline();
 
       return int($timeline->get_progress() * Clutter::Alpha->MAX_ALPHA);
   }
 
 

Alphas are used by Clutter::Behaviours to create implicit animations. By changing the alpha function inside a Clutter::Alpha object it's possible to change the speed of the animation.

Clutter provides some common alpha function, like ramps, sines, smoothsteps, exponential and square waves.

HIERARCHY

   Glib::Object
   +----Glib::InitiallyUnowned
        +----Clutter::Alpha
 
 

METHODS


alpha = Clutter::Alpha->new ($timeline=undef, $func=undef, $data=undef)


alpha = Clutter::Alpha->new ($timeline=undef, $func=undef, $data=undef)

$timeline (Clutter::Timeline)
$func (scalar)
$data (scalar)

unsigned = Clutter::Alpha->MAX_ALPHA


unsigned = $alpha->get_alpha


unsigned = $alpha->get_alpha


unsigned = Clutter::Alpha->exp_dec ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->exp_inc ($alpha)

$alpha (Clutter::Alpha)

$alpha->set_func ($func, $data=undef)


$alpha->set_func ($func, $data=undef)

$func (scalar)
$data (scalar)

unsigned = Clutter::Alpha->ramp ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->ramp_dec ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->ramp_inc ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->sine ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->sine_dec ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->sine_half ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->sine_inc ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->smoothstep_dec ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->smoothstep_inc ($alpha)

$alpha (Clutter::Alpha)

unsigned = Clutter::Alpha->square ($alpha)

$alpha (Clutter::Alpha)

timeline = $alpha->get_timeline


timeline = $alpha->get_timeline


$alpha->set_timeline ($timeline)


$alpha->set_timeline ($timeline)

$timeline (Clutter::Timeline)

PROPERTIES

'alpha' (Glib::UInt : readable / private)
Alpha value
'timeline' (Clutter::Timeline : readable / writable / private)
Timeline

SEE ALSO

Clutter, Glib::Object, Glib::InitiallyUnowned Copyright (C) 2006 OpenedHand Ltd.

This module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public Library version 2.1, or under the terms of the Artistic License. See Clutter for the full copyright notice.