Class: Rectangle

PIXI. Rectangle

new Rectangle(x, y, width, height)

the Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

Parameters:
Name Type Description
x Number

The X coordinate of the upper-left corner of the rectangle

y Number

The Y coordinate of the upper-left corner of the rectangle

width Number

The overall width of this rectangle

height Number

The overall height of this rectangle

Source - pixi/geom/Rectangle.js, line 5

Members

height :Number

Default Value:
  • 0
Source - pixi/geom/Rectangle.js, line 38

width :Number

Default Value:
  • 0
Source - pixi/geom/Rectangle.js, line 31

x :Number

Default Value:
  • 0
Source - pixi/geom/Rectangle.js, line 17

y :Number

Default Value:
  • 0
Source - pixi/geom/Rectangle.js, line 24

Methods

clone() → {PIXI.Rectangle}

Creates a clone of this Rectangle

Returns:

a copy of the rectangle

Source - pixi/geom/Rectangle.js, line 46

contains(x, y) → {Boolean}

Checks whether the x and y coordinates given are contained within this Rectangle

Parameters:
Name Type Description
x Number

The X coordinate of the point to test

y Number

The Y coordinate of the point to test

Returns:
Boolean -

Whether the x/y coordinates are within this Rectangle

Source - pixi/geom/Rectangle.js, line 57
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Sat Nov 15 2014 19:55:20 GMT-0000 (GMT) using the DocStrap template.