ClutterPathConstraint: Clutter Reference Manual

## ClutterPathConstraint ClutterPathConstraint — A constraint that follows a path |

## Functions

ClutterConstraint * | clutter_path_constraint_new ()
void | clutter_path_constraint_set_path ()
ClutterPath * | clutter_path_constraint_get_path ()
void | clutter_path_constraint_set_offset ()
gfloat | clutter_path_constraint_get_offset ()

## Properties

gfloat | offset | Read / Write
ClutterPath * | path | Read / Write

## Signals

void | node-reached | Run Last

## Types and Values

| ClutterPathConstraint

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── ClutterActorMeta
                ╰── ClutterConstraint
                    ╰── ClutterPathConstraint

## Description

ClutterPathConstraint is a simple constraint that modifies the allocation of the ClutterActor to which it has been applied using a ClutterPath.

By setting the “offset” property it is possible to control how far along the path the ClutterActor should be.

ClutterPathConstraint is available since Clutter 1.6.

## Functions

### clutter_path_constraint_new ()

    ClutterConstraint *
    clutter_path_constraint_new (ClutterPath *path,
                                 gfloat offset);

Creates a new ClutterPathConstraint with the given `path` and `offset`

#### Parameters

path | a ClutterPath, or `NULL`. | [allow-none]
offset | the offset along the ClutterPath |

#### Returns

the newly created ClutterPathConstraint

Since: 1.6

### clutter_path_constraint_set_path ()

    void
    clutter_path_constraint_set_path (ClutterPathConstraint *constraint,
                                      ClutterPath *path);

Sets the `path` to be followed by the ClutterPathConstraint.

The `constraint` will take ownership of the ClutterPath passed to this function.

#### Parameters

constraint | a ClutterPathConstraint |
path | a ClutterPath. | [allow-none]

Since: 1.6

### clutter_path_constraint_get_path ()

    ClutterPath *
    clutter_path_constraint_get_path (ClutterPathConstraint *constraint);

Retrieves a pointer to the ClutterPath used by `constraint` .

#### Parameters

constraint | a ClutterPathConstraint |

#### Returns

the ClutterPath used by the ClutterPathConstraint, or `NULL`. The returned ClutterPath is owned by the constraint and it should not be unreferenced.

[transfer none]

Since: 1.6

### clutter_path_constraint_set_offset ()

    void
    clutter_path_constraint_set_offset (ClutterPathConstraint *constraint,
                                        gfloat offset);

Sets the offset along the ClutterPath used by `constraint` .

#### Parameters

constraint | a ClutterPathConstraint |
offset | the offset along the path |

Since: 1.6

### clutter_path_constraint_get_offset ()

    gfloat
    clutter_path_constraint_get_offset (ClutterPathConstraint *constraint);

Retrieves the offset along the ClutterPath used by `constraint` .

#### Parameters

constraint | a ClutterPathConstraint |

#### Returns

the offset

Since: 1.6

## Types and Values

### ClutterPathConstraint

    typedef struct _ClutterPathConstraint ClutterPathConstraint;

ClutterPathConstraint is an opaque structure whose members cannot be directly accessed

Since: 1.6

## Property Details

### The `“offset”` property

      “offset”                   gfloat

The offset along the “path”, between -1.0 and 2.0.

Flags: Read / Write

Allowed values: [-1,2]

Default value: 0

Since: 1.6

### The `“path”` property

      “path”                     ClutterPath *

The ClutterPath used to constrain the position of an actor.

Flags: Read / Write

Since: 1.6

## Signal Details

### The `“node-reached”` signal

    void
    user_function (ClutterPathConstraint *constraint,
                   ClutterActor          *actor,
                   guint                  index,
                   gpointer               user_data)

The ::node-reached signal is emitted each time a “offset” value results in the actor passing a ClutterPathNode

#### Parameters

constraint | the ClutterPathConstraint that emitted the signal |
actor | the ClutterActor using the `constraint` |
index | the index of the node that has been reached |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 1.6