Once installed, you can animate an object along a defined path using the guide property within a .to() call. The path is defined as an array of coordinates used for moveTo and curveTo calls (quadratic bezier curves).
Guide Object Properties:
path (Required, Array): The x/y points used to draw the path. The array must follow the pattern [x0, y0, cx1, cy1, x1, y1, cx2, cy2, x2, y2, ...] where cx/cy are control points.start (Optional, 0-1): Initial position along the path (default is 0).end (Optional, 0-1): Final position along the path (default is 1).orient (Optional, string): Controls how the object rotates along the path:"fixed": Forces the object to face down the path for all movement (relative to start rotation)."auto": Rotates the object along the path relative to the line."cw": Forces clockwise rotation (Adobe Flash/Animate-like behavior)."ccw": Forces counter-clockwise rotation.
Important: Do not share guide objects between different tweens, even if the properties are identical, as the library stores internal state on these objects.
// Using a Motion Guide
createjs.Tween.get(target).to({guide:{ path:[0,0, 0,200,200,200, 200,0,0,0] }},7000);