ClutterBehaviourPath

ClutterBehaviourPath — A behaviour class interpolating actors along a defined path.

Synopsis




                    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);


Description

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.

Details

ClutterKnot

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


clutter_knot_copy ()

ClutterKnot*        clutter_knot_copy                   (const ClutterKnot *knot);

Makes an allocated copy of a knot.

knot : a ClutterKnot
Returns : the copied knot.

Since 0.2


clutter_knot_free ()

void                clutter_knot_free                   (ClutterKnot *knot);

Frees the memory of an allocated knot.

knot : a ClutterKnot

Since 0.2


clutter_knot_equal ()

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


ClutterBehaviourPathClass

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

clutter_behaviour_path_new ()

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


clutter_behaviour_path_get_knots ()

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


clutter_behaviour_path_append_knot ()

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


clutter_behaviour_path_append_knots ()

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


clutter_behaviour_path_insert_knot ()

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


clutter_behaviour_path_remove_knot ()

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


clutter_behaviour_path_clear ()

void                clutter_behaviour_path_clear        (ClutterBehaviourPath *pathb);

Removes all knots from a path

pathb : a ClutterBehvaiourPath

Since 0.2