## ClutterAlignConstraint

ClutterAlignConstraint — A constraint aligning the position of an actor

## Synopsis

                        ClutterAlignConstraint;
    enum                ClutterAlignAxis;
    ClutterConstraint * clutter_align_constraint_new        (ClutterActor *source,
                                                             ClutterAlignAxis axis,
                                                             gfloat factor);
    void                clutter_align_constraint_set_source (ClutterAlignConstraint *align,
                                                             ClutterActor *source);
    ClutterActor *      clutter_align_constraint_get_source (ClutterAlignConstraint *align);
    void                clutter_align_constraint_set_align_axis
                                                            (ClutterAlignConstraint *align,
                                                             ClutterAlignAxis axis);
    ClutterAlignAxis    clutter_align_constraint_get_align_axis
                                                            (ClutterAlignConstraint *align);
    void                clutter_align_constraint_set_factor (ClutterAlignConstraint *align,
                                                             gfloat factor);
    gfloat              clutter_align_constraint_get_factor (ClutterAlignConstraint *align);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActorMeta
                   +----ClutterConstraint
                         +----ClutterAlignConstraint

## Properties

      "align-axis"               ClutterAlignAxis      : Read / Write / Construct
      "factor"                   gfloat                : Read / Write / Construct
      "source"                   ClutterActor*         : Read / Write / Construct

## Description

ClutterAlignConstraint is a ClutterConstraint that aligns the position of the ClutterActor to which it is applied to the size of another ClutterActor using an alignment factor

ClutterAlignConstraint is available since Clutter 1.4

## Details

### ClutterAlignConstraint

    typedef struct _ClutterAlignConstraint ClutterAlignConstraint;

ClutterAlignConstraint is an opaque structure whose members cannot be directly accesses

Since 1.4

### enum ClutterAlignAxis

    typedef enum {
     /*< prefix=CLUTTER_ALIGN >*/
      CLUTTER_ALIGN_X_AXIS,
      CLUTTER_ALIGN_Y_AXIS,
      CLUTTER_ALIGN_BOTH
    } ClutterAlignAxis;

Specifies the axis on which ClutterAlignConstraint should maintain the alignment.

`CLUTTER_ALIGN_X_AXIS` | Maintain the alignment on the X axis
`CLUTTER_ALIGN_Y_AXIS` | Maintain the alignment on the Y axis
`CLUTTER_ALIGN_BOTH` | Maintain the alignment on both the X and Y axis

Since 1.4

### clutter_align_constraint_new ()

    ClutterConstraint * clutter_align_constraint_new        (ClutterActor *source,
                                                             ClutterAlignAxis axis,
                                                             gfloat factor);

Creates a new constraint, aligning a ClutterActor's position with regards of the size of the actor to `source`, with the given alignment `factor`

`source` : | the ClutterActor to use as the source of the alignment, or `NULL`. [allow-none]
`axis` : | the axis to be used to compute the alignment
`factor` : | the alignment factor, between 0.0 and 1.0
Returns : | the newly created ClutterAlignConstraint

Since 1.4

### clutter_align_constraint_set_source ()

    void                clutter_align_constraint_set_source (ClutterAlignConstraint *align,
                                                             ClutterActor *source);

Sets the source of the alignment constraint

`align` : | a ClutterAlignConstraint
`source` : | a ClutterActor, or `NULL` to unset the source. [allow-none]

Since 1.4

### clutter_align_constraint_get_source ()

    ClutterActor *      clutter_align_constraint_get_source (ClutterAlignConstraint *align);

Retrieves the source of the alignment

`align` : | a ClutterAlignConstraint
Returns : | the ClutterActor used as the source of the alignment. [transfer none]

Since 1.4

### clutter_align_constraint_set_align_axis ()

    void                clutter_align_constraint_set_align_axis
                                                            (ClutterAlignConstraint *align,
                                                             ClutterAlignAxis axis);

Sets the axis to which the alignment refers to

`align` : | a ClutterAlignConstraint
`axis` : | the axis to which the alignment refers to

Since 1.4

### clutter_align_constraint_get_align_axis ()

    ClutterAlignAxis    clutter_align_constraint_get_align_axis
                                                            (ClutterAlignConstraint *align);

Retrieves the value set using `clutter_align_constraint_set_align_axis()`

`align` : | a ClutterAlignConstraint
Returns : | the alignment axis

Since 1.4

### clutter_align_constraint_set_factor ()

    void                clutter_align_constraint_set_factor (ClutterAlignConstraint *align,
                                                             gfloat factor);

Sets the alignment factor of the constraint

The factor depends on the "align-axis" property and it is a value between 0.0 (meaning left, when "align-axis" is set to `CLUTTER_ALIGN_X_AXIS`; or meaning top, when "align-axis" is set to `CLUTTER_ALIGN_Y_AXIS`) and 1.0 (meaning right, when "align-axis" is set to `CLUTTER_ALIGN_X_AXIS`; or meaning bottom, when "align-axis" is set to `CLUTTER_ALIGN_Y_AXIS`). A value of 0.5 aligns in the middle in either cases

`align` : | a ClutterAlignConstraint
`factor` : | the alignment factor, between 0.0 and 1.0

Since 1.4

### clutter_align_constraint_get_factor ()

    gfloat              clutter_align_constraint_get_factor (ClutterAlignConstraint *align);

Retrieves the factor set using `clutter_align_constraint_set_factor()`

`align` : | a ClutterAlignConstraint
Returns : | the alignment factor

Since 1.4

## Property Details

### The `"align-axis"` property

      "align-axis"               ClutterAlignAxis      : Read / Write / Construct

The axis to be used to compute the alignment

Default value: CLUTTER_ALIGN_X_AXIS

Since 1.4

### The `"factor"` property

      "factor"                   gfloat                : Read / Write / Construct

The alignment factor, as a normalized value between 0.0 and 1.0

The factor depends on the "align-axis" property: with an align-axis value of `CLUTTER_ALIGN_X_AXIS`, 0.0 means left and 1.0 means right; with a value of `CLUTTER_ALIGN_Y_AXIS`, 0.0 means top and 1.0 means bottom.

Allowed values: [0,1]

Default value: 0

Since 1.4

### The `"source"` property

      "source"                   ClutterActor*         : Read / Write / Construct

The ClutterActor used as the source for the alignment.

The ClutterActor must not be a child or a grandchild of the actor using the constraint.

Since 1.4