Skip to content

Commit 4c77f26

Browse files
committed
Added JSDocs
1 parent db07e42 commit 4c77f26

5 files changed

Lines changed: 31 additions & 33 deletions

File tree

src/curves/Curve.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -489,17 +489,16 @@ var Curve = new Class({
489489
return this.getTangent(t, out);
490490
},
491491

492-
// Given a distance in pixels, get a t to find p.
493492
/**
494-
* [description]
493+
* Given a distance in pixels, get a t to find p.
495494
*
496495
* @method Phaser.Curves.Curve#getTFromDistance
497496
* @since 3.0.0
498497
*
499-
* @param {integer} distance - [description]
500-
* @param {integer} [divisions] - [description]
498+
* @param {integer} distance - The distance, in pixels.
499+
* @param {integer} [divisions] - Optional amount of divisions.
501500
*
502-
* @return {number} [description]
501+
* @return {number} The distance.
503502
*/
504503
getTFromDistance: function (distance, divisions)
505504
{
@@ -511,19 +510,17 @@ var Curve = new Class({
511510
return this.getUtoTmapping(0, distance, divisions);
512511
},
513512

514-
// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant
515-
516513
/**
517-
* [description]
514+
* Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant.
518515
*
519516
* @method Phaser.Curves.Curve#getUtoTmapping
520517
* @since 3.0.0
521518
*
522-
* @param {number} u - [description]
523-
* @param {integer} distance - [description]
524-
* @param {integer} [divisions] - [description]
519+
* @param {number} u - A float between 0 and 1.
520+
* @param {integer} distance - The distance, in pixels.
521+
* @param {integer} [divisions] - Optional amount of divisions.
525522
*
526-
* @return {number} [description]
523+
* @return {number} The equidistant value.
527524
*/
528525
getUtoTmapping: function (u, distance, divisions)
529526
{

src/curves/EllipseCurve.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ var EllipseCurve = new Class({
160160
},
161161

162162
/**
163-
* [description]
163+
* Get the resolution of the curve.
164164
*
165165
* @method Phaser.Curves.Ellipse#getResolution
166166
* @since 3.0.0
167167
*
168-
* @param {number} divisions - [description]
168+
* @param {number} divisions - Optional divisions value.
169169
*
170-
* @return {number} [description]
170+
* @return {number} The curve resolution.
171171
*/
172172
getResolution: function (divisions)
173173
{

src/curves/LineCurve.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,19 +194,17 @@ var LineCurve = new Class({
194194
return tangent.normalize();
195195
},
196196

197-
// Override default Curve.getUtoTmapping
198-
199197
/**
200-
* [description]
198+
* Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant.
201199
*
202200
* @method Phaser.Curves.Line#getUtoTmapping
203201
* @since 3.0.0
204202
*
205-
* @param {number} u - [description]
206-
* @param {integer} distance - [description]
207-
* @param {integer} [divisions] - [description]
203+
* @param {number} u - A float between 0 and 1.
204+
* @param {integer} distance - The distance, in pixels.
205+
* @param {integer} [divisions] - Optional amount of divisions.
208206
*
209-
* @return {number} [description]
207+
* @return {number} The equidistant value.
210208
*/
211209
getUtoTmapping: function (u, distance, divisions)
212210
{

src/curves/QuadraticBezierCurve.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var Vector2 = require('../math/Vector2');
1111

1212
/**
1313
* @classdesc
14-
* [description]
14+
* A quadratic Bézier curve constructed from two control points.
1515
*
1616
* @class QuadraticBezier
1717
* @extends Phaser.Curves.Curve
@@ -41,7 +41,7 @@ var QuadraticBezier = new Class({
4141
}
4242

4343
/**
44-
* [description]
44+
* The start point.
4545
*
4646
* @name Phaser.Curves.QuadraticBezier#p0
4747
* @type {Phaser.Math.Vector2}
@@ -50,7 +50,7 @@ var QuadraticBezier = new Class({
5050
this.p0 = p0;
5151

5252
/**
53-
* [description]
53+
* The first control point.
5454
*
5555
* @name Phaser.Curves.QuadraticBezier#p1
5656
* @type {Phaser.Math.Vector2}
@@ -59,7 +59,7 @@ var QuadraticBezier = new Class({
5959
this.p1 = p1;
6060

6161
/**
62-
* [description]
62+
* The second control point.
6363
*
6464
* @name Phaser.Curves.QuadraticBezier#p2
6565
* @type {Phaser.Math.Vector2}
@@ -88,14 +88,14 @@ var QuadraticBezier = new Class({
8888
},
8989

9090
/**
91-
* [description]
91+
* Get the resolution of the curve.
9292
*
9393
* @method Phaser.Curves.QuadraticBezier#getResolution
9494
* @since 3.2.0
9595
*
96-
* @param {number} divisions - [description]
96+
* @param {number} divisions - Optional divisions value.
9797
*
98-
* @return {number} [description]
98+
* @return {number} The curve resolution.
9999
*/
100100
getResolution: function (divisions)
101101
{
@@ -130,7 +130,10 @@ var QuadraticBezier = new Class({
130130
},
131131

132132
/**
133-
* [description]
133+
* Draws this curve on the given Graphics object.
134+
*
135+
* The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is.
136+
* The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it.
134137
*
135138
* @method Phaser.Curves.QuadraticBezier#draw
136139
* @since 3.2.0

src/curves/SplineCurve.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ var SplineCurve = new Class({
128128
},
129129

130130
/**
131-
* [description]
131+
* Get the resolution of the curve.
132132
*
133133
* @method Phaser.Curves.Spline#getResolution
134134
* @since 3.0.0
135135
*
136-
* @param {number} divisions - [description]
136+
* @param {number} divisions - Optional divisions value.
137137
*
138-
* @return {number} [description]
138+
* @return {number} The curve resolution.
139139
*/
140140
getResolution: function (divisions)
141141
{

0 commit comments

Comments
 (0)