Rect Constructor

Syntax

PP.Rect(string || object)

Parameters

string. Text view of rectangle parameters. The string must contain the following properties separated by comma: x and y coordinates of the top left corner of the rectangle, width and height.

object. Object with class settings.

Description

The Rect constructor creates an instance of the Rect class.

Comments

As a parameter, it may take an object that contains class properties, for example:

// Create a rectangle
var rect =  new PP.Rect({
  Height: 10,
  Width: 10,
  Left: 10,
  Top: 10
});

Example

The example of constructor use is given in description of the Rect.addX method.

See also:

Rect