diff --git a/v3/src/curves/curve/Curve.js b/v3/src/curves/curve/Curve.js index 2cdba5203..9a61785be 100644 --- a/v3/src/curves/curve/Curve.js +++ b/v3/src/curves/curve/Curve.js @@ -9,22 +9,79 @@ var Curve = new Class({ initialize: + /** + * [description] + * + * @class Curve + * @memberOf Phaser.Curves + * @constructor + * @since 3.0.0 + * + * @param {string} type - [description] + */ function Curve (type) { - // String based identifier + /** + * String based identifier + * + * @property {string} type + */ this.type = type; + /** + * [description] + * + * @property {integer} defaultDivisions + * @default 5 + */ this.defaultDivisions = 5; + /** + * [description] + * + * @property {integer} arcLengthDivisions + * @default 100 + */ this.arcLengthDivisions = 100; + /** + * [description] + * + * @property {array} cacheArcLengths + * @default [] + */ this.cacheArcLengths = []; + /** + * [description] + * + * @property {boolean} needsUpdate + * @default true + */ this.needsUpdate = true; + /** + * [description] + * + * @property {boolean} active + * @default true + */ this.active = true; + /** + * [description] + * + * @property {Phaser.Math.Vector2} _tmpVec2A + * @private + */ this._tmpVec2A = new Vector2(); + + /** + * [description] + * + * @property {Phaser.Math.Vector2} _tmpVec2B + * @private + */ this._tmpVec2B = new Vector2(); }, diff --git a/v3/src/curves/curve/inc/Draw.js b/v3/src/curves/curve/inc/Draw.js index 501bcf3c0..333a47f2e 100644 --- a/v3/src/curves/curve/inc/Draw.js +++ b/v3/src/curves/curve/inc/Draw.js @@ -1,3 +1,14 @@ +/** + * [description] + * + * @method Phaser.Curves.Curve#draw + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphics - [description] + * @param {integer} [pointsTotal=32] - [description] + * + * @return {Phaser.GameObjects.Graphics} [description] + */ var Draw = function (graphics, pointsTotal) { if (pointsTotal === undefined) { pointsTotal = 32; } diff --git a/v3/src/curves/curve/inc/GetBounds.js b/v3/src/curves/curve/inc/GetBounds.js index d51ccd9a5..5ea8b1ab8 100644 --- a/v3/src/curves/curve/inc/GetBounds.js +++ b/v3/src/curves/curve/inc/GetBounds.js @@ -1,6 +1,17 @@ var FromPoints = require('../../../geom/rectangle/FromPoints'); var Rectangle = require('../../../geom/rectangle/Rectangle'); +/** + * [description] + * + * @method Phaser.Curves.Curve#getBounds + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} out - [description] + * @param {integer} [accuracy=16] - [description] + * + * @return {Phaser.Geom.Rectangle} [description] + */ var GetBounds = function (out, accuracy) { if (out === undefined) { out = new Rectangle(); } diff --git a/v3/src/curves/curve/inc/GetDistancePoints.js b/v3/src/curves/curve/inc/GetDistancePoints.js index 630dec200..801e50bce 100644 --- a/v3/src/curves/curve/inc/GetDistancePoints.js +++ b/v3/src/curves/curve/inc/GetDistancePoints.js @@ -1,4 +1,15 @@ // Return an array of points, spaced out X distance pixels apart + +/** + * [description] + * + * @method Phaser.Curves.Curve#getDistancePoints + * @since 3.0.0 + * + * @param {integer} distance - [description] + * + * @return {Phaser.Geom.Point[]} [description] + */ var GetDistancePoints = function (distance) { var len = this.getLength(); @@ -6,13 +17,6 @@ var GetDistancePoints = function (distance) var spaced = Math.max(1, len / distance); return this.getSpacedPoints(spaced); - - // Get the t value for 200 pixels along the curve - // var t = curve.getTFromDistance(200); - // = this.getUtoTmapping(0, distance, divisions) - - // Get the point at t - // var p = curve.getPoint(t); }; module.exports = GetDistancePoints; diff --git a/v3/src/curves/curve/inc/GetEndPoint.js b/v3/src/curves/curve/inc/GetEndPoint.js index 96d802d9d..1a665093a 100644 --- a/v3/src/curves/curve/inc/GetEndPoint.js +++ b/v3/src/curves/curve/inc/GetEndPoint.js @@ -1,5 +1,15 @@ var Vector2 = require('../../../math/Vector2'); +/** + * [description] + * + * @method Phaser.Curves.Curve#getEndPoint + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} out - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ var GetEndPoint = function (out) { if (out === undefined) { out = new Vector2(); } diff --git a/v3/src/curves/curve/inc/GetLength.js b/v3/src/curves/curve/inc/GetLength.js index 754f6d5a0..d006c0290 100644 --- a/v3/src/curves/curve/inc/GetLength.js +++ b/v3/src/curves/curve/inc/GetLength.js @@ -1,5 +1,13 @@ // Get total curve arc length +/** + * [description] + * + * @method Phaser.Curves.Curve#getLength + * @since 3.0.0 + * + * @return {number} [description] + */ var GetLength = function () { var lengths = this.getLengths(); diff --git a/v3/src/curves/curve/inc/GetLengths.js b/v3/src/curves/curve/inc/GetLengths.js index dcdaaa0ca..b348c7435 100644 --- a/v3/src/curves/curve/inc/GetLengths.js +++ b/v3/src/curves/curve/inc/GetLengths.js @@ -1,5 +1,15 @@ // Get list of cumulative segment lengths +/** + * [description] + * + * @method Phaser.Curves.Curve#getLengths + * @since 3.0.0 + * + * @param {integer} [divisions] - [description] + * + * @return {number[]} [description] + */ var GetLengths = function (divisions) { if (divisions === undefined) { divisions = this.arcLengthDivisions; } diff --git a/v3/src/curves/curve/inc/GetPointAt.js b/v3/src/curves/curve/inc/GetPointAt.js index 71ea2c6d4..67c1e8fa4 100644 --- a/v3/src/curves/curve/inc/GetPointAt.js +++ b/v3/src/curves/curve/inc/GetPointAt.js @@ -2,6 +2,17 @@ // - u [0 .. 1] +/** + * [description] + * + * @method Phaser.Curves.Curve#getPointAt + * @since 3.0.0 + * + * @param {float} u - [description] + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ var GetPointAt = function (u, out) { var t = this.getUtoTmapping(u); diff --git a/v3/src/curves/curve/inc/GetPoints.js b/v3/src/curves/curve/inc/GetPoints.js index 6e8ebcbc3..4c4307bf9 100644 --- a/v3/src/curves/curve/inc/GetPoints.js +++ b/v3/src/curves/curve/inc/GetPoints.js @@ -1,5 +1,15 @@ // Get sequence of points using getPoint( t ) +/** + * [description] + * + * @method Phaser.Curves.Curve#getPoints + * @since 3.0.0 + * + * @param {integer} [divisions] - [description] + * + * @return {Phaser.Math.Vector2[]} [description] + */ var GetPoints = function (divisions) { if (divisions === undefined) { divisions = this.defaultDivisions; } diff --git a/v3/src/curves/curve/inc/GetSpacedPoints.js b/v3/src/curves/curve/inc/GetSpacedPoints.js index 20ac57bea..7dd1f056f 100644 --- a/v3/src/curves/curve/inc/GetSpacedPoints.js +++ b/v3/src/curves/curve/inc/GetSpacedPoints.js @@ -1,5 +1,15 @@ // Get sequence of points using getPointAt( u ) +/** + * [description] + * + * @method Phaser.Curves.Curve#getSpacedPoints + * @since 3.0.0 + * + * @param {integer} [divisions] - [description] + * + * @return {Phaser.Math.Vector2[]} [description] + */ var GetSpacedPoints = function (divisions) { if (divisions === undefined) { divisions = this.defaultDivisions; } diff --git a/v3/src/curves/curve/inc/GetStartPoint.js b/v3/src/curves/curve/inc/GetStartPoint.js index 653db00e2..b678bb219 100644 --- a/v3/src/curves/curve/inc/GetStartPoint.js +++ b/v3/src/curves/curve/inc/GetStartPoint.js @@ -1,5 +1,15 @@ var Vector2 = require('../../../math/Vector2'); +/** + * [description] + * + * @method Phaser.Curves.Curve#getStartPoint + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ var GetStartPoint = function (out) { if (out === undefined) { out = new Vector2(); } diff --git a/v3/src/curves/curve/inc/GetTFromDistance.js b/v3/src/curves/curve/inc/GetTFromDistance.js index 942c0d776..f1fb1b2bd 100644 --- a/v3/src/curves/curve/inc/GetTFromDistance.js +++ b/v3/src/curves/curve/inc/GetTFromDistance.js @@ -1,4 +1,15 @@ // Given a distance in pixels, get a t to find p. +/** + * [description] + * + * @method Phaser.Curves.Curve#getTFromDistance + * @since 3.0.0 + * + * @param {integer} distance - [description] + * @param {integer} [divisions] - [description] + * + * @return {float} [description] + */ var GetTFromDistance = function (distance, divisions) { if (distance <= 0) diff --git a/v3/src/curves/curve/inc/GetTangent.js b/v3/src/curves/curve/inc/GetTangent.js index 66e5bab42..474c11c25 100644 --- a/v3/src/curves/curve/inc/GetTangent.js +++ b/v3/src/curves/curve/inc/GetTangent.js @@ -5,6 +5,17 @@ var Vector2 = require('../../../math/Vector2'); // 2 points a small delta apart will be used to find its gradient // which seems to give a reasonable approximation +/** + * [description] + * + * @method Phaser.Curves.Curve#getTangent + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ var GetTangent = function (t, out) { if (out === undefined) { out = new Vector2(); } diff --git a/v3/src/curves/curve/inc/GetTangentAt.js b/v3/src/curves/curve/inc/GetTangentAt.js index edae7626d..7791688d3 100644 --- a/v3/src/curves/curve/inc/GetTangentAt.js +++ b/v3/src/curves/curve/inc/GetTangentAt.js @@ -1,3 +1,14 @@ +/** + * [description] + * + * @method Phaser.Curves.Curve#getTangentAt + * @since 3.0.0 + * + * @param {float} u - [description] + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ var GetTangentAt = function (u, out) { var t = this.getUtoTmapping(u); diff --git a/v3/src/curves/curve/inc/GetUToTMapping.js b/v3/src/curves/curve/inc/GetUToTMapping.js index d08e092bc..72b9b7578 100644 --- a/v3/src/curves/curve/inc/GetUToTMapping.js +++ b/v3/src/curves/curve/inc/GetUToTMapping.js @@ -1,5 +1,17 @@ // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant +/** + * [description] + * + * @method Phaser.Curves.Curve#getUtoTmapping + * @since 3.0.0 + * + * @param {float} u - [description] + * @param {integer} distance - [description] + * @param {integer} [divisions] - [description] + * + * @return {number} [description] + */ var GetUtoTmapping = function (u, distance, divisions) { var arcLengths = this.getLengths(divisions); diff --git a/v3/src/curves/curve/inc/UpdateArcLengths.js b/v3/src/curves/curve/inc/UpdateArcLengths.js index 7df91d048..684892053 100644 --- a/v3/src/curves/curve/inc/UpdateArcLengths.js +++ b/v3/src/curves/curve/inc/UpdateArcLengths.js @@ -1,3 +1,9 @@ +/** + * [description] + * + * @method Phaser.Curves.Curve#updateArcLengths + * @since 3.0.0 + */ var UpdateArcLengths = function () { this.needsUpdate = true; diff --git a/v3/src/curves/path/inc/Add.js b/v3/src/curves/path/inc/Add.js index 056e19880..49ada41ac 100644 --- a/v3/src/curves/path/inc/Add.js +++ b/v3/src/curves/path/inc/Add.js @@ -1,3 +1,13 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#add + * @since 3.0.0 + * + * @param {Phaser.Curves.Curve} curve - [description] + * + * @return {Phaser.Curves.Path} [description] + */ var Add = function (curve) { this.curves.push(curve); diff --git a/v3/src/curves/path/inc/CircleTo.js b/v3/src/curves/path/inc/CircleTo.js index 5ca524035..f81184c4b 100644 --- a/v3/src/curves/path/inc/CircleTo.js +++ b/v3/src/curves/path/inc/CircleTo.js @@ -1,3 +1,15 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#circleTo + * @since 3.0.0 + * + * @param {number} radius - [description] + * @param {boolean} [clockwise] - [description] + * @param {number} [rotation] - [description] + * + * @return {Phaser.Curves.Path} [description] + */ var CircleTo = function (radius, clockwise, rotation) { if (clockwise === undefined) { clockwise = false; } diff --git a/v3/src/curves/path/inc/ClosePath.js b/v3/src/curves/path/inc/ClosePath.js index 197dfb4cf..8c3d6ae31 100644 --- a/v3/src/curves/path/inc/ClosePath.js +++ b/v3/src/curves/path/inc/ClosePath.js @@ -1,5 +1,13 @@ var LineCurve = require('../../line/LineCurve'); +/** + * [description] + * + * @method Phaser.Curves.Path#closePath + * @since 3.0.0 + * + * @return {Phaser.Curves.Path} [description] + */ var ClosePath = function () { // Add a line curve if start and end of lines are not connected diff --git a/v3/src/curves/path/inc/CubicBezierTo.js b/v3/src/curves/path/inc/CubicBezierTo.js index 575fc770c..963f1ca32 100644 --- a/v3/src/curves/path/inc/CubicBezierTo.js +++ b/v3/src/curves/path/inc/CubicBezierTo.js @@ -3,6 +3,21 @@ var Vector2 = require('../../../math/Vector2'); // Creates a cubic bezier curve starting at the previous end point and ending at p3, using p1 and p2 as control points +/** + * [description] + * + * @method Phaser.Curves.Path#cubicBezierTo + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * @param {Phaser.Math.Vector2} control1X - [description] + * @param {Phaser.Math.Vector2} control1Y - [description] + * @param {Phaser.Math.Vector2} control2X - [description] + * @param {Phaser.Math.Vector2} control2Y - [description] + * + * @return {Phaser.Curves.Path} [description] + */ var CubicBezierTo = function (x, y, control1X, control1Y, control2X, control2Y) { var p0 = this.getEndPoint(); diff --git a/v3/src/curves/path/inc/Destroy.js b/v3/src/curves/path/inc/Destroy.js index adb45bb49..16b483544 100644 --- a/v3/src/curves/path/inc/Destroy.js +++ b/v3/src/curves/path/inc/Destroy.js @@ -1,3 +1,9 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#destroy + * @since 3.0.0 + */ var Destroy = function () { this.curves.length = 0; diff --git a/v3/src/curves/path/inc/Draw.js b/v3/src/curves/path/inc/Draw.js index 87b1d6464..b172a15dd 100644 --- a/v3/src/curves/path/inc/Draw.js +++ b/v3/src/curves/path/inc/Draw.js @@ -1,3 +1,14 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#draw + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Graphics} graphics - [description] + * @param {integer} [pointsTotal=32] - [description] + * + * @return {Phaser.GameObjects.Graphics} [description] + */ var Draw = function (graphics, pointsTotal) { for (var i = 0; i < this.curves.length; i++) diff --git a/v3/src/curves/path/inc/EllipseTo.js b/v3/src/curves/path/inc/EllipseTo.js index db93913fb..ab5017c0f 100644 --- a/v3/src/curves/path/inc/EllipseTo.js +++ b/v3/src/curves/path/inc/EllipseTo.js @@ -1,6 +1,22 @@ var EllipseCurve = require('../../ellipse/EllipseCurve'); // Creates an ellipse curve positioned at the previous end point, using the given parameters + +/** + * [description] + * + * @method Phaser.Curves.Path#ellipseTo + * @since 3.0.0 + * + * @param {number} xRadius - [description] + * @param {number} yRadius - [description] + * @param {number} startAngle - [description] + * @param {number} endAngle - [description] + * @param {boolean} clockwise - [description] + * @param {number} rotation - [description] + * + * @return {Phaser.Curves.Path} [description] + */ var EllipseTo = function (xRadius, yRadius, startAngle, endAngle, clockwise, rotation) { var ellipse = new EllipseCurve(0, 0, xRadius, yRadius, startAngle, endAngle, clockwise, rotation); diff --git a/v3/src/curves/path/inc/FromJSON.js b/v3/src/curves/path/inc/FromJSON.js index 3243315c6..fd2174355 100644 --- a/v3/src/curves/path/inc/FromJSON.js +++ b/v3/src/curves/path/inc/FromJSON.js @@ -3,6 +3,16 @@ var EllipseCurve = require('../../ellipse/EllipseCurve'); var LineCurve = require('../../line/LineCurve'); var SplineCurve = require('../../spline/SplineCurve'); +/** + * [description] + * + * @method Phaser.Curves.Path#fromJSON + * @since 3.0.0 + * + * @param {object} data - [description] + * + * @return {Phaser.Curves.Path} [description] + */ var FromJSON = function (data) { // data should be an object matching the Path.toJSON object structure. diff --git a/v3/src/curves/path/inc/GetBounds.js b/v3/src/curves/path/inc/GetBounds.js index 731bb7a20..31f3a35d9 100644 --- a/v3/src/curves/path/inc/GetBounds.js +++ b/v3/src/curves/path/inc/GetBounds.js @@ -1,5 +1,16 @@ var Rectangle = require('../../../geom/rectangle/Rectangle'); +/** + * [description] + * + * @method Phaser.Curves.Path#getBounds + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} [out] - [description] + * @param {integer} [accuracy=16] - [description] + * + * @return {Phaser.Geom.Rectangle} [description] + */ var GetBounds = function (out, accuracy) { if (out === undefined) { out = new Rectangle(); } diff --git a/v3/src/curves/path/inc/GetCurveLengths.js b/v3/src/curves/path/inc/GetCurveLengths.js index 83e5916a3..78cb3616f 100644 --- a/v3/src/curves/path/inc/GetCurveLengths.js +++ b/v3/src/curves/path/inc/GetCurveLengths.js @@ -1,3 +1,11 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#getCurveLengths + * @since 3.0.0 + * + * @return {array} [description] + */ var GetCurveLengths = function () { // We use cache values if curves and cache array are same length diff --git a/v3/src/curves/path/inc/GetEndPoint.js b/v3/src/curves/path/inc/GetEndPoint.js index e0ecb5185..bc3e82b86 100644 --- a/v3/src/curves/path/inc/GetEndPoint.js +++ b/v3/src/curves/path/inc/GetEndPoint.js @@ -1,5 +1,15 @@ var Vector2 = require('../../../math/Vector2'); +/** + * [description] + * + * @method Phaser.Curves.Path#getEndPoint + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ var GetEndPoint = function (out) { if (out === undefined) { out = new Vector2(); } diff --git a/v3/src/curves/path/inc/GetLength.js b/v3/src/curves/path/inc/GetLength.js index c6990b2ef..50aeac630 100644 --- a/v3/src/curves/path/inc/GetLength.js +++ b/v3/src/curves/path/inc/GetLength.js @@ -1,3 +1,11 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#getLength + * @since 3.0.0 + * + * @return {number} [description] + */ var GetLength = function () { var lens = this.getCurveLengths(); diff --git a/v3/src/curves/path/inc/GetPoint.js b/v3/src/curves/path/inc/GetPoint.js index b2bba6d42..92cd4156a 100644 --- a/v3/src/curves/path/inc/GetPoint.js +++ b/v3/src/curves/path/inc/GetPoint.js @@ -9,6 +9,17 @@ var Vector2 = require('../../../math/Vector2'); // 3. Get t for the curve // 4. Return curve.getPointAt(t') +/** + * [description] + * + * @method Phaser.Curves.Path#getPoint + * @since 3.0.0 + * + * @param {number} t - [description] + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2|null} [description] + */ var GetPoint = function (t, out) { if (out === undefined) { out = new Vector2(); } diff --git a/v3/src/curves/path/inc/GetPoints.js b/v3/src/curves/path/inc/GetPoints.js index 5c7f44062..97dc8be44 100644 --- a/v3/src/curves/path/inc/GetPoints.js +++ b/v3/src/curves/path/inc/GetPoints.js @@ -1,3 +1,13 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#getPoints + * @since 3.0.0 + * + * @param {integer} [divisions=12] - [description] + * + * @return {Phaser.Math.Vector2[]} [description] + */ var GetPoints = function (divisions) { if (divisions === undefined) { divisions = 12; } diff --git a/v3/src/curves/path/inc/GetSpacedPoints.js b/v3/src/curves/path/inc/GetSpacedPoints.js index 720afbe2a..c85aa5f2c 100644 --- a/v3/src/curves/path/inc/GetSpacedPoints.js +++ b/v3/src/curves/path/inc/GetSpacedPoints.js @@ -1,3 +1,13 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#getSpacedPoints + * @since 3.0.0 + * + * @param {integer} [divisions=40] - [description] + * + * @return {Phaser.Math.Vector2[]} [description] + */ var GetSpacedPoints = function (divisions) { if (divisions === undefined) { divisions = 40; } diff --git a/v3/src/curves/path/inc/GetStartPoint.js b/v3/src/curves/path/inc/GetStartPoint.js index 598c8ed5a..82e5c84b0 100644 --- a/v3/src/curves/path/inc/GetStartPoint.js +++ b/v3/src/curves/path/inc/GetStartPoint.js @@ -1,5 +1,15 @@ var Vector2 = require('../../../math/Vector2'); +/** + * [description] + * + * @method Phaser.Curves.Path#getStartPoint + * @since 3.0.0 + * + * @param {Phaser.Math.Vector2} [out] - [description] + * + * @return {Phaser.Math.Vector2} [description] + */ var GetStartPoint = function (out) { if (out === undefined) { out = new Vector2(); } diff --git a/v3/src/curves/path/inc/LineTo.js b/v3/src/curves/path/inc/LineTo.js index a1ac72da6..6f03c8237 100644 --- a/v3/src/curves/path/inc/LineTo.js +++ b/v3/src/curves/path/inc/LineTo.js @@ -2,6 +2,18 @@ var LineCurve = require('../../line/LineCurve'); var Vector2 = require('../../../math/Vector2'); // Creates a line curve from the previous end point to x/y + +/** + * [description] + * + * @method Phaser.Curves.Path#lineTo + * @since 3.0.0 + * + * @param {number|Phaser.Math.Vector2} x - [description] + * @param {number} [y] - [description] + * + * @return {Phaser.Curves.Path} [description] + */ var LineTo = function (x, y) { if (x instanceof Vector2) diff --git a/v3/src/curves/path/inc/MoveTo.js b/v3/src/curves/path/inc/MoveTo.js index f8da257c3..315743344 100644 --- a/v3/src/curves/path/inc/MoveTo.js +++ b/v3/src/curves/path/inc/MoveTo.js @@ -1,8 +1,19 @@ var MovePathTo = require('../MoveTo'); +/** + * [description] + * + * @method Phaser.Curves.Path#moveTo + * @since 3.0.0 + * + * @param {number} x - [description] + * @param {number} y - [description] + * + * @return {Phaser.Curves.Path} [description] + */ var MoveTo = function (x, y) { - this.add(new MovePathTo(x, y)); + return this.add(new MovePathTo(x, y)); }; module.exports = MoveTo; diff --git a/v3/src/curves/path/inc/SplineTo.js b/v3/src/curves/path/inc/SplineTo.js index 2b3c962ae..9b1be03ff 100644 --- a/v3/src/curves/path/inc/SplineTo.js +++ b/v3/src/curves/path/inc/SplineTo.js @@ -1,6 +1,17 @@ var SplineCurve = require('../../spline/SplineCurve'); // Creates a spline curve starting at the previous end point, using the given parameters + +/** + * [description] + * + * @method Phaser.Curves.Path#splineTo + * @since 3.0.0 + * + * @param {[type]} points - [description] + * + * @return {Phaser.Curves.Path} [description] + */ var SplineTo = function (points) { points.unshift(this.getEndPoint()); diff --git a/v3/src/curves/path/inc/ToJSON.js b/v3/src/curves/path/inc/ToJSON.js index 26d12e970..bc34f698b 100644 --- a/v3/src/curves/path/inc/ToJSON.js +++ b/v3/src/curves/path/inc/ToJSON.js @@ -1,3 +1,11 @@ +/** + * [description] + * + * @method Phaser.Curves.Path#toJSON + * @since 3.0.0 + * + * @return {object} [description] + */ var ToJSON = function () { var out = []; diff --git a/v3/src/curves/path/inc/UpdateArcLengths.js b/v3/src/curves/path/inc/UpdateArcLengths.js index 70cdf15a6..54f34a2b0 100644 --- a/v3/src/curves/path/inc/UpdateArcLengths.js +++ b/v3/src/curves/path/inc/UpdateArcLengths.js @@ -1,4 +1,11 @@ // cacheLengths must be recalculated. + +/** + * [description] + * + * @method Phaser.Curves.Path#updateArcLengths + * @since 3.0.0 + */ var UpdateArcLengths = function () { this.cacheLengths = [];