Rectangle

Rect in svg defines a rectangle based on given coordinates and style attributes. SvgDreams library has a class for defining a rectangle.
$rectObj = new Rect("Rect_1");
   $rectObj->setCoordinates(20, 20);
   $rectObj->setSize(100, 100);
   $rectObj->fill = "#3b5998";
Sample rectangle with animation. It's color fades out with AnimateColor animation:

Methods

public function setCoordinates($x, $y)
Sets the coordinate of the SVG shape. Equal to setting $this->x and $this->y values.
Parameters:
$x, $y: x and y coordinates of the element.
public function setSize($width, $height)
Sets the sizes of the SVG shape. Equal to setting $this->width and $this->height values.
Parameters:
$width and $height of the element
function __construct($itemId)
Parameters:
Constructor of Rect class needs an id for the rectangle element. We suggest you to define a unique ID.

All rights reserved. See license