gillcup.animatedobject

[XXX]

class gillcup.animatedobject.AnimatedObject(timer=None)[source]

An objects whose attributes can be animated

Animated attribute must be instance (not class) attribute in order to work. Every animated attribute must be assigned a normal value before it can be animated. Usually this is done in the constructor.

Each AnimatedObject needs a timer to animate. This can be either through an argument to the animate method, or in an instance attribute. The constructor takes a timer value to set the instance attribute to.

animate(attribute, value, dt=0, timer=None, **options)[source]

Animate the given attribute

Calls self.apply(self.animation(...), dt=dt). Returns the resulting Action.

animation(attribute, value, **options)[source]

Return an animation Action for the given attribute.

When this Action is run, the given attribute will be gradually set to the new value. The style of the animation is given by options.

See gillcup.effect.animation() for what options are available.

apply(action, dt=0, timer=None)[source]

Schedule action on this object’s timer

dt is the time in which the Action is to be executed (measured from the timer’s current time). timer can be given to specify the timer to use; if None, self’s timer will be used

dynamicAttributeSetter(attribute, getter)[source]

Returns an Action to set an attribute getter

After the returned Action runs, the given getter function will be used to provide values for the given attribute.

setDynamicAttribute(attribute, getter, dt=0, timer=None)[source]

Set a getter for an attribute

If dt==0, sets getter as the attribute getter for the given attribute.

Otherwise, calls self.apply(self.dynamicAttributeSetter(attribute, getter), dt=dt).

Project Versions

Previous topic

gillcup.action

Next topic

gillcup.easing

This Page