mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +00:00
improve typings: getPoints functions
This commit is contained in:
parent
265bfc76fb
commit
9bb02d57ef
5 changed files with 15 additions and 9 deletions
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
8
types/phaser.d.ts
vendored
8
types/phaser.d.ts
vendored
|
@ -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<O extends Phaser.Math.Vector2[]>(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<O extends Phaser.Geom.Point[]>(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<O extends Phaser.Geom.Point>(quantity: integer, stepRate?: integer, output?: O): O;
|
||||
getPoints<O extends Phaser.Geom.Point[]>(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<O extends Phaser.Geom.Point[]>(quantity: integer, stepRate?: number, output?: O): O;
|
||||
|
||||
/**
|
||||
* Reverses the order of the points of a Polygon.
|
||||
|
|
Loading…
Reference in a new issue