Fork me on GitHub
View source

package com.haxepunk.tweens.motion

class LinearMotion


extends Motion

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

Constructor

View source

new (complete : Dynamic ->Void, , type : TweenType) : Void

Constructor.


Parameters:
complete   

Optional completion callback.

type   

Tween type.

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 : Float ->Float, ) : 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 : Float ->Float, ) : 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.

ease   

Optional easer function.