Skip to content

Commit 566fdac

Browse files
committed
Documented the TransformMatrix component.
1 parent ef8e5dd commit 566fdac

2 files changed

Lines changed: 45 additions & 45 deletions

File tree

src/gameobjects/components/MatrixStack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var MatrixStack = {
117117
},
118118

119119
/**
120-
* Resets the current matrix to the identity matrix.
120+
* Reset the current matrix to the identity matrix.
121121
*
122122
* @method Phaser.GameObjects.Components.MatrixStack#loadIdentity
123123
* @since 3.2.0

src/gameobjects/components/TransformMatrix.js

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var TransformMatrix = new Class({
3636
if (ty === undefined) { ty = 0; }
3737

3838
/**
39-
* [description]
39+
* The matrix values.
4040
*
4141
* @name Phaser.GameObjects.Components.TransformMatrix#matrix
4242
* @type {Float32Array}
@@ -45,7 +45,7 @@ var TransformMatrix = new Class({
4545
this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);
4646

4747
/**
48-
* [description]
48+
* The decomposed matrix.
4949
*
5050
* @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix
5151
* @type {object}
@@ -61,7 +61,7 @@ var TransformMatrix = new Class({
6161
},
6262

6363
/**
64-
* [description]
64+
* The Scale X value.
6565
*
6666
* @name Phaser.GameObjects.Components.TransformMatrix#a
6767
* @type {number}
@@ -82,7 +82,7 @@ var TransformMatrix = new Class({
8282
},
8383

8484
/**
85-
* [description]
85+
* The Shear Y value.
8686
*
8787
* @name Phaser.GameObjects.Components.TransformMatrix#b
8888
* @type {number}
@@ -103,7 +103,7 @@ var TransformMatrix = new Class({
103103
},
104104

105105
/**
106-
* [description]
106+
* The Shear X value.
107107
*
108108
* @name Phaser.GameObjects.Components.TransformMatrix#c
109109
* @type {number}
@@ -124,7 +124,7 @@ var TransformMatrix = new Class({
124124
},
125125

126126
/**
127-
* [description]
127+
* The Scale Y value.
128128
*
129129
* @name Phaser.GameObjects.Components.TransformMatrix#d
130130
* @type {number}
@@ -145,7 +145,7 @@ var TransformMatrix = new Class({
145145
},
146146

147147
/**
148-
* [description]
148+
* The Translate X value.
149149
*
150150
* @name Phaser.GameObjects.Components.TransformMatrix#tx
151151
* @type {number}
@@ -166,7 +166,7 @@ var TransformMatrix = new Class({
166166
},
167167

168168
/**
169-
* [description]
169+
* The Translate Y value.
170170
*
171171
* @name Phaser.GameObjects.Components.TransformMatrix#ty
172172
* @type {number}
@@ -187,7 +187,7 @@ var TransformMatrix = new Class({
187187
},
188188

189189
/**
190-
* [description]
190+
* The rotation of the Matrix.
191191
*
192192
* @name Phaser.GameObjects.Components.TransformMatrix#rotation
193193
* @type {number}
@@ -204,7 +204,7 @@ var TransformMatrix = new Class({
204204
},
205205

206206
/**
207-
* [description]
207+
* The horizontal scale of the Matrix.
208208
*
209209
* @name Phaser.GameObjects.Components.TransformMatrix#scaleX
210210
* @type {number}
@@ -221,7 +221,7 @@ var TransformMatrix = new Class({
221221
},
222222

223223
/**
224-
* [description]
224+
* The vertical scale of the Matrix.
225225
*
226226
* @name Phaser.GameObjects.Components.TransformMatrix#scaleY
227227
* @type {number}
@@ -238,7 +238,7 @@ var TransformMatrix = new Class({
238238
},
239239

240240
/**
241-
* [description]
241+
* Reset the Matrix to an identity matrix.
242242
*
243243
* @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity
244244
* @since 3.0.0
@@ -260,13 +260,13 @@ var TransformMatrix = new Class({
260260
},
261261

262262
/**
263-
* [description]
263+
* Translate the Matrix.
264264
*
265265
* @method Phaser.GameObjects.Components.TransformMatrix#translate
266266
* @since 3.0.0
267267
*
268-
* @param {number} x - [description]
269-
* @param {number} y - [description]
268+
* @param {number} x - The horizontal translation value.
269+
* @param {number} y - The vertical translation value.
270270
*
271271
* @return {this} This TransformMatrix.
272272
*/
@@ -281,13 +281,13 @@ var TransformMatrix = new Class({
281281
},
282282

283283
/**
284-
* [description]
284+
* Scale the Matrix.
285285
*
286286
* @method Phaser.GameObjects.Components.TransformMatrix#scale
287287
* @since 3.0.0
288288
*
289-
* @param {number} x - [description]
290-
* @param {number} y - [description]
289+
* @param {number} x - The horizontal scale value.
290+
* @param {number} y - The vertical scale value.
291291
*
292292
* @return {this} This TransformMatrix.
293293
*/
@@ -304,12 +304,12 @@ var TransformMatrix = new Class({
304304
},
305305

306306
/**
307-
* [description]
307+
* Rotate the Matrix.
308308
*
309309
* @method Phaser.GameObjects.Components.TransformMatrix#rotate
310310
* @since 3.0.0
311311
*
312-
* @param {number} radian - [description]
312+
* @param {number} radian - The angle of rotation, in radians.
313313
*
314314
* @return {this} This TransformMatrix.
315315
*/
@@ -332,12 +332,12 @@ var TransformMatrix = new Class({
332332
},
333333

334334
/**
335-
* [description]
335+
* Multiply this Matrix by the given Matrix.
336336
*
337337
* @method Phaser.GameObjects.Components.TransformMatrix#multiply
338338
* @since 3.0.0
339339
*
340-
* @param {Phaser.GameObjects.Components.TransformMatrix} rhs - [description]
340+
* @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by.
341341
*
342342
* @return {this} This TransformMatrix.
343343
*/
@@ -371,7 +371,7 @@ var TransformMatrix = new Class({
371371
},
372372

373373
/**
374-
* [description]
374+
* Transform the Matrix.
375375
*
376376
* @method Phaser.GameObjects.Components.TransformMatrix#transform
377377
* @since 3.0.0
@@ -407,16 +407,16 @@ var TransformMatrix = new Class({
407407
},
408408

409409
/**
410-
* [description]
410+
* Transform a point using this Matrix.
411411
*
412412
* @method Phaser.GameObjects.Components.TransformMatrix#transformPoint
413413
* @since 3.0.0
414414
*
415-
* @param {number} x - [description]
416-
* @param {number} y - [description]
417-
* @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - [description]
415+
* @param {number} x - The x coordinate of the point to transform.
416+
* @param {number} y - The y coordinate of the point to transform.
417+
* @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates.
418418
*
419-
* @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} [description]
419+
* @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates.
420420
*/
421421
transformPoint: function (x, y, point)
422422
{
@@ -438,7 +438,7 @@ var TransformMatrix = new Class({
438438
},
439439

440440
/**
441-
* [description]
441+
* Invert the Matrix.
442442
*
443443
* @method Phaser.GameObjects.Components.TransformMatrix#invert
444444
* @since 3.0.0
@@ -469,17 +469,17 @@ var TransformMatrix = new Class({
469469
},
470470

471471
/**
472-
* [description]
472+
* Set the values of this Matrix.
473473
*
474474
* @method Phaser.GameObjects.Components.TransformMatrix#setTransform
475475
* @since 3.0.0
476476
*
477-
* @param {number} a - [description]
478-
* @param {number} b - [description]
479-
* @param {number} c - [description]
480-
* @param {number} d - [description]
481-
* @param {number} tx - [description]
482-
* @param {number} ty - [description]
477+
* @param {number} a - The Scale X value.
478+
* @param {number} b - The Shear Y value.
479+
* @param {number} c - The Shear X value.
480+
* @param {number} d - The Scale Y value.
481+
* @param {number} tx - The Translate X value.
482+
* @param {number} ty - The Translate Y value.
483483
*
484484
* @return {this} This TransformMatrix.
485485
*/
@@ -498,12 +498,12 @@ var TransformMatrix = new Class({
498498
},
499499

500500
/**
501-
* [description]
501+
* Decompose this Matrix into its translation, scale and rotation values.
502502
*
503503
* @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix
504504
* @since 3.0.0
505505
*
506-
* @return {object} [description]
506+
* @return {object} The decomposed Matrix.
507507
*/
508508
decomposeMatrix: function ()
509509
{
@@ -541,16 +541,16 @@ var TransformMatrix = new Class({
541541
},
542542

543543
/**
544-
* Identity + Translate + Rotate + Scale
544+
* Apply the identity, translate, rotate and scale operations on the Matrix.
545545
*
546546
* @method Phaser.GameObjects.Components.TransformMatrix#applyITRS
547547
* @since 3.0.0
548548
*
549-
* @param {number} x - [description]
550-
* @param {number} y - [description]
551-
* @param {number} rotation - [description]
552-
* @param {number} scaleX - [description]
553-
* @param {number} scaleY - [description]
549+
* @param {number} x - The horizontal translation.
550+
* @param {number} y - The vertical translation.
551+
* @param {number} rotation - The angle of rotation, in radians.
552+
* @param {number} scaleX - The horizontal scale.
553+
* @param {number} scaleY - The vertical scale.
554554
*
555555
* @return {this} This TransformMatrix.
556556
*/

0 commit comments

Comments
 (0)