Clutter 0.8.2 Reference Manual | ||||
---|---|---|---|---|
ClutterBehaviourPath; ClutterBehaviourPathClass; ClutterBehaviour* clutter_behaviour_path_new (ClutterAlpha *alpha, const ClutterKnot *knots, guint n_knots); GSList* clutter_behaviour_path_get_knots (ClutterBehaviourPath *pathb); void clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, const ClutterKnot *knot); void clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, const ClutterKnot *first_knot, ...); void clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, guint offset, const ClutterKnot *knot); void clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, guint offset); void clutter_behaviour_path_clear (ClutterBehaviourPath *pathb); ClutterKnot; ClutterKnot* clutter_knot_copy (const ClutterKnot *knot); void clutter_knot_free (ClutterKnot *knot); gboolean clutter_knot_equal (const ClutterKnot *knot_a, const ClutterKnot *knot_b);
ClutterBehaviourPath interpolates actors along a defined path.
A path is a set of ClutterKnots object given when creating a new
ClutterBehaviourPath instance. Knots can be also added to the path
using clutter_behaviour_path_append_knot()
. The whole path can be
cleared using clutter_behaviour_path_clear()
. Each time the behaviour
reaches a knot in the path, the "knot-reached" signal is emitted.
This first knot in the path is reached with the lower bound value provided by the ClutterAlpha objectused by the behaviour; the last knot in the path is reached with the upper bound value provided by the ClutterAlpha object used by the behaviour.
CLUTTER_ALPHA_MAX_ALPHA
, then the actors will walk
the path back to the starting ClutterKnot.
ClutterBehaviourPath is available since Clutter 0.2
typedef struct { void (*knot_reached) (ClutterBehaviourPath *pathb, const ClutterKnot *knot); } ClutterBehaviourPathClass;
Since 0.2
|
signal class handler for the ClutterBehaviourPath::knot_reached signal |
ClutterBehaviour* clutter_behaviour_path_new (ClutterAlpha *alpha, const ClutterKnot *knots, guint n_knots);
Creates a new path behaviour. You can use this behaviour to drive
actors along the nodes of a path, described by the knots
.
|
a ClutterAlpha, or NULL
|
|
a list of ClutterKnots, or NULL for an empty path
|
|
the number of nodes in the path |
Returns : |
a ClutterBehaviour |
Since 0.2
GSList* clutter_behaviour_path_get_knots (ClutterBehaviourPath *pathb);
Returns a copy of the list of knots contained by pathb
|
a ClutterBehvaiourPath |
Returns : |
a GSList of the paths knots. |
Since 0.2
void clutter_behaviour_path_append_knot (ClutterBehaviourPath *pathb, const ClutterKnot *knot);
Appends a ClutterKnot to the path
|
a ClutterBehvaiourPath |
|
a ClutterKnot to append. |
Since 0.2
void clutter_behaviour_path_append_knots (ClutterBehaviourPath *pathb, const ClutterKnot *first_knot, ...);
Adds a NULL-terminated list of knots to a path. This function is
equivalent to calling clutter_behaviour_path_append_knot()
for each
member of the list.
|
a ClutterBehvaiourPath |
|
the ClutterKnot knot to add to the path |
|
additional knots to add to the path |
Since 0.2
void clutter_behaviour_path_insert_knot (ClutterBehaviourPath *pathb, guint offset, const ClutterKnot *knot);
Inserts a ClutterKnot in the path at specified position. Values greater than total number of knots will append the knot at the end of path.
|
a ClutterBehvaiourPath |
|
position in path to insert knot. |
|
a ClutterKnot to append. |
Since 0.2
void clutter_behaviour_path_remove_knot (ClutterBehaviourPath *pathb, guint offset);
Removes a ClutterKnot in the path at specified offset.
|
a ClutterBehvaiourPath |
|
position in path to remove knot. |
Since 0.2
void clutter_behaviour_path_clear (ClutterBehaviourPath *pathb);
Removes all knots from a path
|
a ClutterBehvaiourPath |
Since 0.2
ClutterKnot* clutter_knot_copy (const ClutterKnot *knot);
Makes an allocated copy of a knot.
|
a ClutterKnot |
Returns : |
the copied knot. |
Since 0.2
void clutter_knot_free (ClutterKnot *knot);
Frees the memory of an allocated knot.
|
a ClutterKnot |
Since 0.2
gboolean clutter_knot_equal (const ClutterKnot *knot_a, const ClutterKnot *knot_b);
Compares to knot and checks if the point to the same location.
|
First knot |
|
Second knot |
Returns : |
TRUE if the knots point to the same location.
|
Since 0.2
"knot"
property"knot" ClutterKnot* : Write
This property can be used to append a new knot to the path.
Since 0.2
"knot-reached"
signalvoid user_function (ClutterBehaviourPath *pathb, ClutterKnot *knot, gpointer user_data) : Run Last
This signal is emitted each time a node defined inside the path is reached.
|
the object which received the signal |
|
the ClutterKnot reached |
|
user data set when the signal handler was connected. |
Since 0.2