Skip to content

Commit 6611685

Browse files
committed
Added jsdocs
1 parent 6dc4a12 commit 6611685

2 files changed

Lines changed: 161 additions & 3 deletions

File tree

src/gameobjects/blitter/Blitter.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ var GameObject = require('../GameObject');
2222
*
2323
* Mixins:
2424
* @extends Phaser.GameObjects.Components.Alpha
25+
* @extends Phaser.GameObjects.Components.BlendMode
26+
* @extends Phaser.GameObjects.Components.Depth
27+
* @extends Phaser.GameObjects.Components.Pipeline
28+
* @extends Phaser.GameObjects.Components.ScaleMode
29+
* @extends Phaser.GameObjects.Components.ScrollFactor
30+
* @extends Phaser.GameObjects.Components.Size
31+
* @extends Phaser.GameObjects.Components.Texture
32+
* @extends Phaser.GameObjects.Components.Transform
33+
* @extends Phaser.GameObjects.Components.Visible
2534
*
2635
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. It can only belong to one Scene at any given time.
2736
* @param {number} [x==] - The x coordinate of this Game Object in world space.
@@ -39,11 +48,11 @@ var Blitter = new Class({
3948
Components.Depth,
4049
Components.Pipeline,
4150
Components.ScaleMode,
51+
Components.ScrollFactor,
4252
Components.Size,
4353
Components.Texture,
4454
Components.Transform,
4555
Components.Visible,
46-
Components.ScrollFactor,
4756
BlitterRender
4857
],
4958

src/gameobjects/components/TransformMatrix.js

Lines changed: 151 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
var Class = require('../../utils/Class');
22

3+
/**
4+
* [description]
5+
*
6+
* @class TransformMatrix
7+
* @memberOf Phaser.GameObjects.Components
8+
* @constructor
9+
* @since 3.0.0
10+
*
11+
* @param {number} [a=1] - [description]
12+
* @param {number} [b=0] - [description]
13+
* @param {number} [c=0] - [description]
14+
* @param {number} [d=1] - [description]
15+
* @param {number} [tx=0] - [description]
16+
* @param {number} [ty=0] - [description]
17+
*/
318
var TransformMatrix = new Class({
419

520
initialize:
@@ -13,8 +28,22 @@ var TransformMatrix = new Class({
1328
if (tx === undefined) { tx = 0; }
1429
if (ty === undefined) { ty = 0; }
1530

31+
/**
32+
* [description]
33+
*
34+
* @name Phaser.GameObjects.Components.TransformMatrix#matrix
35+
* @type {Float32Array}
36+
* @since 3.0.0
37+
*/
1638
this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);
1739

40+
/**
41+
* [description]
42+
*
43+
* @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix
44+
* @type {object}
45+
* @since 3.0.0
46+
*/
1847
this.decomposedMatrix = {
1948
translateX: 0,
2049
translateY: 0,
@@ -24,6 +53,14 @@ var TransformMatrix = new Class({
2453
};
2554
},
2655

56+
/**
57+
* [description]
58+
*
59+
* @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity
60+
* @since 3.0.0
61+
*
62+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
63+
*/
2764
loadIdentity: function ()
2865
{
2966
var matrix = this.matrix;
@@ -38,6 +75,17 @@ var TransformMatrix = new Class({
3875
return this;
3976
},
4077

78+
/**
79+
* [description]
80+
*
81+
* @method Phaser.GameObjects.Components.TransformMatrix#translate
82+
* @since 3.0.0
83+
*
84+
* @param {number} x - [description]
85+
* @param {number} y - [description]
86+
*
87+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
88+
*/
4189
translate: function (x, y)
4290
{
4391
var matrix = this.matrix;
@@ -48,6 +96,17 @@ var TransformMatrix = new Class({
4896
return this;
4997
},
5098

99+
/**
100+
* [description]
101+
*
102+
* @method Phaser.GameObjects.Components.TransformMatrix#scale
103+
* @since 3.0.0
104+
*
105+
* @param {number} x - [description]
106+
* @param {number} y - [description]
107+
*
108+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
109+
*/
51110
scale: function (x, y)
52111
{
53112
var matrix = this.matrix;
@@ -60,6 +119,16 @@ var TransformMatrix = new Class({
60119
return this;
61120
},
62121

122+
/**
123+
* [description]
124+
*
125+
* @method Phaser.GameObjects.Components.TransformMatrix#rotate
126+
* @since 3.0.0
127+
*
128+
* @param {number} radian - [description]
129+
*
130+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
131+
*/
63132
rotate: function (radian)
64133
{
65134
var radianSin = Math.sin(radian);
@@ -68,6 +137,16 @@ var TransformMatrix = new Class({
68137
return this.transform(radianCos, radianSin, -radianSin, radianCos, 0, 0);
69138
},
70139

140+
/**
141+
* [description]
142+
*
143+
* @method Phaser.GameObjects.Components.TransformMatrix#multiply
144+
* @since 3.0.0
145+
*
146+
* @param {Phaser.GameObjects.Components.TransformMatrix} rhs - [description]
147+
*
148+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
149+
*/
71150
multiply: function (rhs)
72151
{
73152
var matrix = this.matrix;
@@ -97,6 +176,21 @@ var TransformMatrix = new Class({
97176
return this;
98177
},
99178

179+
/**
180+
* [description]
181+
*
182+
* @method Phaser.GameObjects.Components.TransformMatrix#transform
183+
* @since 3.0.0
184+
*
185+
* @param {number} a - [description]
186+
* @param {number} b - [description]
187+
* @param {number} c - [description]
188+
* @param {number} d - [description]
189+
* @param {number} tx - [description]
190+
* @param {number} ty - [description]
191+
*
192+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
193+
*/
100194
transform: function (a, b, c, d, tx, ty)
101195
{
102196
var matrix = this.matrix;
@@ -118,7 +212,18 @@ var TransformMatrix = new Class({
118212
return this;
119213
},
120214

121-
215+
/**
216+
* [description]
217+
*
218+
* @method Phaser.GameObjects.Components.TransformMatrix#transformPoint
219+
* @since 3.0.0
220+
*
221+
* @param {number} x - [description]
222+
* @param {number} y - [description]
223+
* @param {Phaser.Geom.Point|Phaser.Math.Vec2|object} point - [description]
224+
*
225+
* @return {Phaser.Geom.Point|Phaser.Math.Vec2|object} [description]
226+
*/
122227
transformPoint: function (x, y, point)
123228
{
124229
if (point === undefined) { point = { x: 0, y: 0 }; }
@@ -138,6 +243,14 @@ var TransformMatrix = new Class({
138243
return point;
139244
},
140245

246+
/**
247+
* [description]
248+
*
249+
* @method Phaser.GameObjects.Components.TransformMatrix#invert
250+
* @since 3.0.0
251+
*
252+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
253+
*/
141254
invert: function ()
142255
{
143256
var matrix = this.matrix;
@@ -161,6 +274,21 @@ var TransformMatrix = new Class({
161274
return this;
162275
},
163276

277+
/**
278+
* [description]
279+
*
280+
* @method Phaser.GameObjects.Components.TransformMatrix#setTransform
281+
* @since 3.0.0
282+
*
283+
* @param {number} a - [description]
284+
* @param {number} b - [description]
285+
* @param {number} c - [description]
286+
* @param {number} d - [description]
287+
* @param {number} tx - [description]
288+
* @param {number} ty - [description]
289+
*
290+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
291+
*/
164292
setTransform: function (a, b, c, d, tx, ty)
165293
{
166294
var matrix = this.matrix;
@@ -175,6 +303,14 @@ var TransformMatrix = new Class({
175303
return this;
176304
},
177305

306+
/**
307+
* [description]
308+
*
309+
* @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix
310+
* @since 3.0.0
311+
*
312+
* @return {object} [description]
313+
*/
178314
decomposeMatrix: function ()
179315
{
180316
var decomposedMatrix = this.decomposedMatrix;
@@ -205,7 +341,20 @@ var TransformMatrix = new Class({
205341
return decomposedMatrix;
206342
},
207343

208-
/* identity + translate + rotate + scale */
344+
/**
345+
* Identity + Translate + Rotate + Scale
346+
*
347+
* @method Phaser.GameObjects.Components.TransformMatrix#applyITRS
348+
* @since 3.0.0
349+
*
350+
* @param {number} x - [description]
351+
* @param {number} y - [description]
352+
* @param {number} rotation - [description]
353+
* @param {number} scaleX - [description]
354+
* @param {number} scaleY - [description]
355+
*
356+
* @return {Phaser.GameObjects.Components.TransformMatrix} This TransformMatrix.
357+
*/
209358
applyITRS: function (x, y, rotation, scaleX, scaleY)
210359
{
211360
var matrix = this.matrix;

0 commit comments

Comments
 (0)