These classes are intended to be used on a Widget. If you want to add animations to your application, you need to follow two steps:
- First, setup the animation object
- Then, use the animation on one or multiple widgets
You can animate multiple properties at the same time, with custom transition function. Here is an example to animate the widget on a custom position and size, using ‘in_quad’ transition
widget = Widget()
animation = Animation(x=50, size=(80, 80), t='in_quad')
animation.start(widget)
Multiple animation can be added. The result will be animated in sequential
widget = Widget()
animation = Animation(x=50) + Animation(size=(80, 80))
animation.start(widget)
You can join one or multiple animation in parallel. This can be used when you want to use differents settings for each properties
widget = Widget()
animation = Animation(pos=(80, 10))
animation &= Animation(size=(800, 800), duration=2.)
Bases: kivy.event.EventDispatcher
Create an animation definition, that can be used to animate a widget
Parameters : |
|
---|---|
Events : |
|
Return the duration of the animation
Return the properties used to animate
Start the animation on a widget
Stop the animation previously applied on a widget
Stop all animations that concern a specific widget / list of properties.
Example
widget = Widget()
animation = Animation(x=50)
animation.start(widget)
# and later
Animation.stop_all(widget, 'x')
Even if a animation is going, remove a property for beeing animated.
Return the transition of the animation
Bases: object
Collection of animation function, to be used with Animation object. Easing Functions ported into Kivy from Clutter Project http://www.clutter-project.org/docs/clutter/stable/ClutterAlpha.html