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
Copy file name to clipboardExpand all lines: src/geom/Circle.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -135,21 +135,21 @@ Phaser.Circle.prototype = {
135
135
/**
136
136
* Returns a new Circle object with the same values for the x, y, width, and height properties as this Circle object.
137
137
* @method Phaser.Circle#clone
138
-
* @param {Phaser.Circle} out - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
138
+
* @param {Phaser.Circle} output - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
139
139
* @return {Phaser.Circle} The cloned Circle object.
* Returns a new Ellipse object with the same values for the x, y, width, and height properties as this Ellipse object.
103
103
* @method Phaser.Ellipse#clone
104
-
* @param {Phaser.Ellipse} out - Optional Ellipse object. If given the values will be set into the object, otherwise a brand new Ellipse object will be created and returned.
104
+
* @param {Phaser.Ellipse} output - Optional Ellipse object. If given the values will be set into the object, otherwise a brand new Ellipse object will be created and returned.
105
105
* @return {Phaser.Ellipse} The cloned Ellipse object.
Copy file name to clipboardExpand all lines: src/geom/Line.js
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -182,6 +182,27 @@ Phaser.Line.prototype = {
182
182
183
183
returnresults;
184
184
185
+
},
186
+
187
+
/**
188
+
* Returns a new Line object with the same values for the start and end properties as this Line object.
189
+
* @method Phaser.Line#clone
190
+
* @param {Phaser.Line} output - Optional Line object. If given the values will be set into the object, otherwise a brand new Line object will be created and returned.
Copy file name to clipboardExpand all lines: src/geom/Polygon.js
+27-32Lines changed: 27 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -23,42 +23,20 @@ Phaser.Polygon = function (points) {
23
23
*/
24
24
this.type=Phaser.POLYGON;
25
25
26
-
//if points isn't an array, use arguments as the array
27
-
if(!(pointsinstanceofArray))
28
-
{
29
-
points=Array.prototype.slice.call(arguments);
30
-
}
31
-
32
-
//if this is a flat array of numbers, convert it to points
33
-
if(typeofpoints[0]==='number')
34
-
{
35
-
varp=[];
36
-
37
-
for(vari=0,len=points.length;i<len;i+=2)
38
-
{
39
-
p.push(newPhaser.Point(points[i],points[i+1]));
40
-
}
41
-
42
-
points=p;
43
-
}
44
-
45
-
/**
46
-
* @property {array<Phaser.Point>|array<number>} points - The array of vertex Points.
47
-
* @private
48
-
*/
49
-
this._points=points;
50
-
26
+
this.points=points;
51
27
};
52
28
53
29
Phaser.Polygon.prototype={
54
30
55
31
/**
56
-
* Creates a clone of this polygon.
57
-
*
58
-
* @method Phaser.Polygon#clone
59
-
* @return {Phaser.Polygon} A copy of the polygon.
60
-
*/
61
-
clone: function(){
32
+
* Creates a copy of the given Polygon.
33
+
* This is a deep clone, the resulting copy contains new Phaser.Point objects
34
+
*
35
+
* @method Phaser.Polygon#clone
36
+
* @param {Phaser.Polygon} [output] Optional Polygon object. If given the values will be set into this object, otherwise a brand new Polygon object will be created and returned.
37
+
* @return {Phaser.Polygon} The new Polygon object.
0 commit comments