You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Returns a randomly chosen point anywhere on the path. This follows the same rules as `getPoint` in that it may return a point on any Curve inside this path.
129749
+
*
129750
+
* When calling this method multiple times, the points are not guaranteed to be equally spaced spatially.
129749
129751
*
129750
129752
* @method Phaser.Curves.Path#getRandomPoint
129751
129753
* @since 3.0.0
@@ -129754,7 +129756,7 @@ var Path = new Class({
129754
129756
*
129755
129757
* @param {Phaser.Math.Vector2} [out] - `Vector2` instance that should be used for storing the result. If `undefined` a new `Vector2` will be created.
129756
129758
*
129757
-
* @return {Phaser.Math.Vector2} [description]
129759
+
* @return {Phaser.Math.Vector2} The modified `out` object, or a new `Vector2` if none was provided.
129758
129760
*/
129759
129761
getRandomPoint: function (out)
129760
129762
{
@@ -129764,14 +129766,16 @@ var Path = new Class({
129764
129766
},
129765
129767
129766
129768
/**
129767
-
* Creates a straight Line Curve from the ending point of the Path to the given coordinates.
129769
+
* Divides this Path into a set of equally spaced points,
129770
+
*
129771
+
* The resulting points are equally spaced with respect to the points' position on the path, but not necessarily equally spaced spatially.
129768
129772
*
129769
129773
* @method Phaser.Curves.Path#getSpacedPoints
129770
129774
* @since 3.0.0
129771
129775
*
129772
-
* @param {integer} [divisions=40] - The X coordinate of the line's ending point, or the line's ending point as a `Vector2`.
129776
+
* @param {integer} [divisions=40] - The amount of points to divide this Path into.
129773
129777
*
129774
-
* @return {Phaser.Math.Vector2[]} [description]
129778
+
* @return {Phaser.Math.Vector2[]} A list of the points this path was subdivided into.
129775
129779
*/
129776
129780
getSpacedPoints: function (divisions)
129777
129781
{
@@ -129793,16 +129797,16 @@ var Path = new Class({
129793
129797
},
129794
129798
129795
129799
/**
129796
-
* [description]
129800
+
* Returns the starting point of the Path.
129797
129801
*
129798
129802
* @method Phaser.Curves.Path#getStartPoint
129799
129803
* @since 3.0.0
129800
129804
*
129801
129805
* @generic {Phaser.Math.Vector2} O - [out,$return]
* @param {Phaser.Math.Vector2[]} points - The points the newly created spline curve should consist of.
129850
129852
*
129851
-
* @return {Phaser.Curves.Path} [description]
129853
+
* @return {Phaser.Curves.Path} This Path object.
129852
129854
*/
129853
129855
splineTo: function (points)
129854
129856
{
@@ -129858,28 +129860,37 @@ var Path = new Class({
129858
129860
},
129859
129861
129860
129862
/**
129861
-
* [description]
129863
+
* Creates a "gap" in this path from the path's current end point to the given coordinates.
129864
+
*
129865
+
* After calling this function, this Path's end point will be equal to the given coordinates
129862
129866
*
129863
129867
* @method Phaser.Curves.Path#moveTo
129864
129868
* @since 3.0.0
129865
129869
*
129866
-
* @param {number} x - [description]
129867
-
* @param {number} y - [description]
129870
+
* @param {(number|Phaser.Math.Vector2)} x - The X coordinate of the position to move the path's end point to, or a `Vector2` containing the entire new end point.
129871
+
* @param {number} y - The Y coordinate of the position to move the path's end point to, if a number was passed as the X coordinate.
129868
129872
*
129869
-
* @return {Phaser.Curves.Path} [description]
129873
+
* @return {Phaser.Curves.Path} This Path object.
129870
129874
*/
129871
129875
moveTo: function (x, y)
129872
129876
{
129873
-
return this.add(new MovePathTo(x, y));
129877
+
if (x instanceof Vector2)
129878
+
{
129879
+
return this.add(new MovePathTo(x.x, x.y));
129880
+
}
129881
+
else
129882
+
{
129883
+
return this.add(new MovePathTo(x, y));
129884
+
}
129874
129885
},
129875
129886
129876
129887
/**
129877
-
* [description]
129888
+
* Converts this Path to a JSON object containing the path information and its consitutent curves.
0 commit comments