Chapter 7. Behaviours

Table of Contents

Using Behaviours

The Animation API is simple but you will often need more control, while still avoiding the complication of using clutter.Timeline directly.

Although the clutter.Timeline's new-frame signal allows you to set actor properties for each frame, PyClutter also provides Behaviours which can change specific properties of one specific actor over time, using a simple numeric calculation. However, unlike the simplified Animation API, using behaviours directly allows you to combine them to control multiple actors simultaneously and allows you to change the parameters of the behaviours while the timeline is running.

For instance, clutter.BehaviourPath moves the actor along a specified path, calculating the position on the path once per frame by calling a supplied alpha callback. See the Using Alpha Functions section in the Animation chapter.

Figure 7.1. Effects of alpha functions on a path.

Effects of alpha functions on a path.

clutter.Behaviour Reference

clutter.Alpha Reference

The following standard behaviours are available in PyClutter: