Difference between revisions of "UI.Animation"

From GiderosMobile
(Created page with "__NOTOC__ === Description === Animates any given UI. <syntaxhighlight lang="lua"> UI.Animation:animate(widget,channel,animation,duration,parameters) </syntaxhighlight> === P...")
 
Line 6: Line 6:
 
UI.Animation:animate(widget,channel,animation,duration,parameters)
 
UI.Animation:animate(widget,channel,animation,duration,parameters)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
''animation'' can be any of the following:
 +
* UI.Animation.AnchorMove, params: x, y
 +
* UI.Animation.Alpha
 +
* UI.Animation.AnchorScale
 +
 +
''parameters'' can be any of the following:
 +
* onStop: a function to call when animation has finished
 +
* easing: with a ''type'' and a ''way''
 +
** '''type''': linear, quad, cubic, quart, quint, expo, sine, circ, back, steps, elastic, bounce, slowmo
 +
** '''way''': out, inout, outin
  
 
=== Parameters ===
 
=== Parameters ===
Line 12: Line 23:
 
'''animation''': (class) one of the available animation<br/>
 
'''animation''': (class) one of the available animation<br/>
 
'''duration''': (number) the animation duration<br/>
 
'''duration''': (number) the animation duration<br/>
'''parameters''': (table) additional animation parameters<br/>
+
'''parameters''': (table) additional animation parameters '''optional'''<br/>
  
 
=== Examples ===
 
=== Examples ===

Revision as of 13:13, 13 October 2023


Description

Animates any given UI.

UI.Animation:animate(widget,channel,animation,duration,parameters)

animation can be any of the following:

  • UI.Animation.AnchorMove, params: x, y
  • UI.Animation.Alpha
  • UI.Animation.AnchorScale

parameters can be any of the following:

  • onStop: a function to call when animation has finished
  • easing: with a type and a way
    • type: linear, quad, cubic, quart, quint, expo, sine, circ, back, steps, elastic, bounce, slowmo
    • way: out, inout, outin

Parameters

widget: (sprite) the widget to animate
channel: (string) the animation channel
animation: (class) one of the available animation
duration: (number) the animation duration
parameters: (table) additional animation parameters optional

Examples