Skip to content

Commit e1b8b04

Browse files
authored
Merge pull request phaserjs#4975 from JasonHK/jsdoc
Fixed `this` return types
2 parents 21dff62 + bee5428 commit e1b8b04

25 files changed

Lines changed: 130 additions & 130 deletions

src/animations/Animation.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ var Animation = new Class({
226226
*
227227
* @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects.
228228
*
229-
* @return {Phaser.Animations.Animation} This Animation object.
229+
* @return {this} This Animation object.
230230
*/
231231
addFrame: function (config)
232232
{
@@ -242,7 +242,7 @@ var Animation = new Class({
242242
* @param {integer} index - The index to insert the frame at within the animation.
243243
* @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects.
244244
*
245-
* @return {Phaser.Animations.Animation} This Animation object.
245+
* @return {this} This Animation object.
246246
*/
247247
addFrameAt: function (index, config)
248248
{
@@ -698,7 +698,7 @@ var Animation = new Class({
698698
*
699699
* @param {Phaser.Animations.AnimationFrame} frame - The AnimationFrame to be removed.
700700
*
701-
* @return {Phaser.Animations.Animation} This Animation object.
701+
* @return {this} This Animation object.
702702
*/
703703
removeFrame: function (frame)
704704
{
@@ -721,7 +721,7 @@ var Animation = new Class({
721721
*
722722
* @param {integer} index - The index in the AnimationFrame array
723723
*
724-
* @return {Phaser.Animations.Animation} This Animation object.
724+
* @return {this} This Animation object.
725725
*/
726726
removeFrameAt: function (index)
727727
{
@@ -841,7 +841,7 @@ var Animation = new Class({
841841
* @method Phaser.Animations.Animation#updateFrameSequence
842842
* @since 3.0.0
843843
*
844-
* @return {Phaser.Animations.Animation} This Animation object.
844+
* @return {this} This Animation object.
845845
*/
846846
updateFrameSequence: function ()
847847
{
@@ -898,7 +898,7 @@ var Animation = new Class({
898898
* @method Phaser.Animations.Animation#pause
899899
* @since 3.0.0
900900
*
901-
* @return {Phaser.Animations.Animation} This Animation object.
901+
* @return {this} This Animation object.
902902
*/
903903
pause: function ()
904904
{
@@ -913,7 +913,7 @@ var Animation = new Class({
913913
* @method Phaser.Animations.Animation#resume
914914
* @since 3.0.0
915915
*
916-
* @return {Phaser.Animations.Animation} This Animation object.
916+
* @return {this} This Animation object.
917917
*/
918918
resume: function ()
919919
{

src/animations/AnimationManager.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ var AnimationManager = new Class({
131131
* @param {string} key - The key under which the Animation should be added. The Animation will be updated with it. Must be unique.
132132
* @param {Phaser.Animations.Animation} animation - The Animation which should be added to the Animation Manager.
133133
*
134-
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
134+
* @return {this} This Animation Manager.
135135
*/
136136
add: function (key, animation)
137137
{
138138
if (this.anims.has(key))
139139
{
140140
console.warn('Animation key exists: ' + key);
141141

142-
return;
142+
return this;
143143
}
144144

145145
animation.key = key;
@@ -486,7 +486,7 @@ var AnimationManager = new Class({
486486
* @fires Phaser.Animations.Events#PAUSE_ALL
487487
* @since 3.0.0
488488
*
489-
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
489+
* @return {this} This Animation Manager.
490490
*/
491491
pauseAll: function ()
492492
{
@@ -509,7 +509,7 @@ var AnimationManager = new Class({
509509
* @param {string} key - The key of the animation to play on the Game Object.
510510
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Objects to play the animation on.
511511
*
512-
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
512+
* @return {this} This Animation Manager.
513513
*/
514514
play: function (key, child)
515515
{
@@ -522,7 +522,7 @@ var AnimationManager = new Class({
522522

523523
if (!anim)
524524
{
525-
return;
525+
return this;
526526
}
527527

528528
for (var i = 0; i < child.length; i++)
@@ -568,7 +568,7 @@ var AnimationManager = new Class({
568568
* @fires Phaser.Animations.Events#RESUME_ALL
569569
* @since 3.0.0
570570
*
571-
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
571+
* @return {this} This Animation Manager.
572572
*/
573573
resumeAll: function ()
574574
{
@@ -596,7 +596,7 @@ var AnimationManager = new Class({
596596
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} children - An array of Game Objects to play the animation on. They must have an Animation Component.
597597
* @param {number} [stagger=0] - The amount of time, in milliseconds, to offset each play time by.
598598
*
599-
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
599+
* @return {this} This Animation Manager.
600600
*/
601601
staggerPlay: function (key, children, stagger)
602602
{
@@ -611,7 +611,7 @@ var AnimationManager = new Class({
611611

612612
if (!anim)
613613
{
614-
return;
614+
return this;
615615
}
616616

617617
for (var i = 0; i < children.length; i++)

src/cache/BaseCache.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var BaseCache = new Class({
6060
* @param {string} key - The unique key by which the data added to the cache will be referenced.
6161
* @param {*} data - The data to be stored in the cache.
6262
*
63-
* @return {Phaser.Cache.BaseCache} This BaseCache object.
63+
* @return {this} This BaseCache object.
6464
*/
6565
add: function (key, data)
6666
{
@@ -131,7 +131,7 @@ var BaseCache = new Class({
131131
*
132132
* @param {string} key - The unique key of the item to remove from the cache.
133133
*
134-
* @return {Phaser.Cache.BaseCache} This BaseCache object.
134+
* @return {this} This BaseCache object.
135135
*/
136136
remove: function (key)
137137
{

src/cameras/2d/BaseCamera.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ var BaseCamera = new Class({
609609
*
610610
* @param {number} x - The horizontal coordinate to center on.
611611
*
612-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
612+
* @return {this} This Camera instance.
613613
*/
614614
centerOnX: function (x)
615615
{
@@ -636,7 +636,7 @@ var BaseCamera = new Class({
636636
*
637637
* @param {number} y - The vertical coordinate to center on.
638638
*
639-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
639+
* @return {this} This Camera instance.
640640
*/
641641
centerOnY: function (y)
642642
{
@@ -663,7 +663,7 @@ var BaseCamera = new Class({
663663
* @param {number} x - The horizontal coordinate to center on.
664664
* @param {number} y - The vertical coordinate to center on.
665665
*
666-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
666+
* @return {this} This Camera instance.
667667
*/
668668
centerOn: function (x, y)
669669
{
@@ -679,7 +679,7 @@ var BaseCamera = new Class({
679679
* @method Phaser.Cameras.Scene2D.BaseCamera#centerToBounds
680680
* @since 3.0.0
681681
*
682-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
682+
* @return {this} This Camera instance.
683683
*/
684684
centerToBounds: function ()
685685
{
@@ -704,7 +704,7 @@ var BaseCamera = new Class({
704704
* @method Phaser.Cameras.Scene2D.BaseCamera#centerToSize
705705
* @since 3.0.0
706706
*
707-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
707+
* @return {this} This Camera instance.
708708
*/
709709
centerToSize: function ()
710710
{
@@ -872,7 +872,7 @@ var BaseCamera = new Class({
872872
*
873873
* @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group)} entries - The Game Object, or array of Game Objects, to be ignored by this Camera.
874874
*
875-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
875+
* @return {this} This Camera instance.
876876
*/
877877
ignore: function (entries)
878878
{
@@ -1042,7 +1042,7 @@ var BaseCamera = new Class({
10421042
* @method Phaser.Cameras.Scene2D.BaseCamera#removeBounds
10431043
* @since 3.0.0
10441044
*
1045-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1045+
* @return {this} This Camera instance.
10461046
*/
10471047
removeBounds: function ()
10481048
{
@@ -1065,7 +1065,7 @@ var BaseCamera = new Class({
10651065
*
10661066
* @param {number} [value=0] - The cameras angle of rotation, given in degrees.
10671067
*
1068-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1068+
* @return {this} This Camera instance.
10691069
*/
10701070
setAngle: function (value)
10711071
{
@@ -1089,7 +1089,7 @@ var BaseCamera = new Class({
10891089
*
10901090
* @param {(string|number|Phaser.Types.Display.InputColorObject)} [color='rgba(0,0,0,0)'] - The color value. In CSS, hex or numeric color notation.
10911091
*
1092-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1092+
* @return {this} This Camera instance.
10931093
*/
10941094
setBackgroundColor: function (color)
10951095
{
@@ -1130,7 +1130,7 @@ var BaseCamera = new Class({
11301130
* @param {integer} height - The height of the bounds, in pixels.
11311131
* @param {boolean} [centerOn=false] - If `true` the Camera will automatically be centered on the new bounds.
11321132
*
1133-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1133+
* @return {this} This Camera instance.
11341134
*/
11351135
setBounds: function (x, y, width, height, centerOn)
11361136
{
@@ -1188,7 +1188,7 @@ var BaseCamera = new Class({
11881188
*
11891189
* @param {string} [value=''] - The name of the Camera.
11901190
*
1191-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1191+
* @return {this} This Camera instance.
11921192
*/
11931193
setName: function (value)
11941194
{
@@ -1210,7 +1210,7 @@ var BaseCamera = new Class({
12101210
* @param {number} x - The top-left x coordinate of the Camera viewport.
12111211
* @param {number} [y=x] - The top-left y coordinate of the Camera viewport.
12121212
*
1213-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1213+
* @return {this} This Camera instance.
12141214
*/
12151215
setPosition: function (x, y)
12161216
{
@@ -1232,7 +1232,7 @@ var BaseCamera = new Class({
12321232
*
12331233
* @param {number} [value=0] - The rotation of the Camera, in radians.
12341234
*
1235-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1235+
* @return {this} This Camera instance.
12361236
*/
12371237
setRotation: function (value)
12381238
{
@@ -1253,7 +1253,7 @@ var BaseCamera = new Class({
12531253
*
12541254
* @param {boolean} value - `true` to round Camera pixels, `false` to not.
12551255
*
1256-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1256+
* @return {this} This Camera instance.
12571257
*/
12581258
setRoundPixels: function (value)
12591259
{
@@ -1272,7 +1272,7 @@ var BaseCamera = new Class({
12721272
*
12731273
* @param {Phaser.Scene} scene - The Scene the camera is bound to.
12741274
*
1275-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1275+
* @return {this} This Camera instance.
12761276
*/
12771277
setScene: function (scene)
12781278
{
@@ -1316,7 +1316,7 @@ var BaseCamera = new Class({
13161316
* @param {number} x - The x coordinate of the Camera in the game world.
13171317
* @param {number} [y=x] - The y coordinate of the Camera in the game world.
13181318
*
1319-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1319+
* @return {this} This Camera instance.
13201320
*/
13211321
setScroll: function (x, y)
13221322
{
@@ -1341,7 +1341,7 @@ var BaseCamera = new Class({
13411341
* @param {integer} width - The width of the Camera viewport.
13421342
* @param {integer} [height=width] - The height of the Camera viewport.
13431343
*
1344-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1344+
* @return {this} This Camera instance.
13451345
*/
13461346
setSize: function (width, height)
13471347
{
@@ -1372,7 +1372,7 @@ var BaseCamera = new Class({
13721372
* @param {integer} width - The width of the Camera viewport.
13731373
* @param {integer} [height=width] - The height of the Camera viewport.
13741374
*
1375-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1375+
* @return {this} This Camera instance.
13761376
*/
13771377
setViewport: function (x, y, width, height)
13781378
{
@@ -1399,7 +1399,7 @@ var BaseCamera = new Class({
13991399
*
14001400
* @param {number} [value=1] - The zoom value of the Camera. The minimum it can be is 0.001.
14011401
*
1402-
* @return {Phaser.Cameras.Scene2D.BaseCamera} This Camera instance.
1402+
* @return {this} This Camera instance.
14031403
*/
14041404
setZoom: function (value)
14051405
{

0 commit comments

Comments
 (0)