documentation indexreference manualfunction index

Transform

Function: Transform (child=None, function=None, **properties):

A transform applies rotation, zooming, and alpha-blending to its child, in that order. These operations, along with positioning of the transformed object, are controlled by fields on the Transform object. Transform objects can be composed with minimal overhead.

Parameters. A transform takes these parameters:

child is the child of the Transform. This can be left None, in which case the Transform will act as a Position and Motion function.

function is a callback function that is called before the Transform is rendered, with the Transform object, the shown timebase, and the animation timebase. It can set any of the fields described below, to cause the Transform to alter how it is displayed. It is expected to return a floating-point number giving the amount of time before the Transform should be re-rendered, in seconds. If 0 is returned, the Transform will be re-rendered on the next frame.

Fields. The ATL transform properties are available as fields on a Transform object.

Additional fields are:

Methods. A transform has the following method:

Method: update ():

The update method should be called on a transform after one or more fields have been changed outside of the callback function of that Transform.

Method: set_child (d):

Sets the child of this Transform to d.

init python:
    def move_rotate_zoom(d, st, at):
         d.xpos = st / 5.0
         d.zoom = 1.0 + st / 5.0
         d.alpha = max(0.0, 1.0 - st / 5.0)

         return 0

show logo base at Transform(function=move_rotate_zoom)

See Also


documentation indexreference manualfunction index