Fork me on GitHub
View source

package haxepunk.tweens.motion

class LinearMotion


extends Motion

Determines motion along a line, from one point to another.

Constructor

View source

new (type : TweenType) : Void

Variables

read only distance : Float

Length of the current line of movement.

Functions

View source

setMotion (fromX : Float, fromY : Float, toX : Float, toY : Float, duration : Float, ease : EaseFunction) : Void

Starts moving along a line.


Parameters:
fromX   

X start.

fromY   

Y start.

toX   

X finish.

toY   

Y finish.

duration   

Duration of the movement.

ease   

Optional easer function.

View source

setMotionSpeed (fromX : Float, fromY : Float, toX : Float, toY : Float, speed : Float, ease : EaseFunction) : Void

Starts moving along a line at the speed.


Parameters:
fromX   

X start.

fromY   

Y start.

toX   

X finish.

toY   

Y finish.

speed   

Speed of the movement (units per second).

ease   

Optional easer function.