diff --git a/src/curves/Curve.js b/src/curves/Curve.js index 36b8023b4..45697c14c 100644 --- a/src/curves/Curve.js +++ b/src/curves/Curve.js @@ -295,6 +295,8 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getPoints * @since 3.0.0 * + * @generic {Phaser.Math.Vector2[]} O - [out,$return] + * * @param {integer} divisions - The number of evenly spaced points from the curve to return. If falsy, step param will be used to calculate the number of points. * @param {number} step - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive. * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in. diff --git a/src/geom/ellipse/Ellipse.js b/src/geom/ellipse/Ellipse.js index 0bbd35184..80c23c114 100644 --- a/src/geom/ellipse/Ellipse.js +++ b/src/geom/ellipse/Ellipse.js @@ -135,11 +135,13 @@ var Ellipse = new Class({ * @method Phaser.Geom.Ellipse#getPoints * @since 3.0.0 * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. - * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * - * @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the circumference of the ellipse. + * @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the circumference of the ellipse. */ getPoints: function (quantity, stepRate, output) { diff --git a/src/geom/line/Line.js b/src/geom/line/Line.js index 09b3f87b1..e99817234 100644 --- a/src/geom/line/Line.js +++ b/src/geom/line/Line.js @@ -113,7 +113,7 @@ var Line = new Class({ * @method Phaser.Geom.Line#getPoints * @since 3.0.0 * - * @generic {Phaser.Geom.Point} O - [output,$return] + * @generic {Phaser.Geom.Point[]} O - [output,$return] * * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. * @param {integer} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. diff --git a/src/geom/polygon/Polygon.js b/src/geom/polygon/Polygon.js index 2d04e1d9f..4133d3892 100644 --- a/src/geom/polygon/Polygon.js +++ b/src/geom/polygon/Polygon.js @@ -211,11 +211,13 @@ var Polygon = new Class({ * @method Phaser.Geom.Polygon#getPoints * @since 3.12.0 * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. - * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * - * @return {Phaser.Geom.Point[]} An array of Point objects pertaining to the points around the perimeter of the Polygon. + * @return {(array|Phaser.Geom.Point[])} An array of Point objects pertaining to the points around the perimeter of the Polygon. */ getPoints: function (quantity, step, output) { diff --git a/types/phaser.d.ts b/types/phaser.d.ts index 43b74e683..39a845498 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -5178,7 +5178,7 @@ declare namespace Phaser { * @param step Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive. * @param out An optional array to store the points in. */ - getPoints(divisions: integer, step: number, out?: any[] | Phaser.Math.Vector2[]): any[] | Phaser.Math.Vector2[]; + getPoints(divisions: integer, step: number, out?: O): O; /** * [description] @@ -38275,7 +38275,7 @@ declare namespace Phaser { * @param stepRate Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param output An array to insert the points in to. If not provided a new array will be created. */ - getPoints(quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + getPoints(quantity: integer, stepRate?: number, output?: O): O; /** * Returns a uniformly distributed random point from anywhere within the given Ellipse. @@ -38807,7 +38807,7 @@ declare namespace Phaser { * @param stepRate The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param output An optional array of Points, or point-like objects, to store the coordinates of the points on the line. */ - getPoints(quantity: integer, stepRate?: integer, output?: O): O; + getPoints(quantity: integer, stepRate?: integer, output?: O): O; /** * Get a random Point on the Line. @@ -39218,7 +39218,7 @@ declare namespace Phaser { * @param stepRate Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param output An array to insert the points in to. If not provided a new array will be created. */ - getPoints(quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + getPoints(quantity: integer, stepRate?: number, output?: O): O; /** * Reverses the order of the points of a Polygon.