API Docs for: 2.0.0
Show:

Rectangle Class

Module: PIXI

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.

Constructor

Rectangle

(
  • x
  • y
  • width
  • height
)

Parameters:

  • 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

Item Index

Methods

Properties

Methods

clone

() Rectangle

Creates a clone of this Rectangle

Returns:

Rectangle:

a copy of the rectangle

contains

(
  • x
  • y
)
Boolean

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

Parameters:

  • 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

Properties

height

Number

Default: 0

width

Number

Default: 0

x

Number

Default: 0

y

Number

Default: 0