Skip to content

Commit 7eb73e9

Browse files
committed
Merge pull request phaserjs#1648 from pnstickne/wip-components-docs
Component documentation
2 parents 5a620f9 + 4de95c0 commit 7eb73e9

29 files changed

Lines changed: 271 additions & 96 deletions

src/gameobjects/BitmapData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ Phaser.BitmapData.prototype = {
18291829
};
18301830

18311831
/**
1832-
* @name Phaser.Sprite#smoothed
1832+
* @memberof Phaser.BitmapData
18331833
* @property {boolean} smoothed - Gets or sets this BitmapData.contexts smoothing enabled value.
18341834
*/
18351835
Object.defineProperty(Phaser.BitmapData.prototype, "smoothed", {

src/gameobjects/BitmapText.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
* @class Phaser.BitmapText
1515
* @constructor
1616
* @extends PIXI.BitmapText
17+
* @extends Phaser.Component.Core
18+
* @extends Phaser.Component.Angle
19+
* @extends Phaser.Component.AutoCull
20+
* @extends Phaser.Component.Bounds
21+
* @extends Phaser.Component.Destroy
22+
* @extends Phaser.Component.FixedToCamera
23+
* @extends Phaser.Component.InputEnabled
24+
* @extends Phaser.Component.InWorld
25+
* @extends Phaser.Component.LifeSpan
26+
* @extends Phaser.Component.PhysicsBody
27+
* @extends Phaser.Component.Reset
1728
* @param {Phaser.Game} game - A reference to the currently running game.
1829
* @param {number} x - X position of the new bitmapText object.
1930
* @param {number} y - Y position of the new bitmapText object.

src/gameobjects/Graphics.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
* @class Phaser.Graphics
1111
* @constructor
1212
* @extends PIXI.Graphics
13+
* @extends Phaser.Component.Core
14+
* @extends Phaser.Component.Angle
15+
* @extends Phaser.Component.AutoCull
16+
* @extends Phaser.Component.Bounds
17+
* @extends Phaser.Component.Destroy
18+
* @extends Phaser.Component.FixedToCamera
19+
* @extends Phaser.Component.InputEnabled
20+
* @extends Phaser.Component.InWorld
21+
* @extends Phaser.Component.LifeSpan
22+
* @extends Phaser.Component.PhysicsBody
23+
* @extends Phaser.Component.Reset
1324
* @param {Phaser.Game} game Current game instance.
1425
* @param {number} x - X position of the new graphics object.
1526
* @param {number} y - Y position of the new graphics object.

src/gameobjects/Image.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@
1010
*
1111
* @class Phaser.Image
1212
* @extends PIXI.Sprite
13+
* @extends Phaser.Component.Core
14+
* @extends Phaser.Component.Angle
15+
* @extends Phaser.Component.Animation
16+
* @extends Phaser.Component.AutoCull
17+
* @extends Phaser.Component.Bounds
18+
* @extends Phaser.Component.BringToTop
19+
* @extends Phaser.Component.Crop
20+
* @extends Phaser.Component.Destroy
21+
* @extends Phaser.Component.FixedToCamera
22+
* @extends Phaser.Component.InputEnabled
23+
* @extends Phaser.Component.LifeSpan
24+
* @extends Phaser.Component.LoadTexture
25+
* @extends Phaser.Component.Overlap
26+
* @extends Phaser.Component.Reset
27+
* @extends Phaser.Component.Smoothed
1328
* @constructor
1429
* @param {Phaser.Game} game - A reference to the currently running game.
1530
* @param {number} x - The x coordinate of the Image. The coordinate is relative to any parent container this Image may be in.

src/gameobjects/Rope.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@
1212
* @class Phaser.Rope
1313
* @constructor
1414
* @extends PIXI.Rope
15+
* @extends Phaser.Component.Core
16+
* @extends Phaser.Component.Angle
17+
* @extends Phaser.Component.Animation
18+
* @extends Phaser.Component.AutoCull
19+
* @extends Phaser.Component.Bounds
20+
* @extends Phaser.Component.BringToTop
21+
* @extends Phaser.Component.Crop
22+
* @extends Phaser.Component.Delta
23+
* @extends Phaser.Component.Destroy
24+
* @extends Phaser.Component.FixedToCamera
25+
* @extends Phaser.Component.InputEnabled
26+
* @extends Phaser.Component.InWorld
27+
* @extends Phaser.Component.LifeSpan
28+
* @extends Phaser.Component.LoadTexture
29+
* @extends Phaser.Component.Overlap
30+
* @extends Phaser.Component.PhysicsBody
31+
* @extends Phaser.Component.Reset
32+
* @extends Phaser.Component.ScaleMinMax
33+
* @extends Phaser.Component.Smoothed
1534
* @param {Phaser.Game} game - A reference to the currently running game.
1635
* @param {number} x - The x coordinate (in world space) to position the Rope at.
1736
* @param {number} y - The y coordinate (in world space) to position the Rope at.

src/gameobjects/Sprite.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@
1414
* @class Phaser.Sprite
1515
* @constructor
1616
* @extends PIXI.Sprite
17+
* @extends Phaser.Component.Core
18+
* @extends Phaser.Component.Angle
19+
* @extends Phaser.Component.Animation
20+
* @extends Phaser.Component.AutoCull
21+
* @extends Phaser.Component.Bounds
22+
* @extends Phaser.Component.BringToTop
23+
* @extends Phaser.Component.Crop
24+
* @extends Phaser.Component.Delta
25+
* @extends Phaser.Component.Destroy
26+
* @extends Phaser.Component.FixedToCamera
27+
* @extends Phaser.Component.InputEnabled
28+
* @extends Phaser.Component.InWorld
29+
* @extends Phaser.Component.LifeSpan
30+
* @extends Phaser.Component.LoadTexture
31+
* @extends Phaser.Component.Overlap
32+
* @extends Phaser.Component.PhysicsBody
33+
* @extends Phaser.Component.Reset
34+
* @extends Phaser.Component.ScaleMinMax
35+
* @extends Phaser.Component.Smoothed
1736
* @param {Phaser.Game} game - A reference to the currently running game.
1837
* @param {number} x - The x coordinate (in world space) to position the Sprite at.
1938
* @param {number} y - The y coordinate (in world space) to position the Sprite at.
@@ -73,7 +92,7 @@ Phaser.Sprite.prototype.preUpdateCore = Phaser.Component.Core.preUpdate;
7392
/**
7493
* Automatically called by World.preUpdate.
7594
*
76-
* @method Phaser.Sprite#preUpdate
95+
* @method
7796
* @memberof Phaser.Sprite
7897
* @return {boolean} True if the Sprite was rendered, otherwise false.
7998
*/

src/gameobjects/Text.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@
1414
*
1515
* @class Phaser.Text
1616
* @extends PIXI.Text
17+
* @extends Phaser.Component.Core
18+
* @extends Phaser.Component.Angle
19+
* @extends Phaser.Component.AutoCull
20+
* @extends Phaser.Component.Bounds
21+
* @extends Phaser.Component.BringToTop
22+
* @extends Phaser.Component.Destroy
23+
* @extends Phaser.Component.FixedToCamera
24+
* @extends Phaser.Component.InputEnabled
25+
* @extends Phaser.Component.InWorld
26+
* @extends Phaser.Component.LifeSpan
27+
* @extends Phaser.Component.Overlap
28+
* @extends Phaser.Component.PhysicsBody
29+
* @extends Phaser.Component.Reset
30+
* @extends Phaser.Component.Smoothed
1731
* @constructor
1832
* @param {Phaser.Game} game - Current game instance.
1933
* @param {number} x - X position of the new text object.

src/gameobjects/TileSprite.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@
1111
* @class Phaser.TileSprite
1212
* @constructor
1313
* @extends PIXI.TilingSprite
14+
* @extends Phaser.Component.Core
15+
* @extends Phaser.Component.Angle
16+
* @extends Phaser.Component.Animation
17+
* @extends Phaser.Component.AutoCull
18+
* @extends Phaser.Component.Bounds
19+
* @extends Phaser.Component.Destroy
20+
* @extends Phaser.Component.FixedToCamera
21+
* @extends Phaser.Component.InputEnabled
22+
* @extends Phaser.Component.InWorld
23+
* @extends Phaser.Component.LoadTexture
24+
* @extends Phaser.Component.Overlap
25+
* @extends Phaser.Component.PhysicsBody
26+
* @extends Phaser.Component.Reset
27+
* @extends Phaser.Component.Smoothed
1428
* @param {Phaser.Game} game - A reference to the currently running game.
1529
* @param {number} x - The x coordinate (in world space) to position the TileSprite at.
1630
* @param {number} y - The y coordinate (in world space) to position the TileSprite at.

src/gameobjects/components/Angle.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Angle Component Features.
3+
*
4+
* @class
5+
*/
16
Phaser.Component.Angle = function () {};
27

38
Phaser.Component.Angle.prototype = {
@@ -7,7 +12,6 @@ Phaser.Component.Angle.prototype = {
712
* Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90.
813
* If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle.
914
*
10-
* @name Phaser.Sprite#angle
1115
* @property {number} angle - The angle of this Sprite in degrees.
1216
*/
1317
angle: {

src/gameobjects/components/Animation.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Animation Component Features.
3+
*
4+
* @class
5+
*/
16
Phaser.Component.Animation = function () {};
27

38
Phaser.Component.Animation.prototype = {
@@ -6,8 +11,7 @@ Phaser.Component.Animation.prototype = {
611
* Play an animation based on the given key. The animation should previously have been added via sprite.animations.add()
712
* If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself.
813
*
9-
* @method Phaser.Sprite#play
10-
* @memberof Phaser.Sprite
14+
* @method
1115
* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
1216
* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
1317
* @param {boolean} [loop=false] - Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.

0 commit comments

Comments
 (0)