Phaser API Documentation

  Version: 

Member of: Phaser.Geom.Polygon

<static> GetNumberArray(polygon, [output])

Description:

Stores all of the points of a Polygon into a flat array of numbers following the sequence [ x,y, x,y, x,y ], i.e. each point of the Polygon, in the order it's defined, corresponds to two elements of the resultant array for the point's X and Y coordinate.

Parameters:

name type arguments description
polygon Phaser.Geom.Polygon

The Polygon whose points to export.

output array | Array.<number> <optional>

An array to which the points' coordinates should be appended.

Returns:
Description:

The modified output array, or a new array if none was given.

Type:
  • array
  • Array.
Examples:
Since: 3.0.0