#

API Docs for: 1.6.0
Show: Inherited Protected Private Deprecated

# Polygon Class

Defined in: `src/pixi/core/Polygon.js:5`
Module: PIXI

## Constructor

### `Polygon`

(

- `points`

)

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

#### Parameters:

- `points` Array<Point> | Array<Number> | Point... | Number... multiple

  This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.

- Index
- Methods

## Item Index

### Methods

- clone
- contains

## Methods

### `clone`

() Polygon

Defined in `src/pixi/core/Polygon.js:35`

Creates a clone of this polygon

#### Returns:

Polygon:

a copy of the polygon

### `contains`

(

- `x`
- `y`

)
Boolean

Defined in `src/pixi/core/Polygon.js:51`

Checks whether the x and y coordinates passed to this function are contained within this polygon

#### 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 polygon