Next: , Previous: ClutterBehaviourOpacity, Up: Top


9 ClutterBehaviourPath

A behaviour interpolating position along a path

9.1 Overview

<clutter-behaviour-path> interpolates actors along a defined path.

A path is a set of <clutter-knots> object given when creating a new <clutter-behaviour-path> 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 <clutter-alpha> objectused by the behaviour; the last knot in the path is reached with the upper bound value provided by the <clutter-alpha> object used by the behaviour.

If the alpha function is a periodic function, i.e. it returns to 0 after reaching ‘CLUTTER_ALPHA_MAX_ALPHA’, then the actors will walk the path back to the starting <clutter-knot>.

<clutter-behaviour-path> is available since Clutter 0.2

9.2 Usage

— Class: <clutter-behaviour-path>

Derives from <clutter-scriptable>, <clutter-behaviour>.

This class defines the following slots:

knot
Can be used to append a knot to the path
— Signal on <clutter-behaviour-path>: knot-reached (arg0 <clutter-knot>)

This signal is emitted each time a node defined inside the path is reached.

Since 0.2

— Class: <clutter-knot>

Derives from <gboxed>.

This class defines no direct slots.

— Function: clutter-behaviour-path-new (alpha <clutter-alpha>) (knots <clutter-knot>) (n_knots unsigned-int)   (ret <clutter-behaviour>)

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 <clutter-alpha>, or ‘#f
knots
a list of <clutter-knots>, or ‘#f’ for an empty path
n-knots
the number of nodes in the path
ret
a <clutter-behaviour>

Since 0.2

— Function: clutter-behaviour-path-get-knots (self <clutter-behaviour-path>)   (ret gslist-of)
— Method: get-knots

Returns a copy of the list of knots contained by pathb

pathb
a <clutter-behvaiour-path>
ret
a <gs-list> of the paths knots.

Since 0.2

— Function: clutter-behaviour-path-append-knot (self <clutter-behaviour-path>) (knot <clutter-knot>)
— Method: append-knot

Appends a <clutter-knot> to the path

pathb
a <clutter-behvaiour-path>
knot
a <clutter-knot> to append.

Since 0.2

— Function: clutter-behaviour-path-insert-knot (self <clutter-behaviour-path>) (offset unsigned-int) (knot <clutter-knot>)
— Method: insert-knot

Inserts a <clutter-knot> in the path at specified position. Values greater than total number of knots will append the knot at the end of path.

pathb
a <clutter-behvaiour-path>
offset
position in path to insert knot.
knot
a <clutter-knot> to append.

Since 0.2

— Function: clutter-behaviour-path-remove-knot (self <clutter-behaviour-path>) (offset unsigned-int)
— Method: remove-knot

Removes a <clutter-knot> in the path at specified offset.

pathb
a <clutter-behvaiour-path>
offset
position in path to remove knot.

Since 0.2

— Function: clutter-behaviour-path-clear (self <clutter-behaviour-path>)
— Method: clear

Removes all knots from a path

pathb
a <clutter-behvaiour-path>

Since 0.2

— Function: clutter-knot-equal (self <clutter-knot>) (knot_b <clutter-knot>)   (ret bool)

Compares to knot and checks if the point to the same location.

knot-a
First knot
knot-b
Second knot
ret
#t’ if the knots point to the same location.

Since 0.2