AnimateMotion

AnimateMotion causes the target element to move along the given path.
$animateMotionObj = new AnimateMotion();
   $animateMotionObj->setInfiniteLoop();
   $animateMotionObj->duration = "100s";
   $animateMotionObj->moveTo(250, 50);
   $animateMotionObj->curveTo($start, $middle, $end);
In the following example, many circles move in given curves.

Methods

public function moveTo($x, $y)
Moves an element to the given x,y position.
Adds M $x, $y to the path of the animation.
Parameters:
$x and $y are the coordinates to move.
public function lineTo($x, $y)
Moves in a line to $x and $y coordinates.
Adds L $x, $y to the path of the animation.
Parameters:
$x and $y are the coordinates to move.
public function curveTo($startPoints, $middlePoints, $endPoints)
Curves an element by given points.
Adds C to the path with given directions.
Parameters:
$startPoints, $middlePoints and $endPoints are the points of the curve animation.

Another Example

All rights reserved. See license