Behavior : Spline
Author:Rex.Rainbow
- Move Sprite along a spline path.
Download
Properties
Activated
- Enable if you wish this to begin at the start of the layout.
Speed
- Speed, in pixel per second.
Set angle
- Set the object's angle to the angle of motion.
Looping
- Enable to connect last point to start point.
Tension
Actions
Enable
Action:Set enabled
- Set whether this behavior is enabled. It will also pause current moving.
- State ( Combo ) : Set whether to enable or disable the behavior.
- Options : ["Disabled","Enabled"]
Action:Enable set angle
- Enable or disable "Set angle property".
- State ( Combo ) : Set whether to enable or disable the behavior.
- Options : ["Disabled","Enabled"]
Action:Set looping
- Enable or disable looping.
- Enable ( Combo ) : Enable to connect last point to start point.
Move
Action:Start
Action:Stop
Path
Action:Add point
- Add a point on the spline path to go through.
- X ( number ) : The X co-ordinate of this point.
- Y ( number ) : The Y co-ordinate of this point.
Action:Reset position
- Reset position of point. Can not reset current moving segment.
- Index ( number ) : Index of point.
- X ( number ) : The X co-ordinate of this point.
- Y ( number ) : The Y co-ordinate of this point.
Action:Clean all points
- Clean all points. It will stop current moving.
Speed
Action:Set speed
- Set the object's speed.
- Speed ( number ) : Speed, in pixel per second.
Tension
Action:Set tension
- Set tension of curve.
- Tension ( number ) : Tension of curve.
Expressions
Angle
Expression:AngleOfMotion
Current segment
Expression:CurSegP0
- Get start point index of current segment. Add 2nd parameter "x" or "y" or 0 or 1 to get x/y of a point.
Expression:CurSegP1
- Get end point index of current segment Add 2nd parameter "x" or "y" or 0 or 1 to get x/y of a point.
Distance
Expression:TraveledDistance
- Traveled distance, in pixels.
Point
Expression:Point
- Get points or a point or x/y of a point. Add 1st parameter for index of point, add 2nd parameter "x" or "y" or 0 or 1 to get x/y of a point.
Expression:PointsCount
Speed
Expression:Speed
- The current object speed, in pixels per second.
Tension
Expression:Tension
Conditions
Condition:Is moving
Reach
Condition:On reach last point
- Triggered when reach last point.
Condition:On reach any point
- Triggered when reach any point.