
@c %start of fragment

@node ClutterPath
@chapter ClutterPath
An object describing a path with straight lines and bezier curves.

@section Overview
A @code{<clutter-path>} contains a description of a path consisting of
straight lines and bezier curves. This can be used in a
@code{<clutter-behaviour-path>} to animate an actor moving along the
path.

The path consists of a series of nodes. Each node is one of the
following four types:

@table @var
@item CLUTTER_PATH_LINE_TO

@c %start of fragment


@c %end of fragment
@item CLUTTER_PATH_CURVE_TO

@c %start of fragment


@c %end of fragment
@item CLUTTER_PATH_CLOSE

@c %start of fragment


@c %end of fragment
@end table

Changes the position of the path to the given pair of coordinates. This
is usually used as the first node of a path to mark the start position.
If it is used in the middle of a path then the path will be disjoint and
the actor will appear to jump to the new position when animated.

Creates a straight line from the previous point to the given point.

Creates a bezier curve. The end of the last node is used as the first
control point and the three subsequent coordinates given in the node as
used as the other three.

Creates a straight line from the last node to the last
@samp{CLUTTER_PATH_MOVE_TO} node. This can be used to close a path so
that it will appear as a loop when animated.

The first three types have the corresponding relative versions
@samp{CLUTTER_PATH_REL_MOVE_TO}, @samp{CLUTTER_PATH_REL_LINE_TO} and
@samp{CLUTTER_PATH_REL_CURVE_TO}. These are exactly the same except the
coordinates are given relative to the previous node instead of as direct
screen positions.

You can build a path using the node adding functions such as
@code{clutter-path-add-line-to}. Alternatively the path can be described
in a string using a subset of the SVG path syntax. See
@code{clutter-path-add-string} for details.

@code{<clutter-path>} is available since Clutter 1.0

@section Usage
@include defuns-clutter-path.xml.texi

@c %end of fragment
