Merge pull request #124 from alvinsight/dev

A lot of documentation updates
This commit is contained in:
Richard Davey 2013-10-25 07:51:38 -07:00
commit 0463bb4333
9 changed files with 101 additions and 114 deletions

View file

@ -2,20 +2,17 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.BitmapText
*/ */
/** /**
* An Animation instance contains a single animation and the controls to play it. * Creates a new <code>BitmapText</code>.
* It is created by the AnimationManager, consists of Animation.Frame objects and belongs to a single Game Object such as a Sprite.
*
* @class Phaser.BitmapText * @class Phaser.BitmapText
* @constructor * @constructor
* @param {Phaser.Game} game - A reference to the currently running game. * @param {Phaser.Game} game - A reference to the currently running game.
* @param {number} x - X position of Description. * @param {number} x - X position of the new bitmapText object.
* @param {number} y - Y position of Description. * @param {number} y - Y position of the new bitmapText object.
* @param {string} text - Description. * @param {string} text - The actual text that will be written.
* @param {string} style - Description. * @param {object} style - The style object containing style attributes like font, font size , etc.
*/ */
Phaser.BitmapText = function (game, x, y, text, style) { Phaser.BitmapText = function (game, x, y, text, style) {

View file

@ -2,7 +2,6 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.Bullet
*/ */
/** /**
@ -15,13 +14,12 @@
* animation, all input events, crop support, health/damage, loadTexture * animation, all input events, crop support, health/damage, loadTexture
* *
* @class Phaser.Bullet * @class Phaser.Bullet
* @classdesc Description of class.
* @constructor * @constructor
* @param {Phaser.Game} game - Current game instance. * @param {Phaser.Game} game - Current game instance.
* @param {Description} x - Description. * @param {number} x - X position of the new bullet.
* @param {Description} y - Description. * @param {number} y - Y position of the new bullet.
* @param {string} key - Description. * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {Description} frame - Description. * @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
*/ */
Phaser.Bullet = function (game, x, y, key, frame) { Phaser.Bullet = function (game, x, y, key, frame) {

View file

@ -2,7 +2,6 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.Button
*/ */

View file

@ -2,7 +2,6 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.Events
*/ */

View file

@ -2,7 +2,6 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.GameObjectFactory
*/ */
/** /**
@ -43,8 +42,8 @@ Phaser.GameObjectFactory.prototype = {
/** /**
* Description. * Description.
* @method existing. * @method existing.
* @param {object} - Description. * @param {*} object - An instance of Phaser.Sprite, Phaser.Button or any other display object..
* @return {boolean} Description. * @return {*} The child that was added to the Group.
*/ */
existing: function (object) { existing: function (object) {
@ -58,9 +57,9 @@ Phaser.GameObjectFactory.prototype = {
* @method sprite * @method sprite
* @param {number} x - X position of the new sprite. * @param {number} x - X position of the new sprite.
* @param {number} y - Y position of the new sprite. * @param {number} y - Y position of the new sprite.
* @param {string|RenderTexture} [key] - The image key as defined in the Game.Cache to use as the texture for this sprite OR a RenderTexture. * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name. * @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
* @returns {Description} Description. * @returns {Phaser.Sprite} the newly created sprite object.
*/ */
sprite: function (x, y, key, frame) { sprite: function (x, y, key, frame) {
@ -77,7 +76,7 @@ Phaser.GameObjectFactory.prototype = {
* @param {number} y - Y position of the new sprite. * @param {number} y - Y position of the new sprite.
* @param {string|RenderTexture} [key] - The image key as defined in the Game.Cache to use as the texture for this sprite OR a RenderTexture. * @param {string|RenderTexture} [key] - The image key as defined in the Game.Cache to use as the texture for this sprite OR a RenderTexture.
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name. * @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
* @returns {Description} Description. * @returns {Phaser.Sprite} the newly created sprite object.
*/ */
child: function (group, x, y, key, frame) { child: function (group, x, y, key, frame) {
@ -90,7 +89,7 @@ Phaser.GameObjectFactory.prototype = {
* *
* @method tween * @method tween
* @param {object} obj - Object the tween will be run on. * @param {object} obj - Object the tween will be run on.
* @return {Description} Description. * @return {Phaser.Tween} Description.
*/ */
tween: function (obj) { tween: function (obj) {
@ -99,12 +98,12 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
* *
* @method group * @method group
* @param {Description} parent - Description. * @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
* @param {Description} name - Description. * @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging.
* @return {Description} Description. * @return {Phaser.Group} The newly created group.
*/ */
group: function (parent, name) { group: function (parent, name) {
@ -113,13 +112,13 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * Creates a new instance of the Sound class.
* *
* @method audio * @method audio
* @param {Description} key - Description. * @param {string} key - The Game.cache key of the sound that this object will use.
* @param {Description} volume - Description. * @param {number} volume - The volume at which the sound will be played.
* @param {Description} loop - Description. * @param {boolean} loop - Whether or not the sound will loop.
* @return {Description} Description. * @return {Phaser.Sound} The newly created text object.
*/ */
audio: function (key, volume, loop) { audio: function (key, volume, loop) {
@ -128,16 +127,16 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * Creates a new <code>TileSprite</code>.
* *
* @method tileSprite * @method tileSprite
* @param {Description} x - Description. * @param {number} x - X position of the new tileSprite.
* @param {Description} y - Description. * @param {number} y - Y position of the new tileSprite.
* @param {Description} width - Description. * @param {number} width - the width of the tilesprite.
* @param {Description} height - Description. * @param {number} height - the height of the tilesprite.
* @param {Description} key - Description. * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {Description} frame - Description. * @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
* @return {Description} Description. * @return {Phaser.TileSprite} The newly created tileSprite object.
*/ */
tileSprite: function (x, y, width, height, key, frame) { tileSprite: function (x, y, width, height, key, frame) {
@ -146,13 +145,14 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * Creates a new <code>Text</code>.
* *
* @method text * @method text
* @param {Description} x - Description. * @param {number} x - X position of the new text object.
* @param {Description} y - Description. * @param {number} y - Y position of the new text object.
* @param {Description} text - Description. * @param {string} text - The actual text that will be written.
* @param {Description} style - Description. * @param {object} style - The style object containing style attributes like font, font size , etc.
* @return {Phaser.Text} The newly created text object.
*/ */
text: function (x, y, text, style) { text: function (x, y, text, style) {
@ -161,17 +161,18 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * Creates a new <code>Button</code> object.
* *
* @method button * @method button
* @param {Description} x - Description. * @param {number} [x] X position of the new button object.
* @param {Description} y - Description. * @param {number} [y] Y position of the new button object.
* @param {Description} callback - Description. * @param {string} [key] The image key as defined in the Game.Cache to use as the texture for this button.
* @param {Description} callbackContext - Description. * @param {function} [callback] The function to call when this button is pressed
* @param {Description} overFrame - Description. * @param {object} [callbackContext] The context in which the callback will be called (usually 'this')
* @param {Description} outFrame - Description. * @param {string|number} [overFrame] This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.
* @param {Description} downFrame - Description. * @param {string|number} [outFrame] This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.
* @return {Description} Description. * @param {string|number} [downFrame] This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
* @return {Phaser.Button} The newly created button object.
*/ */
button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) { button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) {
@ -180,12 +181,12 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * Creates a new <code>Graphics</code> object.
* *
* @method graphics * @method graphics
* @param {Description} x - Description. * @param {number} x - X position of the new graphics object.
* @param {Description} y - Description. * @param {number} y - Y position of the new graphics object.
* @return {Description} Description. * @return {Phaser.Graphics} The newly created graphics object.
*/ */
graphics: function (x, y) { graphics: function (x, y) {
@ -194,13 +195,15 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * Emitter is a lightweight particle emitter. It can be used for one-time explosions or for
* continuous effects like rain and fire. All it really does is launch Particle objects out
* at set intervals, and fixes their positions and velocities accorindgly.
* *
* @method emitter * @method emitter
* @param {Description} x - Description. * @param {number} [x=0] - The x coordinate within the Emitter that the particles are emitted from.
* @param {Description} y - Description. * @param {number} [y=0] - The y coordinate within the Emitter that the particles are emitted from.
* @param {Description} maxParticles - Description. * @param {number} [maxParticles=50] - The total number of particles in this emitter.
* @return {Description} Description. * @return {Phaser.Emitter} The newly created emitter object.
*/ */
emitter: function (x, y, maxParticles) { emitter: function (x, y, maxParticles) {
@ -209,14 +212,14 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * * Create a new <code>BitmapText</code>.
* *
* @method bitmapText * @method bitmapText
* @param {Description} x - Description. * @param {number} x - X position of the new bitmapText object.
* @param {Description} y - Description. * @param {number} y - Y position of the new bitmapText object.
* @param {Description} text - Description. * @param {string} text - The actual text that will be written.
* @param {Description} style - Description. * @param {object} style - The style object containing style attributes like font, font size , etc.
* @return {Description} Description. * @return {Phaser.BitmapText} The newly created bitmapText object.
*/ */
bitmapText: function (x, y, text, style) { bitmapText: function (x, y, text, style) {
@ -228,8 +231,8 @@ Phaser.GameObjectFactory.prototype = {
* Description. * Description.
* *
* @method tilemap * @method tilemap
* @param {Description} key - Description. * @param {string} key - Asset key for the JSON file.
* @return {Description} Description. * @return {Phaser.Tilemap} The newly created tilemap object.
*/ */
tilemap: function (key) { tilemap: function (key) {
@ -240,9 +243,9 @@ Phaser.GameObjectFactory.prototype = {
/** /**
* Description. * Description.
* *
* @method tilemap * @method tileset
* @param {Description} key - Description. * @param {string} key - The image key as defined in the Game.Cache to use as the tileset.
* @return {Description} Description. * @return {Phaser.Tileset} The newly created tileset object.
*/ */
tileset: function (key) { tileset: function (key) {
@ -253,14 +256,12 @@ Phaser.GameObjectFactory.prototype = {
/** /**
* Description. * Description.
* *
* @method tileSprite * @method tilemaplayer
* @param {Description} x - Description. * @param {number} x - X position of the new tilemapLayer.
* @param {Description} y - Description. * @param {number} y - Y position of the new tilemapLayer.
* @param {Description} width - Description. * @param {number} width - the width of the tilemapLayer.
* @param {Description} height - Description. * @param {number} height - the height of the tilemapLayer.
* @param {Description} key - Description. * @return {Phaser.TilemapLayer} The newly created tilemaplayer object.
* @param {Description} frame - Description.
* @return {Description} Description.
*/ */
tilemapLayer: function (x, y, width, height, tileset, tilemap, layer) { tilemapLayer: function (x, y, width, height, tileset, tilemap, layer) {
@ -269,13 +270,13 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* Description. * A dynamic initially blank canvas to which images can be drawn
* *
* @method renderTexture * @method renderTexture
* @param {Description} key - Description. * @param {string} key - Asset key for the render texture.
* @param {Description} width - Description. * @param {number} width - the width of the render texture.
* @param {Description} height - Description. * @param {number} height - the height of the render texture.
* @return {Description} Description. * @return {Phaser.RenderTexture} The newly created renderTexture object.
*/ */
renderTexture: function (key, width, height) { renderTexture: function (key, width, height) {

View file

@ -2,18 +2,17 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.Graphics
*/ */
/** /**
* Description. * Creates a new <code>Graphics</code> object.
* *
* @class Phaser.Graphics * @class Phaser.Graphics
* @constructor * @constructor
* *
* @param {Phaser.Game} game Current game instance. * @param {Phaser.Game} game Current game instance.
* @param {number} [x] X position of Description. * @param {number} x - X position of the new graphics object.
* @param {number} [y] Y position of Description. * @param {number} y - Y position of the new graphics object.
*/ */
Phaser.Graphics = function (game, x, y) { Phaser.Graphics = function (game, x, y) {

View file

@ -2,18 +2,16 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.RenderTexture
*/ */
/** /**
* Description of constructor. * A dynamic initially blank canvas to which images can be drawn
* @class Phaser.RenderTexture * @class Phaser.RenderTexture
* @classdesc Description of class.
* @constructor * @constructor
* @param {Phaser.Game} game - Current game instance. * @param {Phaser.Game} game - Current game instance.
* @param {string} key - Description. * @param {string} key - Asset key for the render texture.
* @param {number} width - Description. * @param {number} width - the width of the render texture.
* @param {number} height - Description. * @param {number} height - the height of the render texture.
*/ */
Phaser.RenderTexture = function (game, key, width, height) { Phaser.RenderTexture = function (game, key, width, height) {
@ -23,19 +21,19 @@ Phaser.RenderTexture = function (game, key, width, height) {
this.game = game; this.game = game;
/** /**
* @property {Description} name - Description. * @property {string} name - the name of the object.
*/ */
this.name = key; this.name = key;
PIXI.EventTarget.call( this ); PIXI.EventTarget.call( this );
/** /**
* @property {number} width - Description. * @property {number} width - the width.
*/ */
this.width = width || 100; this.width = width || 100;
/** /**
* @property {number} height - Description. * @property {number} height - the height.
*/ */
this.height = height || 100; this.height = height || 100;

View file

@ -2,19 +2,17 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.Text
*/ */
/** /**
* Create a new <code>Text</code>. * Create a new <code>Text</code>.
* @class Phaser.Text * @class Phaser.Text
* @classdesc Description of class.
* @constructor * @constructor
* @param {Phaser.Game} game - Current game instance. * @param {Phaser.Game} game - Current game instance.
* @param {Description} x - Description. * @param {number} x - X position of the new text object.
* @param {Description} y - Description. * @param {number} y - Y position of the new text object.
* @param {string} text - Description. * @param {string} text - The actual text that will be written.
* @param {string} style - Description. * @param {object} style - The style object containing style attributes like font, font size ,
*/ */
Phaser.Text = function (game, x, y, text, style) { Phaser.Text = function (game, x, y, text, style) {

View file

@ -2,21 +2,19 @@
* @author Richard Davey <rich@photonstorm.com> * @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd. * @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.TileSprite
*/ */
/** /**
* Create a new <code>TileSprite</code>. * Create a new <code>TileSprite</code>.
* @class Phaser.Tilemap * @class Phaser.Tilemap
* @classdesc Class description.
* @constructor * @constructor
* @param {Phaser.Game} game - Current game instance. * @param {Phaser.Game} game - Current game instance.
* @param {object} x - Description. * @param {number} x - X position of the new tileSprite.
* @param {object} y - Description. * @param {number} y - Y position of the new tileSprite.
* @param {number} width - Description. * @param {number} width - the width of the tilesprite.
* @param {number} height - Description. * @param {number} height - the height of the tilesprite.
* @param {string} key - Description. * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {Description} frame - Description. * @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
*/ */
Phaser.TileSprite = function (game, x, y, width, height, key, frame) { Phaser.TileSprite = function (game, x, y, width, height, key, frame) {