API Documentation for: 0.7.1
Show:

Rectangle Class

Defined in: Rectangle:39
Module: EaselJS

Represents a rectangle as defined by the points (x, y) and (x+width, y+height).

Constructor

Rectangle

(
  • [x=0]
  • [y=0]
  • [width=0]
  • [height=0]
)

Defined in Rectangle:39

Parameters:

  • [x=0] Number optional

    X position.

  • [y=0] Number optional

    Y position.

  • [width=0] Number optional

    The width of the Rectangle.

  • [height=0] Number optional

    The height of the Rectangle.

Example:

 var rect = new createjs.Rectangle(0, 0, 100, 100);

Item Index

Properties

Methods

clone

() Rectangle

Defined in clone:115

Returns a clone of the Rectangle instance.

Returns:

Rectangle:

a clone of the Rectangle instance.

copy

(
  • rectangle
)
Rectangle

Defined in copy:105

Copies all properties from the specified rectangle to this rectangle.

Parameters:

  • rectangle Rectangle

    The rectangle to copy properties from.

Returns:

Rectangle:

This rectangle. Useful for chaining method calls.

initialize

(
  • [x=0]
  • [y=0]
  • [width=0]
  • [height=0]
)
Rectangle

Defined in initialize:87

Initialization method. Can also be used to reinitialize the instance.

Parameters:

  • [x=0] Number optional

    X position.

  • [y=0] Number optional

    Y position.

  • [width=0] Number optional

    The width of the Rectangle.

  • [height=0] Number optional

    The height of the Rectangle.

Returns:

Rectangle:

This instance. Useful for chaining method calls.

toString

() String

Defined in toString:124

Returns a string representation of this object.

Returns:

String:

a string representation of the instance.

Properties

height

Number

Defined in height:79

Height.

width

Number

Defined in width:72

Width.

x

Number

Defined in x:58

X position.

y

Number

Defined in y:65

Y position.