Easing Functions

ControllersAnimation Framework

Easing functions provides animation smoothing. Instead of linearly changing the value of the property specified in the animation, we can use about 30 functions(like elastic, bounce, sine etc).

How to use

We specify the easing function name by using "alpha_function" or "f" parameter in Animation. For Example

from pymt import *
widget = MTScatterWidget()
anim = Animation(duration=1, rotation=45, f="ease_in_out_back")
widget.do(anim)
runTouchApp(widget)

This example shows how we specified "ease_in_out_back" function to be used.

By default all animations use Linear function in PyMT

Types of Functions

There are around 30 easing functions that we where able to implement in our framework. (Thanks to clutter project: http://www.clutter-project.org/docs/clutter/stable/ClutterAlpha.html)

  • linear
  • ease_in_quad
  • ease_out_quad
  • ease_in_out_quad
  • ease_in_cubic
  • ease_out_cubic
  • ease_in_out_cubic
  • ease_in_quart
  • ease_out_quart
  • ease_in_out_quart
  • ease_in_quint
  • ease_out_quint
  • ease_in_out_quint
  • ease_in_sine
  • ease_out_sine
  • ease_in_out_sine
  • ease_in_expo
  • ease_out_expo
  • ease_in_out_expo
  • ease_in_circ
  • ease_out_circ
  • ease_in_out_circ
  • ease_in_elastic
  • ease_out_elastic
  • ease_in_out_elastic
  • ease_in_back
  • ease_out_back
  • ease_in_out_back
  • ease_in_bounce
  • ease_out_bounce
  • ease_in_out_bounce