A class to define a shape via user defined coordinates.

Memberof

PIXI

Constructors

Properties

Methods

Constructors

  • Parameters

    Returns Polygon

  • Parameters

    Returns Polygon

Properties

closeStroke: boolean

false after moveTo, true after closePath. In all other cases it is true.

points: number[]

An array of the points of this polygon.

type: POLY

The type of the object, mainly used to avoid instanceof checks

Default

PIXI.SHAPES.POLY

See

PIXI.SHAPES

Methods

  • Creates a clone of this polygon.

    Returns Polygon

    • A copy of the polygon.
  • 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.

Generated using TypeDoc