Fork me on GitHub

Base class for tweening helpers. A Tween is any object that interpolates something between two values. It does not have to be a linear path, for instance a circular motion.

Do not use this directly, instead use the classes in haxepunk.tweens.*

Constructor

View source

new (duration : Float, type : TweenType, complete : Void ->Void, , ease : EaseFunction) : Void

Constructor. Specify basic information about the Tween.


Parameters:
duration   

Duration of the tween (in seconds).

type   

Tween type, one of Tween.PERSIST (default), Tween.LOOPING, or Tween.ONESHOT.

complete   

Optional function which will bind to the onComplete signal.

ease   

Optional easer function to apply to the Tweened value.

Variables

active : Bool

If the tween is active.

forward : Bool

Whether tween is currently running forward. For TweenType.PingPong.

onComplete : Signal0

Signal fires when tween is completed

onStart : Signal0

Signal fires when tween starts

onUpdate : Signal0

Signal fires when tween updates

percent : Float

Progression of the tween, between 0 and 1.

read only scale : Float

Functions

View source

cancel () : Void

Immediately stops the Tween and removes it from its Tweener without calling the complete callback.

View source

start () : Void

Starts the Tween, or restarts it if it's currently running.