Fork me on GitHub
View source

package haxepunk.tweens.motion

class LinearPath


extends Motion

Determines linear motion along a set of points.

Constructor

View source

new (type : TweenType) : Void

Variables

read only distance : Float

The full length of the path.

read only pointCount : Float

How many points are on the path.

Functions

View source

addPoint (x : Float = 0, y : Float = 0) : Void

Adds the point to the path.


Parameters:
x   

X position.

y   

Y position.

View source

getPoint (index : Int = 0) : Vector2

Gets a point on the path.


Parameters:
index   

Index of the point.


Returns:

The Point object.

View source

setMotion (duration : Float, ease : EaseFunction) : Void

Starts moving along the path.


Parameters:
duration   

Duration of the movement.

ease   

Optional easer function.

View source

setMotionSpeed (speed : Float, ease : EaseFunction) : Void

Starts moving along the path at the speed.


Parameters:
speed   

Speed of the movement.

ease   

Optional easer function.