MotionGuidePlugin Class
A TweenJS plugin for working with motion guides.
To use, install the plugin after TweenJS has loaded. Next tween the 'guide' property with an object as detailed below.
createjs.MotionGuidePlugin.install();
Example
// Using a Motion Guide
createjs.Tween.get(target).to({guide:{ path:[0,0, 0,200,200,200, 200,0,0,0] }},7000);
// Visualizing the line
graphics.moveTo(0,0).curveTo(0,200,200,200).curveTo(200,0,0,0);
Each path needs pre-computation to ensure there's fast performance. Because of the pre-computation there's no built in support for path changes mid tween. These are the Guide Object's properties:
- path: Required, Array : The x/y points used to draw the path with a moveTo and 1 to n curveTo calls.
- start: Optional, 0-1 : Initial position, default 0 except for when continuing along the same path.
- end: Optional, 0-1 : Final position, default 1 if not specified.
- orient: Optional, string : "fixed"/"auto"/"cw"/"ccw"
- "fixed" forces the object to face down the path all movement (relative to start rotation),
- "auto" rotates the object along the path relative to the line.
- "cw"/"ccw" force clockwise or counter clockwise rotations including flash like behaviour
Constructor
MotionGuidePlugin
()
Item Index
Methods
- init static
- install static
- step static
- testRotData static
- tween static
Properties
- priority static
- temporary variable storage static
- temporary variable storage static
- temporary variable storage static
- temporary variable storage static
Methods
init
()
protected
static
install
()
static
Installs this plugin for use with TweenJS. Call this once after TweenJS is loaded to enable this plugin.