Clutter.Behaviour

g Clutter.Behaviour Clutter.Behaviour Clutter.Scriptable Clutter.Scriptable Clutter.Scriptable->Clutter.Behaviour GObject.GInterface GObject.GInterface GObject.GInterface->Clutter.Scriptable GObject.Object GObject.Object GObject.Object->Clutter.Behaviour

Subclasses:

Clutter.BehaviourDepth, Clutter.BehaviourEllipse, Clutter.BehaviourOpacity, Clutter.BehaviourPath, Clutter.BehaviourRotate, Clutter.BehaviourScale

Methods

Inherited:

GObject.Object (37), Clutter.Scriptable (4)

Structs:

GObject.ObjectClass (5)

actors_foreach (func, *data)

apply (actor)

get_actors ()

get_alpha ()

get_n_actors ()

get_nth_actor (index_)

is_applied (actor)

remove (actor)

remove_all ()

set_alpha (alpha)

Virtual Methods

Inherited:

GObject.Object (7), Clutter.Scriptable (4)

do_alpha_notify (alpha_value)

do_applied (actor)

do_removed (actor)

Properties

Name

Type

Flags

Short Description

alpha

Clutter.Alpha

r/w

Alpha Object to drive the behaviour deprecated

Signals

Inherited:

GObject.Object (1)

Name

Short Description

applied

The ::apply signal is emitted each time the behaviour is applied to an actor. deprecated

removed

The ::removed signal is emitted each time a behaviour is not applied to an actor anymore. deprecated

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Clutter.Behaviour(**kwargs)
Bases:

GObject.Object, Clutter.Scriptable

Abstract:

Yes

Structure:

Clutter.BehaviourClass

Clutter.Behaviour-struct contains only private data and should be accessed with the functions below.

New in version 0.2.

Deprecated since version 1.6.

actors_foreach(func, *data)
Parameters:

Calls func for every actor driven by self.

New in version 0.2.

Deprecated since version 1.6.

apply(actor)
Parameters:

actor (Clutter.Actor) – a Clutter.Actor

Applies self to actor. This function adds a reference on the actor.

New in version 0.2.

Deprecated since version 1.6.

get_actors()
Returns:

a list of actors. You should free the returned list with g_slist_free() when finished using it.

Return type:

[Clutter.Actor]

Retrieves all the actors to which self applies. It is not recommended for derived classes to use this in there alpha notify method but use Clutter.Behaviour.actors_foreach as it avoids alot of needless allocations.

New in version 0.2.

Deprecated since version 1.6.

get_alpha()
Returns:

a Clutter.Alpha object, or None if no alpha object has been bound to this behaviour.

Return type:

Clutter.Alpha

Retrieves the Clutter.Alpha object bound to self.

New in version 0.2.

Deprecated since version 1.6.

get_n_actors()
Returns:

The number of applied actors

Return type:

int

Gets the number of actors this behaviour is applied too.

New in version 0.2.

Deprecated since version 1.6.

get_nth_actor(index_)
Parameters:

index (int) – the index of an actor this behaviour is applied too.

Returns:

A Clutter actor or None if index_ is invalid.

Return type:

Clutter.Actor

Gets an actor the behaviour was applied to referenced by index num.

New in version 0.2.

Deprecated since version 1.6.

is_applied(actor)
Parameters:

actor (Clutter.Actor) – a Clutter.Actor

Returns:

True if actor has behaviour. False otherwise.

Return type:

bool

Check if self applied to actor.

New in version 0.4.

Deprecated since version 1.6.

remove(actor)
Parameters:

actor (Clutter.Actor) – a Clutter.Actor

Removes actor from the list of Clutter.Actor s to which self applies. This function removes a reference on the actor.

New in version 0.2.

Deprecated since version 1.6.

remove_all()

Removes every actor from the list that self holds.

New in version 0.4.

Deprecated since version 1.6.

set_alpha(alpha)
Parameters:

alpha (Clutter.Alpha) – a Clutter.Alpha or None to unset a previously set alpha

Binds alpha to a Clutter.Behaviour. The Clutter.Alpha object is what makes a behaviour work: for each tick of the timeline used by Clutter.Alpha a new value of the alpha parameter is computed by the alpha function; the value should be used by the Clutter.Behaviour to update one or more properties of the actors to which the behaviour applies.

If alpha is not None, the Clutter.Behaviour will take ownership of the Clutter.Alpha instance.

New in version 0.2.

Deprecated since version 1.6.

do_alpha_notify(alpha_value) virtual
Parameters:

alpha_value (float) –

do_applied(actor) virtual
Parameters:

actor (Clutter.Actor) –

do_removed(actor) virtual
Parameters:

actor (Clutter.Actor) –

Signal Details

Clutter.Behaviour.signals.applied(behaviour, actor)
Signal Name:

applied

Flags:

RUN_FIRST

Parameters:

The ::apply signal is emitted each time the behaviour is applied to an actor.

New in version 0.4.

Deprecated since version 1.6.

Clutter.Behaviour.signals.removed(behaviour, actor)
Signal Name:

removed

Flags:

RUN_FIRST

Parameters:

The ::removed signal is emitted each time a behaviour is not applied to an actor anymore.

New in version 0.4.

Deprecated since version 1.6.

Property Details

Clutter.Behaviour.props.alpha
Name:

alpha

Type:

Clutter.Alpha

Default Value:

None

Flags:

READABLE, WRITABLE

The Clutter.Alpha object used to drive this behaviour. A Clutter.Alpha object binds a Clutter.Timeline and a function which computes a value (the “alpha”) depending on the time. Each time the alpha value changes the alpha-notify virtual function is called.

New in version 0.2.

Deprecated since version 1.6.