![]() |
![]() |
![]() |
Clutter 0.4 Reference Manual | ![]() |
---|---|---|---|---|
ClutterBehaviourPathClutterBehaviourPath — A behaviour class interpolating actors along a defined path. |
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); 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);
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.
typedef struct { gint x; gint y; } ClutterKnot;
Point in a path behaviour.
gint x ; |
X coordinate of the knot |
gint y ; |
Y coordinate of the knot |
Since 0.2
ClutterKnot* clutter_knot_copy (const ClutterKnot *knot);
Makes an allocated copy of a knot.
knot : |
a ClutterKnot |
Returns : | the copied knot. |
Since 0.2
void clutter_knot_free (ClutterKnot *knot);
Frees the memory of an allocated knot.
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.
knot_a : |
First knot |
knot_b : |
Second knot |
Returns : | TRUE if the knots point to the same location.
|
Since 0.2
typedef struct { void (*knot_reached) (ClutterBehaviourPath *pathb, const ClutterKnot *knot); } ClutterBehaviourPathClass;
Since 0.2
knot_reached () |
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
.
alpha : |
a ClutterAlpha, or NULL
|
knots : |
a list of ClutterKnots, or NULL for an empty path
|
n_knots : |
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
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
pathb : |
a ClutterBehvaiourPath |
knot : |
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.
pathb : |
a ClutterBehvaiourPath |
first_knot : |
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.
pathb : |
a ClutterBehvaiourPath |
offset : |
position in path to insert knot. |
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.
pathb : |
a ClutterBehvaiourPath |
offset : |
position in path to remove knot. |
Since 0.2