Top | ![]() |
![]() |
![]() |
![]() |
gdouble | (*ClutterAlphaFunc) () |
ClutterAlpha * | clutter_alpha_new () |
ClutterAlpha * | clutter_alpha_new_full () |
ClutterAlpha * | clutter_alpha_new_with_func () |
void | clutter_alpha_set_timeline () |
ClutterTimeline * | clutter_alpha_get_timeline () |
void | clutter_alpha_set_mode () |
gulong | clutter_alpha_get_mode () |
gdouble | clutter_alpha_get_alpha () |
void | clutter_alpha_set_func () |
void | clutter_alpha_set_closure () |
gulong | clutter_alpha_register_closure () |
gulong | clutter_alpha_register_func () |
gdouble | alpha | Read |
gulong | mode | Read / Write / Construct |
ClutterTimeline * | timeline | Read / Write |
ClutterAlpha is a class for calculating an floating point value dependent only on the position of a ClutterTimeline.
For newly written code, it is recommended to use the
“progress-mode” property of ClutterTimeline, or the
clutter_timeline_set_progress_func()
function instead of ClutterAlpha.
The ClutterAlpha class will be deprecated in the future, and will not
be available any more in the next major version of Clutter.
A ClutterAlpha binds a ClutterTimeline to a progress function which translates the time T into an adimensional factor alpha. The factor can then be used to drive a ClutterBehaviour, which will translate the alpha value into something meaningful for a ClutterActor.
You should provide a ClutterTimeline and bind it to the ClutterAlpha
instance using clutter_alpha_set_timeline()
. You should also set an
"animation mode", either by using the ClutterAnimationMode values that
Clutter itself provides or by registering custom functions using
clutter_alpha_register_func()
.
Instead of a ClutterAnimationMode you may provide a function returning
the alpha value depending on the progress of the timeline, using
clutter_alpha_set_func()
or clutter_alpha_set_closure()
. The alpha
function will be executed each time a new frame in the ClutterTimeline
is reached.
Since the alpha function is controlled by the timeline instance, you can pause, stop or resume the ClutterAlpha from calling the alpha function by using the appropriate functions of the ClutterTimeline object.
ClutterAlpha is used to "drive" a ClutterBehaviour instance, and it is internally used by the ClutterAnimation API.
ClutterAlpha is available since Clutter 0.2.
ClutterAlpha is deprecated since Clutter 1.12; use ClutterTimeline and the “progress-mode” property.
ClutterAlpha defines a custom function
property for
ClutterScript which allows to reference a custom alpha function
available in the source code. Setting the function
property
is equivalent to calling clutter_alpha_set_func()
with the
specified function name. No user data or GDestroyNotify is
available to be passed.
The following JSON fragment defines a ClutterAlpha
using a ClutterTimeline with id "sine-timeline" and an alpha
function called my_sine_alpha
. The defined ClutterAlpha
instance can be reused in multiple ClutterBehaviour
definitions or for ClutterAnimation definitions.
1 2 3 4 5 6 7 8 9 |
{ "id" : "sine-alpha", "timeline" : { "id" : "sine-timeline", "duration" : 500, "loop" : true }, "function" : "my_sine_alpha" } |
gdouble (*ClutterAlphaFunc) (ClutterAlpha *alpha
,gpointer user_data
);
A function returning a value depending on the position of
the ClutterTimeline bound to alpha
.
Since 0.2
ClutterAlpha *
clutter_alpha_new (void
);
clutter_alpha_new
has been deprecated since version 1.12 and should not be used in newly-written code.
Creates a new ClutterAlpha instance. You must set a function
to compute the alpha value using clutter_alpha_set_func()
and
bind a ClutterTimeline object to the ClutterAlpha instance
using clutter_alpha_set_timeline()
.
You should use the newly created ClutterAlpha instance inside a ClutterBehaviour object.
Since 0.2
ClutterAlpha * clutter_alpha_new_full (ClutterTimeline *timeline
,gulong mode
);
clutter_alpha_new_full
has been deprecated since version 1.12 and should not be used in newly-written code.
Creates a new ClutterAlpha instance and sets the timeline and animation mode.
See also clutter_alpha_set_timeline()
and clutter_alpha_set_mode()
.
Since 1.0
ClutterAlpha * clutter_alpha_new_with_func (ClutterTimeline *timeline
,ClutterAlphaFunc func
,gpointer data
,GDestroyNotify destroy
);
clutter_alpha_new_with_func
has been deprecated since version 1.12 and should not be used in newly-written code.
Creates a new ClutterAlpha instances and sets the timeline and the alpha function.
This function will not register func
as a global alpha function.
See also clutter_alpha_set_timeline()
and clutter_alpha_set_func()
.
timeline |
||
func |
||
data |
data to pass to the function, or |
|
destroy |
function to call when removing the alpha function, or |
Since 1.0
void clutter_alpha_set_timeline (ClutterAlpha *alpha
,ClutterTimeline *timeline
);
clutter_alpha_set_timeline
has been deprecated since version 1.12 and should not be used in newly-written code.
Binds alpha
to timeline
.
Since 0.2
ClutterTimeline *
clutter_alpha_get_timeline (ClutterAlpha *alpha
);
clutter_alpha_get_timeline
has been deprecated since version 1.12 and should not be used in newly-written code.
Gets the ClutterTimeline bound to alpha
.
Since 0.2
void clutter_alpha_set_mode (ClutterAlpha *alpha
,gulong mode
);
clutter_alpha_set_mode
has been deprecated since version 1.12 and should not be used in newly-written code.
Sets the progress function of alpha
using the symbolic value
of mode
, as taken by the ClutterAnimationMode enumeration or
using the value returned by clutter_alpha_register_func()
.
Since 1.0
gulong
clutter_alpha_get_mode (ClutterAlpha *alpha
);
clutter_alpha_get_mode
has been deprecated since version 1.12 and should not be used in newly-written code.
Retrieves the ClutterAnimationMode used by alpha
.
Since 1.0
gdouble
clutter_alpha_get_alpha (ClutterAlpha *alpha
);
clutter_alpha_get_alpha
has been deprecated since version 1.12 and should not be used in newly-written code.
Query the current alpha value.
Since 0.2
void clutter_alpha_set_func (ClutterAlpha *alpha
,ClutterAlphaFunc func
,gpointer data
,GDestroyNotify destroy
);
clutter_alpha_set_func
has been deprecated since version 1.12 and should not be used in newly-written code.
Sets the ClutterAlphaFunc function used to compute
the alpha value at each frame of the ClutterTimeline
bound to alpha
.
This function will not register func
as a global alpha function.
alpha |
||
func |
||
data |
user data to be passed to the alpha function, or |
|
destroy |
notify function used when disposing the alpha function |
Since 0.2
void clutter_alpha_set_closure (ClutterAlpha *alpha
,GClosure *closure
);
clutter_alpha_set_closure
has been deprecated since version 1.12 and should not be used in newly-written code.
Sets the GClosure used to compute the alpha value at each
frame of the ClutterTimeline bound to alpha
.
Since 0.8
gulong
clutter_alpha_register_closure (GClosure *closure
);
clutter_alpha_register_closure
has been deprecated since version 1.12 and should not be used in newly-written code.
GClosure variant of clutter_alpha_register_func()
.
Registers a global alpha function and returns its logical id
to be used by clutter_alpha_set_mode()
or by ClutterAnimation.
The logical id is always greater than CLUTTER_ANIMATION_LAST
.
Rename to: clutter_alpha_register_func
Since 1.0
gulong clutter_alpha_register_func (ClutterAlphaFunc func
,gpointer data
);
clutter_alpha_register_func
has been deprecated since version 1.12 and should not be used in newly-written code.
Registers a global alpha function and returns its logical id
to be used by clutter_alpha_set_mode()
or by ClutterAnimation.
The logical id is always greater than CLUTTER_ANIMATION_LAST
.
Since 1.0
typedef struct _ClutterAlpha ClutterAlpha;
ClutterAlpha combines a ClutterTimeline and a function. The contents of the ClutterAlpha structure are private and should only be accessed using the provided API.
Since 0.2
“alpha”
property “alpha” gdouble
The alpha value as computed by the alpha function. The linear interval is 0.0 to 1.0, but the Alpha allows overshooting by one unit in each direction, so the valid interval is -1.0 to 2.0.
ClutterAlpha:alpha
has been deprecated since version 1.12 and should not be used in newly-written code.
Flags: Read
Allowed values: [-1,2]
Default value: 0
Since 0.2
“mode”
property “mode” gulong
The progress function logical id - either a value from the
ClutterAnimationMode enumeration or a value returned by
clutter_alpha_register_func()
.
If CLUTTER_CUSTOM_MODE
is used then the function set using
clutter_alpha_set_closure()
or clutter_alpha_set_func()
will be used.
ClutterAlpha:mode
has been deprecated since version 1.12 and should not be used in newly-written code.
Flags: Read / Write / Construct
Since 1.0
“timeline”
property“timeline” ClutterTimeline *
A ClutterTimeline instance used to drive the alpha function.
ClutterAlpha:timeline
has been deprecated since version 1.12 and should not be used in newly-written code.
Flags: Read / Write
Since 0.2