#

API Docs for: 1.6.0
Show: Inherited Protected Private Deprecated

# Rectangle Class

Defined in: `src/pixi/core/Rectangle.js:5`
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`

)

Defined in `src/pixi/core/Rectangle.js:5`

#### Parameters:

- `x` Number

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

- `y` Number

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

- `width` Number

  The overall width of this rectangle

- `height` Number

  The overall height of this rectangle

- Index
- Methods
- Properties

## Item Index

### Methods

- clone
- contains

### Properties

- height
- width
- x
- y

## Methods

### `clone`

() Rectangle

Defined in `src/pixi/core/Rectangle.js:46`

Creates a clone of this Rectangle

#### Returns:

Rectangle:

a copy of the rectangle

### `contains`

(

- `x`
- `y`

)
Boolean

Defined in `src/pixi/core/Rectangle.js:57`

Checks whether the x and y coordinates passed to this function 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 coords are within this Rectangle

## Properties

### `height`

Number

Defined in `src/pixi/core/Rectangle.js:38`

Default: 0

### `width`

Number

Defined in `src/pixi/core/Rectangle.js:31`

Default: 0

### `x`

Number

Defined in `src/pixi/core/Rectangle.js:17`

Default: 0

### `y`

Number

Defined in `src/pixi/core/Rectangle.js:24`

Default: 0