Method

ClutterPathadd_string

Declaration [src]

gboolean
clutter_path_add_string (
  ClutterPath* path,
  const gchar* str
)

Description [src]

Adds new nodes to the end of the path as described in str. The format is a subset of the SVG path format. Each node is represented by a letter and is followed by zero, one or three pairs of coordinates. The coordinates can be separated by spaces or a comma. The types are:

  • M: Adds a CLUTTER_PATH_MOVE_TO node. Takes one pair of coordinates.
  • L: Adds a CLUTTER_PATH_LINE_TO node. Takes one pair of coordinates.
  • C: Adds a CLUTTER_PATH_CURVE_TO node. Takes three pairs of coordinates.
  • z: Adds a CLUTTER_PATH_CLOSE node. No coordinates are needed.

The M, L and C commands can also be specified in lower case which means the coordinates are relative to the previous node.

For example, to move an actor in a 100 by 100 pixel square centered on the point 300,300 you could use the following path:

  M 250,350 l 0 -100 L 350,250 l 0 100 z

If the path description isn’t valid FALSE will be returned and no nodes will be added.

Parameters

str

Type: const gchar*

A string describing the new nodes.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.

Return value

Type: gboolean

TRUE is the path description was valid or FALSE otherwise.