File anim/anim.lua
Functions
anim:finish () | Finishes the animation instance, going instantly to the finish value. |
anim:new (anim_table) | Create a new animation instance. |
anim:pause () | Pause the animation instance. |
anim:play () | Plays or resumes the animation instance. |
anim:reverse () | Reverse the animation instance. |
anim:update (dt) | Updates all animations, use inside love.update(). |
Tables
anim_table | An animation table |
styles | List of animation styles you can use. |
Examples
example1 | Example |
Functions
- anim:finish ()
-
Finishes the animation instance, going instantly to the finish value.
- anim:new (anim_table)
-
Create a new animation instance.
Parameters
- anim_table: A table of animation paremeters.
Usage:
new_animation = anim:new{
table = myTable,
key = 'x_position',
start = 12,
finish = 120,
time = 4,
style = 'linear'
}
Return value:
table: An animation instance you can call anim methods on.
See also:
- anim:pause ()
-
Pause the animation instance.
- anim:play ()
-
Plays or resumes the animation instance.
Usage:
new_anim = anim:new{}
new_anim:play()
- anim:reverse ()
-
Reverse the animation instance.
Reverses the animation, going from finish to start. - anim:update (dt)
-
Updates all animations, use inside love.update().
Parameters
- dt: delta time
Tables
- anim_table
- An animation table
Fields
- table The table to pass to the anim object
- key The key to animate. (table[key] will be animated).
- start The value the animation starts at. (if nil current table[key] value will be used).
- finish The value the animation finishes at. (if nil current table[key] value will be used).
- time The time it takes for the animation to complete. (in seconds, default 1).
- delay The time it takes for the animation to start after calling anim:play(). (in seconds, default 0).
- style The style of the animation. (a string, default 'linear'). See style.
- styles
- List of animation styles you can use.
Fields
- linear
- quartIn
- quartOut
- quartInOut
- quadIn
- quadOut
- quadInOut
- expoIn
- expoOut
- expoInOut
- elastic