/**
+* @author Richard Davey <rich@photonstorm.com>
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
+* Phaser - ArcadeEmitter
+*
+* @class Phaser.Particles.Arcade.Emitter
+* @classdesc 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.
+* @constructor
+* @extends Phaser.Group
+* @param {Phaser.Game} game - Current game instance.
+* @param {number} x - Description.
+* @param {number} y - Description.
+* @param {number} maxParticles - Description.
+*/
+
+Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
+
+ /**
+ * @property {number} maxParticles - Description.
+ * @default
+ */
+ maxParticles = maxParticles || 50;
+
+ Phaser.Group.call(this, game);
+
+ /**
+ * @property {string} name - Description.
+ */
+ this.name = 'emitter' + this.game.particles.ID++;
+
+ /**
+ * @property {Description} type - Description.
+ */
+ this.type = Phaser.EMITTER;
+
+ /**
+ * @property {number} x - The X position of the top left corner of the emitter in world space.
+ * @default
+ */
+ this.x = 0;
+
+ /**
+ * @property {number} y - The Y position of the top left corner of emitter in world space.
+ * @default
+ */
+ this.y = 0;
+
+ /**
+ * @property {number} width - The width of the emitter. Particles can be randomly generated from anywhere within this box.
+ * @default
+ */
+ this.width = 1;
+
+ /**
+ * @property {number} height - The height of the emitter. Particles can be randomly generated from anywhere within this box.
+ * @default
+ */
+ this.height = 1;
+
+ /**
+ * The minimum possible velocity of a particle.
+ * The default value is (-100,-100).
+ * @property {Phaser.Point} minParticleSpeed
+ */
+ this.minParticleSpeed = new Phaser.Point(-100, -100);
+
+ /**
+ * The maximum possible velocity of a particle.
+ * The default value is (100,100).
+ * @property {Phaser.Point} maxParticleSpeed
+ */
+ this.maxParticleSpeed = new Phaser.Point(100, 100);
+
+ /**
+ * The minimum possible scale of a particle.
+ * The default value is 1.
+ * @property {number} minParticleScale
+ * @default
+ */
+ this.minParticleScale = 1;
+
+ /**
+ * The maximum possible scale of a particle.
+ * The default value is 1.
+ * @property {number} maxParticleScale
+ * @default
+ */
+ this.maxParticleScale = 1;
+
+ /**
+ * The minimum possible angular velocity of a particle. The default value is -360.
+ * @property {number} minRotation
+ * @default
+ */
+ this.minRotation = -360;
+
+ /**
+ * The maximum possible angular velocity of a particle. The default value is 360.
+ * @property {number} maxRotation
+ * @default
+ */
+ this.maxRotation = 360;
+
+ /**
+ * Sets the <code>gravity.y</code> of each particle to this value on launch.
+ * @property {number} gravity
+ * @default
+ */
+ this.gravity = 2;
+
+ /**
+ * Set your own particle class type here.
+ * @property {Description} particleClass
+ * @default
+ */
+ this.particleClass = null;
+
+ /**
+ * The X and Y drag component of particles launched from the emitter.
+ * @property {Phaser.Point} particleDrag
+ */
+ this.particleDrag = new Phaser.Point();
+
+ /**
+ * The angular drag component of particles launched from the emitter if they are rotating.
+ * @property {number} angularDrag
+ * @default
+ */
+ this.angularDrag = 0;
+
+ /**
+ * How often a particle is emitted in ms (if emitter is started with Explode == false).
+ * @property {boolean} frequency
+ * @default
+ */
+ this.frequency = 100;
+
+ /**
+ * The total number of particles in this emitter.
+ * @property {number} maxParticles
+ */
+ this.maxParticles = maxParticles;
+
+ /**
+ * How long each particle lives once it is emitted in ms. Default is 2 seconds.
+ * Set lifespan to 'zero' for particles to live forever.
+ * @property {number} lifespan
+ * @default
+ */
+ this.lifespan = 2000;
+
+ /**
+ * How much each particle should bounce on each axis. 1 = full bounce, 0 = no bounce.
+ * @property {Phaser.Point} bounce
+ */
+ this.bounce = new Phaser.Point();
+
+ /**
+ * Internal helper for deciding how many particles to launch.
+ * @property {number} _quantity
+ * @private
+ * @default
+ */
+ this._quantity = 0;
+
+ /**
+ * Internal helper for deciding when to launch particles or kill them.
+ * @property {number} _timer
+ * @private
+ * @default
+ */
+ this._timer = 0;
+
+ /**
+ * Internal counter for figuring out how many particles to launch.
+ * @property {number} _counter
+ * @private
+ * @default
+ */
+ this._counter = 0;
+
+ /**
+ * Internal helper for the style of particle emission (all at once, or one at a time).
+ * @property {boolean} _explode
+ * @private
+ * @default
+ */
+ this._explode = true;
+
+ /**
+ * Determines whether the emitter is currently emitting particles.
+ * It is totally safe to directly toggle this.
+ * @property {boolean} on
+ * @default
+ */
+ this.on = false;
+
+ /**
+ * Determines whether the emitter is being updated by the core game loop.
+ * @property {boolean} exists
+ * @default
+ */
+ this.exists = true;
+
+ /**
+ * The point the particles are emitted from.
+ * Emitter.x and Emitter.y control the containers location, which updates all current particles
+ * Emitter.emitX and Emitter.emitY control the emission location relative to the x/y position.
+ * @property {boolean} emitX
+ */
+ this.emitX = x;
+
+ /**
+ * The point the particles are emitted from.
+ * Emitter.x and Emitter.y control the containers location, which updates all current particles
+ * Emitter.emitX and Emitter.emitY control the emission location relative to the x/y position.
+ * @property {boolean} emitY
+ */
+ this.emitY = y;
+
+};
+
+Phaser.Particles.Arcade.Emitter.prototype = Object.create(Phaser.Group.prototype);
+Phaser.Particles.Arcade.Emitter.prototype.constructor = Phaser.Particles.Arcade.Emitter;
+
+/**
+* Called automatically by the game loop, decides when to launch particles and when to "die".
+* @method Phaser.Particles.Arcade.Emitter#update
+*/
+Phaser.Particles.Arcade.Emitter.prototype.update = function () {
+
+ if (this.on)
+ {
+ if (this._explode)
+ {
+ this._counter = 0;
+
+ do
+ {
+ this.emitParticle();
+ this._counter++;
+ }
+ while (this._counter < this._quantity);
+
+ this.on = false;
+ }
+ else
+ {
+ if (this.game.time.now >= this._timer)
+ {
+ this.emitParticle();
+
+ this._counter++;
+
+ if (this._quantity > 0)
+ {
+ if (this._counter >= this._quantity)
+ {
+ this.on = false;
+ }
+ }
+
+ this._timer = this.game.time.now + this.frequency;
+ }
+ }
+ }
+
+}
+
+/**
+* This function generates a new array of particle sprites to attach to the emitter.
+*
+* @method Phaser.Particles.Arcade.Emitter#makeParticles
+* @param {Description} keys - Description.
+* @param {number} frames - Description.
+* @param {number} quantity - The number of particles to generate when using the "create from image" option.
+* @param {number} collide - Description.
+* @param {boolean} collideWorldBounds - Description.
+* @return This Emitter instance (nice for chaining stuff together, if you're into that).
+*/
+Phaser.Particles.Arcade.Emitter.prototype.makeParticles = function (keys, frames, quantity, collide, collideWorldBounds) {
+
+ if (typeof frames == 'undefined')
+ {
+ frames = 0;
+ }
+
+ quantity = quantity || this.maxParticles;
+ collide = collide || 0;
+
+ if (typeof collideWorldBounds == 'undefined')
+ {
+ collideWorldBounds = false;
+ }
+
+ var particle;
+ var i = 0;
+ var rndKey = keys;
+ var rndFrame = 0;
+
+ while (i < quantity)
+ {
+ if (this.particleClass == null)
+ {
+ if (typeof keys == 'object')
+ {
+ rndKey = this.game.rnd.pick(keys);
+ }
+
+ if (typeof frames == 'object')
+ {
+ rndFrame = this.game.rnd.pick(frames);
+ }
+
+ particle = new Phaser.Sprite(this.game, 0, 0, rndKey, rndFrame);
+ }
+ else
+ {
+ // particle = new this.particleClass(this.game);
+ }
+
+ if (collide > 0)
+ {
+ particle.body.allowCollision.any = true;
+ particle.body.allowCollision.none = false;
+ }
+ else
+ {
+ particle.body.allowCollision.none = true;
+ }
+
+ particle.body.collideWorldBounds = collideWorldBounds;
+
+ particle.exists = false;
+ particle.visible = false;
+
+ // Center the origin for rotation assistance
+ particle.anchor.setTo(0.5, 0.5);
+
+ this.add(particle);
+
+ i++;
+ }
+
+ return this;
+}
+
+/**
+ * Call this function to turn off all the particles and the emitter.
+ * @method Phaser.Particles.Arcade.Emitter#kill
+ */
+Phaser.Particles.Arcade.Emitter.prototype.kill = function () {
+
+ this.on = false;
+ this.alive = false;
+ this.exists = false;
+
+}
+
+/**
+ * Handy for bringing game objects "back to life". Just sets alive and exists back to true.
+ * In practice, this is most often called by <code>Object.reset()</code>.
+ * @method Phaser.Particles.Arcade.Emitter#revive
+ */
+Phaser.Particles.Arcade.Emitter.prototype.revive = function () {
+
+ this.alive = true;
+ this.exists = true;
+
+}
+
+/**
+ * Call this function to start emitting particles.
+ * @method Phaser.Particles.Arcade.Emitter#start
+ * @param {boolean} explode - Whether the particles should all burst out at once.
+ * @param {number} lifespan - How long each particle lives once emitted. 0 = forever.
+ * @param {number} frequency - Ignored if Explode is set to true. Frequency is how often to emit a particle in ms.
+ * @param {number} quantity - How many particles to launch. 0 = "all of the particles".
+ */
+Phaser.Particles.Arcade.Emitter.prototype.start = function (explode, lifespan, frequency, quantity) {
+
+ if (typeof explode !== 'boolean')
+ {
+ explode = true;
+ }
+
+ lifespan = lifespan || 0;
+
+ // How many ms between emissions?
+ frequency = frequency || 250;
+
+ // Total number of particles to emit
+ quantity = quantity || 0;
+
+ this.revive();
+
+ this.visible = true;
+ this.on = true;
+
+ this._explode = explode;
+ this.lifespan = lifespan;
+ this.frequency = frequency;
+
+ if (explode)
+ {
+ this._quantity = quantity;
+ }
+ else
+ {
+ this._quantity += quantity;
+ }
+
+ this._counter = 0;
+ this._timer = this.game.time.now + frequency;
+
+}
+
+/**
+ * This function can be used both internally and externally to emit the next particle.
+ * @method Phaser.Particles.Arcade.Emitter#emitParticle
+ */
+Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () {
+
+ var particle = this.getFirstExists(false);
+
+ if (particle == null)
+ {
+ return;
+ }
+
+ if (this.width > 1 || this.height > 1)
+ {
+ particle.reset(this.game.rnd.integerInRange(this.left, this.right), this.game.rnd.integerInRange(this.top, this.bottom));
+ }
+ else
+ {
+ particle.reset(this.emitX, this.emitY);
+ }
+
+ particle.lifespan = this.lifespan;
+
+ particle.body.bounce.setTo(this.bounce.x, this.bounce.y);
+
+ if (this.minParticleSpeed.x != this.maxParticleSpeed.x)
+ {
+ particle.body.velocity.x = this.game.rnd.integerInRange(this.minParticleSpeed.x, this.maxParticleSpeed.x);
+ }
+ else
+ {
+ particle.body.velocity.x = this.minParticleSpeed.x;
+ }
+
+ if (this.minParticleSpeed.y != this.maxParticleSpeed.y)
+ {
+ particle.body.velocity.y = this.game.rnd.integerInRange(this.minParticleSpeed.y, this.maxParticleSpeed.y);
+ }
+ else
+ {
+ particle.body.velocity.y = this.minParticleSpeed.y;
+ }
+
+ particle.body.gravity.y = this.gravity;
+
+ if (this.minRotation != this.maxRotation)
+ {
+ particle.body.angularVelocity = this.game.rnd.integerInRange(this.minRotation, this.maxRotation);
+ }
+ else
+ {
+ particle.body.angularVelocity = this.minRotation;
+ }
+
+ if (this.minParticleScale !== 1 || this.maxParticleScale !== 1)
+ {
+ var scale = this.game.rnd.realInRange(this.minParticleScale, this.maxParticleScale);
+ particle.scale.setTo(scale, scale);
+ }
+
+ particle.body.drag.x = this.particleDrag.x;
+ particle.body.drag.y = this.particleDrag.y;
+ particle.body.angularDrag = this.angularDrag;
+
+}
+
+/**
+* A more compact way of setting the width and height of the emitter.
+* @method Phaser.Particles.Arcade.Emitter#setSize
+* @param {number} width - The desired width of the emitter (particles are spawned randomly within these dimensions).
+* @param {number} height - The desired height of the emitter.
+*/
+Phaser.Particles.Arcade.Emitter.prototype.setSize = function (width, height) {
+
+ this.width = width;
+ this.height = height;
+
+}
+
+/**
+* A more compact way of setting the X velocity range of the emitter.
+* @method Phaser.Particles.Arcade.Emitter#setXSpeed
+* @param {number} min - The minimum value for this range.
+* @param {number} max - The maximum value for this range.
+*/
+Phaser.Particles.Arcade.Emitter.prototype.setXSpeed = function (min, max) {
+
+ min = min || 0;
+ max = max || 0;
+
+ this.minParticleSpeed.x = min;
+ this.maxParticleSpeed.x = max;
+
+}
+
+/**
+* A more compact way of setting the Y velocity range of the emitter.
+* @method Phaser.Particles.Arcade.Emitter#setYSpeed
+* @param {number} min - The minimum value for this range.
+* @param {number} max - The maximum value for this range.
+*/
+Phaser.Particles.Arcade.Emitter.prototype.setYSpeed = function (min, max) {
+
+ min = min || 0;
+ max = max || 0;
+
+ this.minParticleSpeed.y = min;
+ this.maxParticleSpeed.y = max;
+
+}
+
+/**
+* A more compact way of setting the angular velocity constraints of the emitter.
+* @method Phaser.Particles.Arcade.Emitter#setRotation
+* @param {number} min - The minimum value for this range.
+* @param {number} max - The maximum value for this range.
+*/
+Phaser.Particles.Arcade.Emitter.prototype.setRotation = function (min, max) {
+
+ min = min || 0;
+ max = max || 0;
+
+ this.minRotation = min;
+ this.maxRotation = max;
+
+}
+
+/**
+* Change the emitter's midpoint to match the midpoint of a <code>Object</code>.
+* @method Phaser.Particles.Arcade.Emitter#at
+* @param {object} object - The <code>Object</code> that you want to sync up with.
+*/
+Phaser.Particles.Arcade.Emitter.prototype.at = function (object) {
+
+ this.emitX = object.center.x;
+ this.emitY = object.center.y;
+
+}
+
+/**
+* The emitters alpha value.
+* @name Phaser.Particles.Arcade.Emitter#alpha
+* @property {number} alpha - Gets or sets the alpha value of the Emitter.
+*/
+Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "alpha", {
+
+ get: function () {
+ return this._container.alpha;
+ },
+
+ set: function (value) {
+ this._container.alpha = value;
+ }
+
+});
+
+/**
+* The emitter visible state.
+* @name Phaser.Particles.Arcade.Emitter#visible
+* @property {boolean} visible - Gets or sets the Emitter visible state.
+*/
+Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "visible", {
+
+ get: function () {
+ return this._container.visible;
+ },
+
+ set: function (value) {
+ this._container.visible = value;
+ }
+
+});
+
+/**
+* @name Phaser.Particles.Arcade.Emitter#x
+* @property {number} x - Gets or sets the x position of the Emitter.
+*/
+Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "x", {
+
+ get: function () {
+ return this.emitX;
+ },
+
+ set: function (value) {
+ this.emitX = value;
+ }
+
+});
+
+/**
+* @name Phaser.Particles.Arcade.Emitter#y
+* @property {number} y - Gets or sets the y position of the Emitter.
+*/
+Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "y", {
+
+ get: function () {
+ return this.emitY;
+ },
+
+ set: function (value) {
+ this.emitY = value;
+ }
+
+});
+
+/**
+* @name Phaser.Particles.Arcade.Emitter#left
+* @property {number} left - Gets the left position of the Emitter.
+* @readonly
+*/
+Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "left", {
+
+ get: function () {
+ return Math.floor(this.x - (this.width / 2));
+ }
+
+});
+
+/**
+* @name Phaser.Particles.Arcade.Emitter#right
+* @property {number} right - Gets the right position of the Emitter.
+* @readonly
+*/
+Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "right", {
+
+ get: function () {
+ return Math.floor(this.x + (this.width / 2));
+ }
+
+});
+
+/**
+* @name Phaser.Particles.Arcade.Emitter#top
+* @property {number} top - Gets the top position of the Emitter.
+* @readonly
+*/
+Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "top", {
+
+ get: function () {
+ return Math.floor(this.y - (this.height / 2));
+ }
+
+});
+
+/**
+* @name Phaser.Particles.Arcade.Emitter#bottom
+* @property {number} bottom - Gets the bottom position of the Emitter.
+* @readonly
+*/
+Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", {
+
+ get: function () {
+ return Math.floor(this.y + (this.height / 2));
+ }
+
+});
+
/**
+* @author Richard Davey <rich@photonstorm.com>
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
+* Description of Phaser.Net
+*
+* @class Phaser.Net
+* @constructor
+* @param {Phaser.Game} game - A reference to the currently running game.
+*/
+Phaser.Net = function (game) {
+
+ this.game = game;
+
+};
+
+Phaser.Net.prototype = {
+
+ /**
+ * Returns the hostname given by the browser.
+ *
+ * @method Phaser.Net#getHostName
+ * @return {string}
+ */
+ getHostName: function () {
+
+ if (window.location && window.location.hostname) {
+ return window.location.hostname;
+ }
+
+ return null;
+
+ },
+
+ /**
+ * Compares the given domain name against the hostname of the browser containing the game.
+ * If the domain name is found it returns true.
+ * You can specify a part of a domain, for example 'google' would match 'google.com', 'google.co.uk', etc.
+ * Do not include 'http://' at the start.
+ *
+ * @method Phaser.Net#checkDomainName
+ * @param {string} domain
+ * @return {boolean}
+ */
+ checkDomainName: function (domain) {
+ return window.location.hostname.indexOf(domain) !== -1;
+ },
+
+ /**
+ * Updates a value on the Query String and returns it in full.
+ * If the value doesn't already exist it is set.
+ * If the value exists it is replaced with the new value given. If you don't provide a new value it is removed from the query string.
+ * Optionally you can redirect to the new url, or just return it as a string.
+ *
+ * @method Phaser.Net#updateQueryString
+ * @param {string} key - The querystring key to update.
+ * @param {string} value - The new value to be set. If it already exists it will be replaced.
+ * @param {boolean} redirect - If true the browser will issue a redirect to the url with the new querystring.
+ * @param {string} url - The URL to modify. If none is given it uses window.location.href.
+ * @return {string} If redirect is false then the modified url and query string is returned.
+ */
+ updateQueryString: function (key, value, redirect, url) {
+
+ if (typeof redirect === "undefined") { redirect = false; }
+ if (typeof url === "undefined") { url = ''; }
+
+ if (url == '') {
+ url = window.location.href;
+ }
+
+ var output = '';
+ var re = new RegExp("([?|&])" + key + "=.*?(&|#|$)(.*)", "gi");
+
+ if (re.test(url))
+ {
+ if (typeof value !== 'undefined' && value !== null)
+ {
+ output = url.replace(re, '$1' + key + "=" + value + '$2$3');
+ }
+ else
+ {
+ output = url.replace(re, '$1$3').replace(/(&|\?)$/, '');
+ }
+ }
+ else
+ {
+ if (typeof value !== 'undefined' && value !== null)
+ {
+ var separator = url.indexOf('?') !== -1 ? '&' : '?';
+ var hash = url.split('#');
+ url = hash[0] + separator + key + '=' + value;
+
+ if (hash[1]) {
+ url += '#' + hash[1];
+ }
+
+ output = url;
+
+ }
+ else
+ {
+ output = url;
+ }
+ }
+
+ if (redirect)
+ {
+ window.location.href = output;
+ }
+ else
+ {
+ return output;
+ }
+
+ },
+
+ /**
+ * Returns the Query String as an object.
+ * If you specify a parameter it will return just the value of that parameter, should it exist.
+ *
+ * @method Phaser.Net#getQueryString
+ * @param {string} [parameter=''] - If specified this will return just the value for that key.
+ * @return {string|object} An object containing the key value pairs found in the query string or just the value if a parameter was given.
+ */
+ getQueryString: function (parameter) {
+
+ if (typeof parameter === "undefined") { parameter = ''; }
+
+ var output = {};
+ var keyValues = location.search.substring(1).split('&');
+
+ for (var i in keyValues) {
+
+ var key = keyValues[i].split('=');
+
+ if (key.length > 1)
+ {
+ if (parameter && parameter == this.decodeURI(key[0]))
+ {
+ return this.decodeURI(key[1]);
+ }
+ else
+ {
+ output[this.decodeURI(key[0])] = this.decodeURI(key[1]);
+ }
+ }
+ }
+
+ return output;
+
+ },
+
+ /**
+ * Returns the Query String as an object.
+ * If you specify a parameter it will return just the value of that parameter, should it exist.
+ *
+ * @method Phaser.Net#decodeURI
+ * @param {string} value - The URI component to be decoded.
+ * @return {string} The decoded value.
+ */
+ decodeURI: function (value) {
+ return decodeURIComponent(value.replace(/\+/g, " "));
+ }
+
+};
+
+
@@ -1679,7 +1705,7 @@ The frames are returned in the output array, or if none is provided in a new Arr
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:48 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.Parser.html b/Docs/out/Phaser.Animation.Parser.html
index caef70a4..1ceb07e3 100644
--- a/Docs/out/Phaser.Animation.Parser.html
+++ b/Docs/out/Phaser.Animation.Parser.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -2563,7 +2589,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:48 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.AnimationManager.html b/Docs/out/Phaser.AnimationManager.html
index c5283576..21b11093 100644
--- a/Docs/out/Phaser.AnimationManager.html
+++ b/Docs/out/Phaser.AnimationManager.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -2387,7 +2413,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:48 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Cache.html b/Docs/out/Phaser.Cache.html
index 4e47de0b..b7d33f00 100644
--- a/Docs/out/Phaser.Cache.html
+++ b/Docs/out/Phaser.Cache.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -6044,7 +6070,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:48 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:23 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Camera.html b/Docs/out/Phaser.Camera.html
index 6e4a4542..11e09604 100644
--- a/Docs/out/Phaser.Camera.html
+++ b/Docs/out/Phaser.Camera.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -2814,7 +2840,7 @@ without having to use game.camera.x and game.camera.y.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:48 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:23 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Circle.html b/Docs/out/Phaser.Circle.html
index 7e121a29..90d3165f 100644
--- a/Docs/out/Phaser.Circle.html
+++ b/Docs/out/Phaser.Circle.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -4064,7 +4090,7 @@ This method checks the radius distances between the two Circle objects to see if
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:48 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:23 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Game.html b/Docs/out/Phaser.Game.html
index 21059ca9..6728a4c5 100644
--- a/Docs/out/Phaser.Game.html
+++ b/Docs/out/Phaser.Game.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -2101,7 +2127,7 @@ providing quick access to common functions and handling the boot process.
-Phaser.Net
+Phaser.Net
@@ -2308,7 +2334,7 @@ providing quick access to common functions and handling the boot process.
-Phaser.Particles
+Phaser.Particles
@@ -4251,7 +4277,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:49 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:23 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Group.html b/Docs/out/Phaser.Group.html
index a21d562c..f74d30af 100644
--- a/Docs/out/Phaser.Group.html
+++ b/Docs/out/Phaser.Group.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -6177,7 +6203,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:49 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:23 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Input.html b/Docs/out/Phaser.Input.html
index 40477488..6a18fc24 100644
--- a/Docs/out/Phaser.Input.html
+++ b/Docs/out/Phaser.Input.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -7349,7 +7375,7 @@ If you need more then use this to create a new one, up to a maximum of 10.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:49 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:23 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.InputHandler.html b/Docs/out/Phaser.InputHandler.html
index 694217dd..e51d45c4 100644
--- a/Docs/out/Phaser.InputHandler.html
+++ b/Docs/out/Phaser.InputHandler.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -7265,7 +7291,7 @@ This value is only set when the pointer is over this Sprite.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:49 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:23 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Key.html b/Docs/out/Phaser.Key.html
index 19018940..a83ce97a 100644
--- a/Docs/out/Phaser.Key.html
+++ b/Docs/out/Phaser.Key.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -2312,7 +2338,7 @@ If the key is up it holds the duration of the previous down session.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:49 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:23 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Keyboard.html b/Docs/out/Phaser.Keyboard.html
index 85c4a6e6..ff5aa14f 100644
--- a/Docs/out/Phaser.Keyboard.html
+++ b/Docs/out/Phaser.Keyboard.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -2647,7 +2673,7 @@ This is called automatically by Phaser.Input and should not normally be invoked
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:49 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.LinkedList.html b/Docs/out/Phaser.LinkedList.html
index 0d8ac21c..c352407c 100644
--- a/Docs/out/Phaser.LinkedList.html
+++ b/Docs/out/Phaser.LinkedList.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -1231,7 +1257,7 @@ The function must exist on the member.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:49 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Loader.Parser.html b/Docs/out/Phaser.Loader.Parser.html
index d57061cc..d79e3bfe 100644
--- a/Docs/out/Phaser.Loader.Parser.html
+++ b/Docs/out/Phaser.Loader.Parser.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -5284,7 +5310,7 @@ This allows you to easily make loading bars for games.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:49 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.MSPointer.html b/Docs/out/Phaser.MSPointer.html
index 81647a65..e1793953 100644
--- a/Docs/out/Phaser.MSPointer.html
+++ b/Docs/out/Phaser.MSPointer.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -1496,7 +1522,7 @@ It will work only in Internet Explorer 10 and Windows Store or Windows Phone 8 a
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Math.html b/Docs/out/Phaser.Math.html
index c61098b5..6beaaa7c 100644
--- a/Docs/out/Phaser.Math.html
+++ b/Docs/out/Phaser.Math.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -9775,7 +9801,7 @@ Should be called whenever the angle is updated on the Sprite to stop it from goi
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Mouse.html b/Docs/out/Phaser.Mouse.html
index 5cb5eea9..6672d770 100644
--- a/Docs/out/Phaser.Mouse.html
+++ b/Docs/out/Phaser.Mouse.html
@@ -122,6 +122,18 @@
MSPointer
+
Compares the given domain name against the hostname of the browser containing the game.
+If the domain name is found it returns true.
+You can specify a part of a domain, for example 'google' would match 'google.com', 'google.co.uk', etc.
+Do not include 'http://' at the start.
Updates a value on the Query String and returns it in full.
+If the value doesn't already exist it is set.
+If the value exists it is replaced with the new value given. If you don't provide a new value it is removed from the query string.
+Optionally you can redirect to the new url, or just return it as a string.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
key
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
The querystring key to update.
+
+
+
+
+
+
+
value
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
The new value to be set. If it already exists it will be replaced.
+
+
+
+
+
+
+
redirect
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+
+
If true the browser will issue a redirect to the url with the new querystring.
+
+
+
+
+
+
+
url
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
The URL to modify. If none is given it uses window.location.href.
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.
The angle of rotation of the Group container. This will adjust the Group container itself by modifying its rotation.
+This will have no impact on the rotation value of its children, but it will update their worldTransform and on-screen position.
+
+
+
+
+
+
+
+
+
+
Properties:
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
angle
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
The angle of rotation given in degrees, where 0 degrees = to the right.
The point the particles are emitted from.
+Emitter.x and Emitter.y control the containers location, which updates all current particles
+Emitter.emitX and Emitter.emitY control the emission location relative to the x/y position.
The point the particles are emitted from.
+Emitter.x and Emitter.y control the containers location, which updates all current particles
+Emitter.emitX and Emitter.emitY control the emission location relative to the x/y position.
The angle of rotation of the Group container. This will adjust the Group container itself by modifying its rotation.
+This will have no impact on the rotation value of its children, but it will update their worldTransform and on-screen position.
Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.
+The child is automatically added to the top of the Group, so renders on-top of everything else within the Group. If you need to control
+that then see the addAt method.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
child
+
+
+
+
+
+*
+
+
+
+
+
+
+
+
+
+
An instance of Phaser.Sprite, Phaser.Button or any other display object..
Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object.
+The child is added to the Group at the location specified by the index value, this allows you to control child ordering.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
child
+
+
+
+
+
+*
+
+
+
+
+
+
+
+
+
+
An instance of Phaser.Sprite, Phaser.Button or any other display object..
+
+
+
+
+
+
+
index
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
The index within the Group to insert the child to.
Calls a function on all of the children regardless if they are dead or alive (see callAllExists if you need control over that)
+After the callback parameter you can add as many extra parameters as you like, which will all be passed to the child.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Argument
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
callback
+
+
+
+
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The function that exists on the children that will be called.
+
+
+
+
+
+
+
parameter
+
+
+
+
+
+*
+
+
+
+
+
+
+
+
+
+
+
+
+ <repeatable>
+
+
+
+
+
+
+
Additional parameters that will be passed to the callback.
Calls a function on all of the children that have exists=true in this Group.
+After the existsValue parameter you can add as many parameters as you like, which will all be passed to the child callback.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Argument
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
callback
+
+
+
+
+
+function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The function that exists on the children that will be called.
+
+
+
+
+
+
+
existsValue
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Only children with exists=existsValue will be called.
+
+
+
+
+
+
+
parameter
+
+
+
+
+
+*
+
+
+
+
+
+
+
+
+
+
+
+
+ <repeatable>
+
+
+
+
+
+
+
Additional parameters that will be passed to the callback.
The number of children flagged as alive. Returns -1 if Group is empty.
+
+
+
+
+
+
+ Type
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
create(x, y, key, frame, exists) → {Phaser.Sprite}
+
+
+
+
+
+
+
+
Automatically creates a new Phaser.Sprite object and adds it to the top of this Group.
+Useful if you don't need to create the Sprite instances before-hand.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Argument
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
x
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The x coordinate to display the newly created Sprite at. The value is in relation to the Group.x point.
+
+
+
+
+
+
+
y
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The y coordinate to display the newly created Sprite at. The value is in relation to the Group.y point.
+
+
+
+
+
+
+
key
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The Game.cache key of the image that this Sprite will use.
+
+
+
+
+
+
+
frame
+
+
+
+
+
+number
+|
+
+string
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
If the Sprite image contains multiple frames you can specify which one to use here.
Allows you to call your own function on each member of this Group. You must pass the callback and context in which it will run.
+After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child.
+For example: Group.forEach(awardBonusGold, this, true, 100, 500)
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
callback
+
+
+
+
+
+function
+
+
+
+
+
+
+
+
+
+
The function that will be called. Each child of the Group will be passed to it as its first parameter.
+
+
+
+
+
+
+
callbackContext
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
The context in which the function should be called (usually 'this').
+
+
+
+
+
+
+
checkExists
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+
+
If set only children with exists=true will be passed to the callback, otherwise all children will be passed.
Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run.
+You can add as many parameters as you like, which will all be passed to the callback along with the child.
+For example: Group.forEachAlive(causeDamage, this, 500)
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
callback
+
+
+
+
+
+function
+
+
+
+
+
+
+
+
+
+
The function that will be called. Each child of the Group will be passed to it as its first parameter.
+
+
+
+
+
+
+
callbackContext
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
The context in which the function should be called (usually 'this').
Allows you to call your own function on each dead member of this Group (where alive=false). You must pass the callback and context in which it will run.
+You can add as many parameters as you like, which will all be passed to the callback along with the child.
+For example: Group.forEachDead(bringToLife, this)
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
callback
+
+
+
+
+
+function
+
+
+
+
+
+
+
+
+
+
The function that will be called. Each child of the Group will be passed to it as its first parameter.
+
+
+
+
+
+
+
callbackContext
+
+
+
+
+
+Object
+
+
+
+
+
+
+
+
+
+
The context in which the function should be called (usually 'this').
Call this function to retrieve the first object with alive == true in the group.
+This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.
Call this function to retrieve the first object with alive == false in the group.
+This is handy for checking if everything has been wiped out, or choosing a squad leader, etc.
Handy for bringing game objects "back to life". Just sets alive and exists back to true.
+In practice, this is most often called by <code>Object.reset()</code>.
This function allows you to quickly set the same property across all children of this Group to a new value.
+The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Argument
+
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
+
+
+
key
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The property, as a string, to be set. For example: 'body.velocity.x'
+
+
+
+
+
+
+
value
+
+
+
+
+
+*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The value that will be set.
+
+
+
+
+
+
+
checkAlive
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
If set then only children with alive=true will be updated.
+
+
+
+
+
+
+
checkVisible
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
If set then only children with visible=true will be updated.
+
+
+
+
+
+
+
operation
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.
Sets the given property to the given value on the child. The operation controls the assignment of the value.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Argument
+
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
+
+
+
child
+
+
+
+
+
+*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The child to set the property value on.
+
+
+
+
+
+
+
key
+
+
+
+
+
+array
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
An array of strings that make up the property that will be set.
+
+
+
+
+
+
+
value
+
+
+
+
+
+*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The value that will be set.
+
+
+
+
+
+
+
operation
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.
+
@@ -1583,7 +1609,7 @@ It is only called if active is set to true.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.PluginManager.html b/Docs/out/Phaser.PluginManager.html
index d8d8fa6d..3a3300aa 100644
--- a/Docs/out/Phaser.PluginManager.html
+++ b/Docs/out/Phaser.PluginManager.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -1213,7 +1239,7 @@ It only calls plugins who have active=true.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Point.html b/Docs/out/Phaser.Point.html
index 45ed2892..6063824a 100644
--- a/Docs/out/Phaser.Point.html
+++ b/Docs/out/Phaser.Point.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -1082,7 +1108,7 @@ Split the node into 4 subnodes
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.RandomDataGenerator.html b/Docs/out/Phaser.RandomDataGenerator.html
index 78a59b50..767820c1 100644
--- a/Docs/out/Phaser.RandomDataGenerator.html
+++ b/Docs/out/Phaser.RandomDataGenerator.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -1775,7 +1801,7 @@ Random number generator from
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Rectangle.html b/Docs/out/Phaser.Rectangle.html
index 86a9e11e..c467e6c3 100644
--- a/Docs/out/Phaser.Rectangle.html
+++ b/Docs/out/Phaser.Rectangle.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -7114,7 +7140,7 @@ This method checks the x, y, width, and height properties of the Rectangles.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Signal.html b/Docs/out/Phaser.Signal.html
index 36759985..96bbe916 100644
--- a/Docs/out/Phaser.Signal.html
+++ b/Docs/out/Phaser.Signal.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -1259,7 +1285,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.State.html b/Docs/out/Phaser.State.html
index b56a03ab..20a5394d 100644
--- a/Docs/out/Phaser.State.html
+++ b/Docs/out/Phaser.State.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -2350,7 +2376,7 @@ If you need to use the loader, you may need to use them here.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:50 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.StateManager.html b/Docs/out/Phaser.StateManager.html
index 13118bc9..858397de 100644
--- a/Docs/out/Phaser.StateManager.html
+++ b/Docs/out/Phaser.StateManager.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -2322,7 +2348,7 @@ Doesn't appear to be supported by most browsers on a canvas element yet.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:51 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.World.html b/Docs/out/Phaser.World.html
index eeaae839..4c552797 100644
--- a/Docs/out/Phaser.World.html
+++ b/Docs/out/Phaser.World.html
@@ -122,6 +122,18 @@
MSPointer
+
+
@@ -1920,7 +1946,7 @@ the world at world-based coordinates. By default a world is created the same siz
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:51 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.js.html b/Docs/out/Phaser.js.html
index 434ababc..b19edd1a 100644
--- a/Docs/out/Phaser.js.html
+++ b/Docs/out/Phaser.js.html
@@ -122,6 +122,18 @@
MSPointer
+
@@ -389,7 +424,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:48 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/global.html b/Docs/out/global.html
index 934d82a9..a52f33d0 100644
--- a/Docs/out/global.html
+++ b/Docs/out/global.html
@@ -42,10 +42,154 @@
Play an animation based on the given key. The animation should previously have been added via sprite.animations.add()
-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.
-
-
-
-
-
-
-
-
-
Parameters:
-
-
-
+
@@ -262,12 +315,8 @@ If the requested animation is already playing this request will be ignored. If y
Type
-
Argument
-
-
Default
-
Description
@@ -278,42 +327,7 @@ If the requested animation is already playing this request will be ignored. If y
-
name
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
The name of the animation to be played, e.g. "fire", "walk", "jump".
-
-
-
-
-
-
-
frameRate
+
maxParticles
@@ -326,76 +340,18 @@ If the requested animation is already playing this request will be ignored. If y
-
-
- <optional>
-
-
-
-
-
-
-
-
-
- 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.
-
-
-
-
-
-
-
loop
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- null
-
-
-
-
-
Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.
+
Description.
+
-
-
-
-
@@ -416,7 +372,7 @@ If the requested animation is already playing this request will be ignored. If y
@@ -429,505 +385,6 @@ If the requested animation is already playing this request will be ignored. If y
-
-
-
-
-
-
-
-
-
Returns:
-
-
-
-
A reference to playing Animation instance.
-
-
-
-
-
-
- Type
-
-
-
-Phaser.Animation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
stop(name, resetFrame)
-
-
-
-
-
-
-
-
Stop playback of an animation. If a name is given that specific animation is stopped, otherwise the current animation is stopped.
-The currentAnim property of the AnimationManager is automatically set to the animation given.
-
-
-
-
-
-
-
-
-
Parameters:
-
-
-
-
-
-
-
Name
-
-
-
Type
-
-
-
Argument
-
-
-
-
Default
-
-
-
Description
-
-
-
-
-
-
-
-
-
name
-
-
-
-
-
-string
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- null
-
-
-
-
-
The name of the animation to be stopped, e.g. "fire". If none is given the currently running animation is stopped.
-
-
-
-
-
-
-
resetFrame
-
-
-
-
-
-boolean
-
-
-
-
-
-
-
-
- <optional>
-
-
-
-
-
-
-
-
-
-
-
- false
-
-
-
-
-
When the animation is stopped should the currentFrame be set to the first frame of the animation (true) or paused on the last frame displayed (false)
True if all given Frames are valid, otherwise false.
-
-
-
-
-
-
- Type
-
-
-
-boolean
-
-
-
-
-
-
-
-
-
@@ -936,6 +393,8 @@ The currentAnim property of the AnimationManager is automatically set to the ani
+
+
@@ -956,7 +415,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
Documentation generated by JSDoc 3.2.0-dev
- on Tue Oct 01 2013 22:11:46 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/index.html b/Docs/out/index.html
index 84a0957c..8300085a 100644
--- a/Docs/out/index.html
+++ b/Docs/out/index.html
@@ -122,6 +122,18 @@
MSPointer
+
@@ -389,7 +424,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 15:04:48 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
diff --git a/README.md b/README.md
index c3a53897..7ec78151 100644
--- a/README.md
+++ b/README.md
@@ -73,6 +73,7 @@ Version 1.0.7 (in progress in the dev branch)
* Updated build script so it can be run from the command-line and includes UMD wrappers (thanks iaincarsberg)
* Fixed bug in LinkedList#remove that could cause first to point to a dead node (thanks onedayitwillmake)
* Moved LinkedList.dump to Debug.dumpLinkedList(list)
+* Added Button.freezeFrames boolean. Stops the frames being set on mouse events if true.
* TODO: addMarker hh:mm:ss:ms
diff --git a/build/phaser.js b/build/phaser.js
index 52fb8bc9..aafc42ff 100644
--- a/build/phaser.js
+++ b/build/phaser.js
@@ -1,7 +1,14 @@
+/**
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+* @module Phaser.Intro
+*/
+
/**
* Phaser - http://www.phaser.io
*
-* v1.0.7 - Built at: Tue, 01 Oct 2013 02:14:43 +0100
+* v1.0.7 - Built at: Wed, 02 Oct 2013 20:07:40 +0100
*
* @author Richard Davey http://www.photonstorm.com @photonstorm
*
@@ -37,6 +44,12 @@
*/
var PIXI = PIXI || {};
+/**
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
/**
* @module Phaser
*/
@@ -76,7 +89,7 @@ PIXI.InteractionManager = function (dummy) {
/**
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
-* @license 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.Utils
*/
@@ -88,15 +101,15 @@ PIXI.InteractionManager = function (dummy) {
Phaser.Utils = {
/**
- * Javascript string pad
- * http://www.webtoolkit.info/
- * pad = the string to pad it out with (defaults to a space)
+ * Javascript string pad ({@link http://www.webtoolkit.info/})
+ * pad = the string to pad it out with (defaults to a space)
* dir = 1 (left), 2 (right), 3 (both)
* @method pad
- * @param {string} str the target string
- * @param {number} pad the string to pad it out with (defaults to a space)
- * @param {number} len
- * @param {number} [dir=3] the direction dir = 1 (left), 2 (right), 3 (both)
+ * @param {string} str - The target string.
+ * @param {number} len - Description.
+ * @param {number} pad - the string to pad it out with (defaults to a space).
+ * @param {number} [dir=3] the direction dir = 1 (left), 2 (right), 3 (both).
+ * @return {string}
**/
pad: function (str, len, pad, dir) {
@@ -128,10 +141,11 @@ Phaser.Utils = {
},
- /**
- * This is a slightly modified version of jQuery.isPlainObject
+ /**
+ * This is a slightly modified version of jQuery.isPlainObject.
* @method isPlainObject
- * @param {object} obj
+ * @param {object} obj - Description.
+ * @return {boolean} - Description.
*/
isPlainObject: function (obj) {
@@ -162,12 +176,17 @@ Phaser.Utils = {
return true;
},
- /**
- * This is a slightly modified version of jQuery.extend (http://api.jquery.com/jQuery.extend/)
+
+ // deep, target, objects to copy to the target object
+ // This is a slightly modified version of {@link http://api.jquery.com/jQuery.extend/|jQuery.extend}
+ // deep (boolean)
+ // target (object to add to)
+ // objects ... (objects to recurse and copy from)
+
+ /**
+ * This is a slightly modified version of {@link http://api.jquery.com/jQuery.extend/|jQuery.extend}
* @method extend
- * @param {bool} [deep] If true, the merge becomes recursive (aka. deep copy).
- * @param {object} target The object to add to
- * @param {object} objets Objects to recurse and copy from
+ * @return {Description} Description.
*/
extend: function () {
@@ -248,7 +267,7 @@ Phaser.Utils = {
* Converts a hex color number to an [R, G, B] array
*
* @method HEXtoRGB
- * @param {Number} hex
+ * @param {number} hex
* @return {array}
*/
function HEXtoRGB(hex) {
@@ -587,8 +606,8 @@ PIXI.mat4.multiply = function (mat, mat2, dest)
*
* @class Point
* @constructor
- * @param x {Number} position of the point
- * @param y {Number} position of the point
+ * @param x {number} position of the point
+ * @param y {number} position of the point
*/
PIXI.Point = function(x, y)
{
@@ -631,10 +650,10 @@ PIXI.Point.prototype.constructor = PIXI.Point;
*
* @class Rectangle
* @constructor
- * @param x {Number} The X coord of the upper-left corner of the rectangle
- * @param y {Number} The Y coord of the upper-left corner of the rectangle
- * @param width {Number} The overall wisth of this rectangle
- * @param height {Number} The overall height of this rectangle
+ * @param x {number} The X coord of the upper-left corner of the rectangle
+ * @param y {number} The Y coord of the upper-left corner of the rectangle
+ * @param width {number} The overall wisth of this rectangle
+ * @param height {number} The overall height of this rectangle
*/
PIXI.Rectangle = function(x, y, width, height)
{
@@ -682,8 +701,8 @@ PIXI.Rectangle.prototype.clone = function()
* Checks if the x, and y coords passed to this function are contained within this Rectangle
*
* @method contains
- * @param x {Number} The X coord of the point to test
- * @param y {Number} The Y coord of the point to test
+ * @param x {number} The X coord of the point to test
+ * @param y {number} The Y coord of the point to test
* @return {Boolean} if the x/y coords are within this Rectangle
*/
PIXI.Rectangle.prototype.contains = function(x, y)
@@ -1358,7 +1377,7 @@ PIXI.DisplayObjectContainer.prototype.addChild = function(child)
*
* @method addChildAt
* @param child {DisplayObject} The child to add
- * @param index {Number} The index to place the child in
+ * @param index {number} The index to place the child in
*/
PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
{
@@ -1493,7 +1512,7 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
* Returns the Child at the specified index
*
* @method getChildAt
- * @param index {Number} The index to get the child from
+ * @param index {number} The index to get the child from
*/
PIXI.DisplayObjectContainer.prototype.getChildAt = function(index)
{
@@ -1799,7 +1818,7 @@ PIXI.Sprite.fromImage = function(imageId)
* @class Stage
* @extends DisplayObjectContainer
* @constructor
- * @param backgroundColor {Number} the background color of the stage, easiest way to pass this in is in hex format
+ * @param backgroundColor {number} the background color of the stage, easiest way to pass this in is in hex format
* like: 0xFFFFFF for white
* @param interactive {Boolean} enable / disable interaction (default is false)
*/
@@ -1890,7 +1909,7 @@ PIXI.Stage.prototype.updateTransform = function()
* Sets the background color for the stage
*
* @method setBackgroundColor
- * @param backgroundColor {Number} the color of the background, easiest way to pass this in is in hex format
+ * @param backgroundColor {number} the color of the background, easiest way to pass this in is in hex format
* like: 0xFFFFFF for white
*/
PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
@@ -2247,8 +2266,8 @@ PIXI.Rope.prototype.setTexture = function(texture)
* @extends DisplayObjectContainer
* @constructor
* @param texture {Texture} the texture of the tiling sprite
- * @param width {Number} the width of the tiling sprite
- * @param height {Number} the height of the tiling sprite
+ * @param width {number} the width of the tiling sprite
+ * @param height {number} the height of the tiling sprite
*/
PIXI.TilingSprite = function(texture, width, height)
{
@@ -2430,9 +2449,9 @@ PIXI.Graphics.prototype.constructor = PIXI.Graphics;
* Specifies a line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
*
* @method lineStyle
- * @param lineWidth {Number} width of the line to draw, will update the object's stored style
- * @param color {Number} color of the line to draw, will update the object's stored style
- * @param alpha {Number} alpha of the line to draw, will update the object's stored style
+ * @param lineWidth {number} width of the line to draw, will update the object's stored style
+ * @param color {number} color of the line to draw, will update the object's stored style
+ * @param alpha {number} alpha of the line to draw, will update the object's stored style
*/
PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
{
@@ -2452,8 +2471,8 @@ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
* Moves the current drawing position to (x, y).
*
* @method moveTo
- * @param x {Number} the X coord to move to
- * @param y {Number} the Y coord to move to
+ * @param x {number} the X coord to move to
+ * @param y {number} the Y coord to move to
*/
PIXI.Graphics.prototype.moveTo = function(x, y)
{
@@ -2472,8 +2491,8 @@ PIXI.Graphics.prototype.moveTo = function(x, y)
* the current drawing position is then set to (x, y).
*
* @method lineTo
- * @param x {Number} the X coord to draw to
- * @param y {Number} the Y coord to draw to
+ * @param x {number} the X coord to draw to
+ * @param y {number} the Y coord to draw to
*/
PIXI.Graphics.prototype.lineTo = function(x, y)
{
@@ -2487,7 +2506,7 @@ PIXI.Graphics.prototype.lineTo = function(x, y)
*
* @method beginFill
* @param color {uint} the color of the fill
- * @param alpha {Number} the alpha
+ * @param alpha {number} the alpha
*/
PIXI.Graphics.prototype.beginFill = function(color, alpha)
{
@@ -2511,10 +2530,10 @@ PIXI.Graphics.prototype.endFill = function()
/**
* @method drawRect
*
- * @param x {Number} The X coord of the top-left of the rectangle
- * @param y {Number} The Y coord of the top-left of the rectangle
- * @param width {Number} The width of the rectangle
- * @param height {Number} The height of the rectangle
+ * @param x {number} The X coord of the top-left of the rectangle
+ * @param y {number} The Y coord of the top-left of the rectangle
+ * @param width {number} The width of the rectangle
+ * @param height {number} The height of the rectangle
*/
PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
{
@@ -2532,9 +2551,9 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
* Draws a circle.
*
* @method drawCircle
- * @param x {Number} The X coord of the center of the circle
- * @param y {Number} The Y coord of the center of the circle
- * @param radius {Number} The radius of the circle
+ * @param x {number} The X coord of the center of the circle
+ * @param y {number} The Y coord of the center of the circle
+ * @param radius {number} The radius of the circle
*/
PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
{
@@ -2552,10 +2571,10 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
* Draws an elipse.
*
* @method drawElipse
- * @param x {Number}
- * @param y {Number}
- * @param width {Number}
- * @param height {Number}
+ * @param x {number}
+ * @param y {number}
+ * @param width {number}
+ * @param height {number}
*/
PIXI.Graphics.prototype.drawElipse = function( x, y, width, height)
{
@@ -2841,8 +2860,8 @@ PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context)
*
* @class CanvasRenderer
* @constructor
- * @param width=0 {Number} the width of the canvas view
- * @param height=0 {Number} the height of the canvas view
+ * @param width=0 {number} the width of the canvas view
+ * @param height=0 {number} the height of the canvas view
* @param view {Canvas} the canvas to use as a view, optional
* @param transparent=false {Boolean} the transparency of the render view, default false
*/
@@ -2946,8 +2965,8 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
* resizes the canvas view to the specified width and height
*
* @method resize
- * @param width {Number} the new width of the canvas view
- * @param height {Number} the new height of the canvas view
+ * @param width {number} the new width of the canvas view
+ * @param height {number} the new height of the canvas view
*/
PIXI.CanvasRenderer.prototype.resize = function(width, height)
{
@@ -4313,8 +4332,8 @@ PIXI.gl;
*
* @class WebGLRenderer
* @constructor
- * @param width=0 {Number} the width of the canvas view
- * @param height=0 {Number} the height of the canvas view
+ * @param width=0 {number} the width of the canvas view
+ * @param height=0 {number} the height of the canvas view
* @param view {Canvas} the canvas to use as a view, optional
* @param transparent=false {Boolean} the transparency of the render view, default false
* @param antialias=false {Boolean} sets antialias (only applicable in chrome at the moment)
@@ -4574,8 +4593,8 @@ PIXI.WebGLRenderer.destroyTexture = function(texture)
* resizes the webGL view to the specified width and height
*
* @method resize
- * @param width {Number} the new width of the webGL view
- * @param height {Number} the new height of the webGL view
+ * @param width {number} the new width of the webGL view
+ * @param height {number} the new height of the webGL view
*/
PIXI.WebGLRenderer.prototype.resize = function(width, height)
{
@@ -6078,9 +6097,9 @@ PIXI.BitmapText.fonts = {};
* @param [style.fill="black"] {Object} A canvas fillstyle that will be used on the text eg "red", "#00FF00"
* @param [style.align="left"] {String} An alignment of the multiline text ("left", "center" or "right")
* @param [style.stroke] {String} A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00"
- * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
+ * @param [style.strokeThickness=0] {number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
* @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
- * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap
+ * @param [style.wordWrapWidth=100] {number} The width at which text will wrap
*/
PIXI.Text = function(text, style)
{
@@ -6108,9 +6127,9 @@ PIXI.Text.prototype.constructor = PIXI.Text;
* @param [style.fill="black"] {Object} A canvas fillstyle that will be used on the text eg "red", "#00FF00"
* @param [style.align="left"] {String} An alignment of the multiline text ("left", "center" or "right")
* @param [style.stroke="black"] {String} A canvas fillstyle that will be used on the text stroke eg "blue", "#FCFF00"
- * @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
+ * @param [style.strokeThickness=0] {number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
* @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
- * @param [style.wordWrapWidth=100] {Number} The width at which text will wrap
+ * @param [style.wordWrapWidth=100] {number} The width at which text will wrap
*/
PIXI.Text.prototype.setStyle = function(style)
{
@@ -6732,8 +6751,8 @@ PIXI.Texture.frameUpdates = [];
@class RenderTexture
@extends Texture
@constructor
- @param width {Number} The width of the render texture
- @param height {Number} The height of the render texture
+ @param width {number} The width of the render texture
+ @param height {number} The height of the render texture
*/
PIXI.RenderTexture = function(width, height)
{
@@ -7170,8 +7189,7 @@ PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign)
/**
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
-* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License
-* @module Phaser.Camera
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
@@ -7179,114 +7197,109 @@ PIXI.PolyK._convex = function(ax, ay, bx, by, cx, cy, sign)
* A Camera is your view into the game world. It has a position and size and renders only those objects within its field of view.
* The game automatically creates a single Stage sized camera on boot. Move the camera around the world with Phaser.Camera.x/y
*
-* @class Camera
+* @class Phaser.Camera
* @constructor
-* @param {Phaser.Game} game game reference to the currently running game.
-* @param {number} id not being used at the moment, will be when Phaser supports multiple camera
-* @param {number} x position of the camera on the X axis
-* @param {number} y position of the camera on the Y axis
-* @param {number} width the width of the view rectangle
-* @param {number} height the height of the view rectangle
+* @param {Phaser.Game} game - Game reference to the currently running game.
+* @param {number} id - Not being used at the moment, will be when Phaser supports multiple camera
+* @param {number} x - Position of the camera on the X axis
+* @param {number} y - Position of the camera on the Y axis
+* @param {number} width - The width of the view rectangle
+* @param {number} height - The height of the view rectangle
*/
Phaser.Camera = function (game, id, x, y, width, height) {
-
- /**
- * A reference to the currently running Game.
- * @property game
- * @public
- * @type {Phaser.Game}
- */
+
+ /**
+ * @property {Phaser.Game} game - A reference to the currently running Game.
+ */
this.game = game;
- /**
- * A reference to the game world
- * @property world
- * @public
- * @type {Phaser.World}
- */
+ /**
+ * @property {Phaser.World} world - A reference to the game world.
+ */
this.world = game.world;
- /**
- * reserved for future multiple camera set-ups
- * @property id
- * @public
- * @type {number}
- */
+ /**
+ * @property {number} id - Reserved for future multiple camera set-ups.
+ * @default
+ */
this.id = 0;
- /**
- * Camera view.
- * The view into the world we wish to render (by default the game dimensions)
- * The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render
- * Objects outside of this view are not rendered (unless set to ignore the Camera, i.e. UI?)
- * @property view
- * @public
- * @type {Phaser.Rectangle}
- */
+ /**
+ * Camera view.
+ * The view into the world we wish to render (by default the game dimensions).
+ * The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render.
+ * Objects outside of this view are not rendered (unless set to ignore the Camera, i.e. UI?).
+ * @property {Phaser.Rectangle} view
+ */
this.view = new Phaser.Rectangle(x, y, width, height);
/**
- * Used by Sprites to work out Camera culling.
- * @property screenView
- * @public
- * @type {Phaser.Rectangle}
- */
+ * @property {Phaser.Rectangle} screenView - Used by Sprites to work out Camera culling.
+ */
this.screenView = new Phaser.Rectangle(x, y, width, height);
/**
- * Sprite moving inside this Rectangle will not cause camera moving.
- * @property deadzone
- * @type {Phaser.Rectangle}
- */
+ * @property {Phaser.Rectangle} deadzone - Moving inside this Rectangle will not cause camera moving.
+ */
this.deadzone = null;
- /**
- * Whether this camera is visible or not. (default is true)
- * @property visible
- * @public
- * @default true
- * @type {bool}
- */
+ /**
+ * @property {boolean} visible - Whether this camera is visible or not.
+ * @default
+ */
this.visible = true;
- /**
- * Whether this camera is flush with the World Bounds or not.
- * @property atLimit
- * @type {bool}
+ /**
+ * @property {boolean} atLimit - Whether this camera is flush with the World Bounds or not.
*/
this.atLimit = { x: false, y: false };
- /**
- * If the camera is tracking a Sprite, this is a reference to it, otherwise null
- * @property target
- * @public
- * @type {Phaser.Sprite}
+ /**
+ * @property {Phaser.Sprite} target - If the camera is tracking a Sprite, this is a reference to it, otherwise null.
+ * @default
*/
this.target = null;
- /**
- * Edge property
- * @property edge
+ /**
+ * @property {number} edge - Edge property.
* @private
- * @type {number}
+ * @default
*/
this._edge = 0;
};
-// Consts
+/**
+* @constant
+* @type {number}
+*/
Phaser.Camera.FOLLOW_LOCKON = 0;
+
+/**
+* @constant
+* @type {number}
+*/
Phaser.Camera.FOLLOW_PLATFORMER = 1;
+
+/**
+* @constant
+* @type {number}
+*/
Phaser.Camera.FOLLOW_TOPDOWN = 2;
+
+/**
+* @constant
+* @type {number}
+*/
Phaser.Camera.FOLLOW_TOPDOWN_TIGHT = 3;
Phaser.Camera.prototype = {
/**
* Tells this camera which sprite to follow.
- * @method follow
- * @param {Phaser.Sprite} target The object you want the camera to track. Set to null to not follow anything.
+ * @method Phaser.Camera#follow
+ * @param {Phaser.Sprite} target - The object you want the camera to track. Set to null to not follow anything.
* @param {number} [style] Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow().
*/
follow: function (target, style) {
@@ -7325,9 +7338,9 @@ Phaser.Camera.prototype = {
/**
* Move the camera focus to a location instantly.
- * @method focusOnXY
- * @param {number} x X position.
- * @param {number} y Y position.
+ * @method Phaser.Camera#focusOnXY
+ * @param {number} x - X position.
+ * @param {number} y - Y position.
*/
focusOnXY: function (x, y) {
@@ -7338,7 +7351,7 @@ Phaser.Camera.prototype = {
/**
* Update focusing and scrolling.
- * @method update
+ * @method Phaser.Camera#update
*/
update: function () {
@@ -7387,8 +7400,8 @@ Phaser.Camera.prototype = {
},
/**
- * Method called to ensure the camera doesn't venture outside of the game world
- * @method checkWorldBounds
+ * Method called to ensure the camera doesn't venture outside of the game world.
+ * @method Phaser.Camera#checkWorldBounds
*/
checkWorldBounds: function () {
@@ -7426,11 +7439,11 @@ Phaser.Camera.prototype = {
/**
* A helper function to set both the X and Y properties of the camera at once
- * without having to use game.camera.x and game.camera.y
+ * without having to use game.camera.x and game.camera.y.
*
- * @method setPosition
- * @param {number} x X position.
- * @param {number} y Y position.
+ * @method Phaser.Camera#setPosition
+ * @param {number} x - X position.
+ * @param {number} y - Y position.
*/
setPosition: function (x, y) {
@@ -7441,11 +7454,11 @@ Phaser.Camera.prototype = {
},
/**
- * Sets the size of the view rectangle given the width and height in parameters
+ * Sets the size of the view rectangle given the width and height in parameters.
*
- * @method setSize
- * @param {number} width The desired width.
- * @param {number} height The desired height.
+ * @method Phaser.Camera#setSize
+ * @param {number} width - The desired width.
+ * @param {number} height - The desired height.
*/
setSize: function (width, height) {
@@ -7456,19 +7469,17 @@ Phaser.Camera.prototype = {
};
+/**
+* The Cameras x coordinate. This value is automatically clamped if it falls outside of the World bounds.
+* @name Phaser.Camera#x
+* @property {number} x - Gets or sets the cameras x position.
+*/
Object.defineProperty(Phaser.Camera.prototype, "x", {
- /**
- * @method x
- * @return {Number} The x position
- */
get: function () {
return this.view.x;
},
- /**
- * @method x
- * @return {Number} Sets the camera's x position and clamp it if it's outside the world bounds
- */
+
set: function (value) {
this.view.x = value;
this.checkWorldBounds();
@@ -7476,20 +7487,17 @@ Object.defineProperty(Phaser.Camera.prototype, "x", {
});
+/**
+* The Cameras y coordinate. This value is automatically clamped if it falls outside of the World bounds.
+* @name Phaser.Camera#y
+* @property {number} y - Gets or sets the cameras y position.
+*/
Object.defineProperty(Phaser.Camera.prototype, "y", {
-
- /**
- * @method y
- * @return {Number} The y position
- */
+
get: function () {
return this.view.y;
},
- /**
- * @method y
- * @return {Number} Sets the camera's y position and clamp it if it's outside the world bounds
- */
set: function (value) {
this.view.y = value;
this.checkWorldBounds();
@@ -7497,40 +7505,34 @@ Object.defineProperty(Phaser.Camera.prototype, "y", {
});
+/**
+* The Cameras width. By default this is the same as the Game size and should not be adjusted for now.
+* @name Phaser.Camera#width
+* @property {number} width - Gets or sets the cameras width.
+*/
Object.defineProperty(Phaser.Camera.prototype, "width", {
- /**
- * @method width
- * @return {Number} The width of the view rectangle, in pixels
- */
get: function () {
return this.view.width;
},
- /**
- * @method width
- * @return {Number} Sets the width of the view rectangle
- */
set: function (value) {
this.view.width = value;
}
});
+/**
+* The Cameras height. By default this is the same as the Game size and should not be adjusted for now.
+* @name Phaser.Camera#height
+* @property {number} height - Gets or sets the cameras height.
+*/
Object.defineProperty(Phaser.Camera.prototype, "height", {
- /**
- * @method height
- * @return {Number} The height of the view rectangle, in pixels
- */
get: function () {
return this.view.height;
},
- /**
- * @method height
- * @return {Number} Sets the height of the view rectangle
- */
set: function (value) {
this.view.height = value;
}
@@ -7538,32 +7540,102 @@ Object.defineProperty(Phaser.Camera.prototype, "height", {
});
/**
-* State
-*
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
* This is a base State class which can be extended if you are creating your own game.
* It provides quick access to common functions such as the camera, cache, input, match, sound and more.
*
-* @package Phaser.State
-* @author Richard Davey
-* @copyright 2013 Photon Storm Ltd.
-* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License
+* @class Phaser.State
+* @constructor
*/
Phaser.State = function () {
+ /**
+ * @property {Phaser.Game} game - A reference to the currently running Game.
+ */
this.game = null;
+
+ /**
+ * @property {Phaser.GameObjectFactory} add - Reference to the GameObjectFactory.
+ * @default
+ */
this.add = null;
+
+ /**
+ * @property {Phaser.Physics.PhysicsManager} camera - A handy reference to world.camera.
+ * @default
+ */
this.camera = null;
+
+ /**
+ * @property {Phaser.Cache} cache - Reference to the assets cache.
+ * @default
+ */
this.cache = null;
+
+ /**
+ * @property {Phaser.Input} input - Reference to the input manager
+ * @default
+ */
this.input = null;
+
+ /**
+ * @property {Phaser.Loader} load - Reference to the assets loader.
+ * @default
+ */
this.load = null;
+
+ /**
+ * @property {Phaser.GameMath} math - Reference to the math helper.
+ * @default
+ */
this.math = null;
+
+ /**
+ * @property {Phaser.SoundManager} sound - Reference to the sound manager.
+ * @default
+ */
this.sound = null;
+
+ /**
+ * @property {Phaser.Stage} stage - Reference to the stage.
+ * @default
+ */
this.stage = null;
+
+ /**
+ * @property {Phaser.TimeManager} time - Reference to game clock.
+ * @default
+ */
this.time = null;
+
+ /**
+ * @property {Phaser.TweenManager} tweens - Reference to the tween manager.
+ * @default
+ */
this.tweens = null;
+
+ /**
+ * @property {Phaser.World} world - Reference to the world.
+ * @default
+ */
this.world = null;
+
+ /**
+ * @property {Description} add - Description.
+ * @default
+ */
this.particles = null;
+
+ /**
+ * @property {Phaser.Physics.PhysicsManager} physics - Reference to the physics manager.
+ * @default
+ */
this.physics = null;
};
@@ -7573,47 +7645,96 @@ Phaser.State.prototype = {
/**
* Override this method to add some load operations.
* If you need to use the loader, you may need to use them here.
+ *
+ * @method Phaser.State#preload
*/
preload: function () {
},
+ /**
+ * Put update logic here.
+ *
+ * @method Phaser.State#loadUpdate
+ */
+ loadUpdate: function () {
+ },
+
+ /**
+ * Put render operations here.
+ *
+ * @method Phaser.State#loadRender
+ */
+ loadRender: function () {
+ },
+
/**
* This method is called after the game engine successfully switches states.
- * Feel free to add any setup code here.(Do not load anything here, override preload() instead)
+ * Feel free to add any setup code here (do not load anything here, override preload() instead).
+ *
+ * @method Phaser.State#create
*/
create: function () {
},
/**
* Put update logic here.
+ *
+ * @method Phaser.State#update
*/
update: function () {
},
/**
* Put render operations here.
+ *
+ * @method Phaser.State#render
*/
render: function () {
},
/**
* This method will be called when game paused.
+ *
+ * @method Phaser.State#paused
*/
paused: function () {
},
/**
- * This method will be called when the state is destroyed
+ * This method will be called when the state is destroyed.
+ * @method Phaser.State#destroy
*/
destroy: function () {
}
};
+/**
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
+* The State Manager is responsible for loading, setting up and switching game states.
+*
+* @class Phaser.StateManager
+* @constructor
+* @param {Phaser.Game} game - A reference to the currently running game.
+* @param {Phaser.State|Object} [pendingState=null] - A State object to seed the manager with.
+*/
Phaser.StateManager = function (game, pendingState) {
+ /**
+ * A reference to the currently running game.
+ * @property {Phaser.Game} game.
+ */
this.game = game;
+ /**
+ * Description.
+ * @property {Description} states.
+ */
this.states = {};
if (pendingState !== null)
@@ -7626,94 +7747,102 @@ Phaser.StateManager = function (game, pendingState) {
Phaser.StateManager.prototype = {
/**
- * @type {Phaser.Game}
+ * A reference to the currently running game.
+ * @property {Phaser.Game} game.
*/
game: null,
/**
* The state to be switched to in the next frame.
- * @type {State}
+ * @property {State} _pendingState
+ * @private
*/
_pendingState: null,
/**
* Flag that sets if the State has been created or not.
- * @type {Boolean}
+ * @property {boolean}_created
+ * @private
*/
_created: false,
/**
* The state to be switched to in the next frame.
- * @type {Object}
+ * @property {Description} states
*/
states: {},
/**
- * The current active State object (defaults to null)
- * @type {String}
+ * The current active State object (defaults to null).
+ * @property {string} current
*/
current: '',
/**
- * This will be called when the state is started (i.e. set as the current active state)
- * @type {function}
+ * This will be called when the state is started (i.e. set as the current active state).
+ * @property {function} onInitCallback
*/
onInitCallback: null,
/**
- * This will be called when init states. (loading assets...)
- * @type {function}
+ * This will be called when init states (loading assets...).
+ * @property {function} onPreloadCallback
*/
onPreloadCallback: null,
/**
- * This will be called when create states. (setup states...)
- * @type {function}
+ * This will be called when create states (setup states...).
+ * @property {function} onCreateCallback
*/
onCreateCallback: null,
/**
- * This will be called when State is updated, this doesn't happen during load (see onLoadUpdateCallback)
- * @type {function}
+ * This will be called when State is updated, this doesn't happen during load (@see onLoadUpdateCallback).
+ * @property {function} onUpdateCallback
*/
onUpdateCallback: null,
/**
- * This will be called when the State is rendered, this doesn't happen during load (see onLoadRenderCallback)
- * @type {function}
+ * This will be called when the State is rendered, this doesn't happen during load (see onLoadRenderCallback).
+ * @property {function} onRenderCallback
*/
onRenderCallback: null,
/**
- * This will be called before the State is rendered and before the stage is cleared
- * @type {function}
+ * This will be called before the State is rendered and before the stage is cleared.
+ * @property {function} onPreRenderCallback
*/
onPreRenderCallback: null,
/**
- * This will be called when the State is updated but only during the load process
- * @type {function}
+ * This will be called when the State is updated but only during the load process.
+ * @property {function} onLoadUpdateCallback
*/
onLoadUpdateCallback: null,
/**
- * This will be called when the State is rendered but only during the load process
- * @type {function}
+ * This will be called when the State is rendered but only during the load process.
+ * @property {function} onLoadRenderCallback
*/
onLoadRenderCallback: null,
/**
* This will be called when states paused.
- * @type {function}
+ * @property {function} onPausedCallback
*/
onPausedCallback: null,
/**
- * This will be called when the state is shut down (i.e. swapped to another state)
- * @type {function}
+ * This will be called when the state is shut down (i.e. swapped to another state).
+ * @property {function} onShutDownCallback
*/
onShutDownCallback: null,
+ /**
+ * Description.
+ * @method Phaser.StateManager#boot
+ * @private
+ */
boot: function () {
// console.log('Phaser.StateManager.boot');
@@ -7739,9 +7868,10 @@ Phaser.StateManager.prototype = {
/**
* Add a new State.
- * @param key {String} A unique key you use to reference this state, i.e. "MainMenu", "Level1".
- * @param state {State} The state you want to switch to.
- * @param autoStart {Boolean} Start the state immediately after creating it? (default true)
+ * @method Phaser.StateManager#add
+ * @param key {string} - A unique key you use to reference this state, i.e. "MainMenu", "Level1".
+ * @param state {State} - The state you want to switch to.
+ * @param autoStart {boolean} - Start the state immediately after creating it? (default true)
*/
add: function (key, state, autoStart) {
@@ -7790,6 +7920,11 @@ Phaser.StateManager.prototype = {
},
+ /**
+ * Delete the given state.
+ * @method Phaser.StateManager#remove
+ * @param {string} key - A unique key you use to reference this state, i.e. "MainMenu", "Level1".
+ */
remove: function (key) {
if (this.current == key)
@@ -7815,9 +7950,10 @@ Phaser.StateManager.prototype = {
/**
* Start the given state
- * @param key {String} The key of the state you want to start.
- * @param [clearWorld] {bool} clear everything in the world? (Default to true)
- * @param [clearCache] {bool} clear asset cache? (Default to false and ONLY available when clearWorld=true)
+ * @method Phaser.StateManager#start
+ * @param {string} key - The key of the state you want to start.
+ * @param {boolean} [clearWorld] - clear everything in the world? (Default to true)
+ * @param {boolean} [clearCache] - clear asset cache? (Default to false and ONLY available when clearWorld=true)
*/
start: function (key, clearWorld, clearCache) {
@@ -7889,11 +8025,21 @@ Phaser.StateManager.prototype = {
}
},
-
- // Used by onInit and onShutdown when those functions don't exist on the state
+
+ /**
+ * Used by onInit and onShutdown when those functions don't exist on the state
+ * @method Phaser.StateManager#dummy
+ * @private
+ */
dummy: function () {
},
+ /**
+ * Description.
+ * @method Phaser.StateManager#checkState
+ * @param {string} key - The key of the state you want to check.
+ * @return {boolean} Description.
+ */
checkState: function (key) {
if (this.states[key])
@@ -7926,6 +8072,12 @@ Phaser.StateManager.prototype = {
},
+ /**
+ * Links game properties to the State given by the key.
+ * @method Phaser.StateManager#link
+ * @param {string} key - State key.
+ * @protected
+ */
link: function (key) {
// console.log('linked');
@@ -7947,6 +8099,12 @@ Phaser.StateManager.prototype = {
},
+ /**
+ * Sets the current State. Should not be called directly (use StateManager.start)
+ * @method Phaser.StateManager#setCurrentState
+ * @param {string} key - State key.
+ * @protected
+ */
setCurrentState: function (key) {
this.callbackContext = this.states[key];
@@ -7975,6 +8133,10 @@ Phaser.StateManager.prototype = {
},
+ /**
+ * @method Phaser.StateManager#loadComplete
+ * @protected
+ */
loadComplete: function () {
// console.log('Phaser.StateManager.loadComplete');
@@ -7992,6 +8154,10 @@ Phaser.StateManager.prototype = {
},
+ /**
+ * @method Phaser.StateManager#update
+ * @protected
+ */
update: function () {
if (this._created && this.onUpdateCallback)
@@ -8008,6 +8174,10 @@ Phaser.StateManager.prototype = {
},
+ /**
+ * @method Phaser.StateManager#preRender
+ * @protected
+ */
preRender: function () {
if (this.onPreRenderCallback)
@@ -8017,6 +8187,10 @@ Phaser.StateManager.prototype = {
},
+ /**
+ * @method Phaser.StateManager#render
+ * @protected
+ */
render: function () {
if (this._created && this.onRenderCallback)
@@ -8035,6 +8209,7 @@ Phaser.StateManager.prototype = {
/**
* Nuke the entire game from orbit
+ * @method Phaser.StateManager#destroy
*/
destroy: function () {
@@ -8060,19 +8235,61 @@ Phaser.StateManager.prototype = {
};
+/**
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
+* A basic linked list data structure.
+*
+* @class Phaser.LinkedList
+* @constructor
+*/
Phaser.LinkedList = function () {
+ /**
+ * @property {object} next - Next element in the list.
+ * @default
+ */
this.next = null;
+
+ /**
+ * @property {object} prev - Previous element in the list.
+ * @default
+ */
this.prev = null;
+
+ /**
+ * @property {object} first - First element in the list.
+ * @default
+ */
this.first = null;
+
+ /**
+ * @property {object} last - Last element in the list.
+ * @default
+ */
this.last = null;
+
+ /**
+ * @property {object} game - Number of elements in the list.
+ * @default
+ */
this.total = 0;
};
Phaser.LinkedList.prototype = {
-
+ /**
+ * Adds a new element to this linked list.
+ *
+ * @method Phaser.LinkedList#add
+ * @param {object} child - The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through.
+ * @return {object} The child that was added.
+ */
add: function (child) {
// If the list is empty
@@ -8083,7 +8300,7 @@ Phaser.LinkedList.prototype = {
this.next = child;
child.prev = this;
this.total++;
- return;
+ return child;
}
// Get gets appended to the end of the list, regardless of anything, and it won't have any children of its own (non-nested list)
@@ -8099,40 +8316,55 @@ Phaser.LinkedList.prototype = {
},
+ /**
+ * Removes the given element from this linked list if it exists.
+ *
+ * @method Phaser.LinkedList#remove
+ * @param {object} child - The child to be removed from the list.
+ */
remove: function (child) {
- // If the list is empty
- if (this.first == null && this.last == null)
+ if (child == this.first)
{
- return;
- }
+ // It was 'first', make 'first' point to first.next
+ this.first = this.first.next;
+ }
+ else if (child == this.last)
+ {
+ // It was 'last', make 'last' point to last.prev
+ this.last = this.last.prev;
+ }
+
+ if (child.prev)
+ {
+ // make child.prev.next point to childs.next instead of child
+ child.prev.next = child.next;
+ }
+
+ if (child.next)
+ {
+ // make child.next.prev point to child.prev instead of child
+ child.next.prev = child.prev;
+ }
+
+ child.next = child.prev = null;
+
+ if (this.first == null )
+ {
+ this.last = null;
+ }
this.total--;
- // The only node?
- if (this.first == child && this.last == child)
- {
- this.first = null;
- this.last = null;
- this.next = null;
- child.next = null;
- child.prev = null;
- return;
- }
-
- var childPrev = child.prev;
-
- // Tail node?
- if (child.next)
- {
- // Has another node after it?
- child.next.prev = child.prev;
- }
-
- childPrev.next = child.next;
-
},
+ /**
+ * Calls a function on all members of this list, using the member as the context for the callback.
+ * The function must exist on the member.
+ *
+ * @method Phaser.LinkedList#callAll
+ * @param {function} callback - The function to call.
+ */
callAll: function (callback) {
if (!this.first || !this.last)
@@ -8154,102 +8386,41 @@ Phaser.LinkedList.prototype = {
}
while(entity != this.last.next)
- },
-
- dump: function () {
-
- var spacing = 20;
-
- var output = "\n" + Phaser.Utils.pad('Node', spacing) + "|" + Phaser.Utils.pad('Next', spacing) + "|" + Phaser.Utils.pad('Previous', spacing) + "|" + Phaser.Utils.pad('First', spacing) + "|" + Phaser.Utils.pad('Last', spacing);
- console.log(output);
-
- var output = Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing) + "|" + Phaser.Utils.pad('----------', spacing);
- console.log(output);
-
- var entity = this;
-
- var testObject = entity.last.next;
- entity = entity.first;
-
- do
- {
- var name = entity.sprite.name || '*';
- var nameNext = '-';
- var namePrev = '-';
- var nameFirst = '-';
- var nameLast = '-';
-
- if (entity.next)
- {
- nameNext = entity.next.sprite.name;
- }
-
- if (entity.prev)
- {
- namePrev = entity.prev.sprite.name;
- }
-
- if (entity.first)
- {
- nameFirst = entity.first.sprite.name;
- }
-
- if (entity.last)
- {
- nameLast = entity.last.sprite.name;
- }
-
- if (typeof nameNext === 'undefined')
- {
- nameNext = '-';
- }
-
- if (typeof namePrev === 'undefined')
- {
- namePrev = '-';
- }
-
- if (typeof nameFirst === 'undefined')
- {
- nameFirst = '-';
- }
-
- if (typeof nameLast === 'undefined')
- {
- nameLast = '-';
- }
-
- var output = Phaser.Utils.pad(name, spacing) + "|" + Phaser.Utils.pad(nameNext, spacing) + "|" + Phaser.Utils.pad(namePrev, spacing) + "|" + Phaser.Utils.pad(nameFirst, spacing) + "|" + Phaser.Utils.pad(nameLast, spacing);
- console.log(output);
-
- entity = entity.next;
-
- }
- while(entity != testObject)
-
- }
+ }
};
/**
-* Phaser.Signal
-*
-* A Signal is used for object communication via a custom broadcaster instead of Events.
-*
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
+* @class Phaser.Signal
+* @classdesc A Signal is used for object communication via a custom broadcaster instead of Events.
* @author Miller Medeiros http://millermedeiros.github.com/js-signals/
* @constructor
*/
Phaser.Signal = function () {
/**
- * @type Array.
- * @private
- */
+ * @property {Array.} _bindings - Description.
+ * @private
+ */
this._bindings = [];
+
+ /**
+ * @property {Description} _prevParams - Description.
+ * @private
+ */
this._prevParams = null;
// enforce dispatch to aways work on same context (#47)
var self = this;
+ /**
+ * @property {Description} dispatch - Description.
+ */
this.dispatch = function(){
Phaser.Signal.prototype.dispatch.apply(self, arguments);
};
@@ -8259,26 +8430,33 @@ Phaser.Signal = function () {
Phaser.Signal.prototype = {
/**
- * If Signal should keep record of previously dispatched parameters and
- * automatically execute listener during `add()`/`addOnce()` if Signal was
- * already dispatched before.
- * @type boolean
- */
+ * If Signal should keep record of previously dispatched parameters and
+ * automatically execute listener during `add()`/`addOnce()` if Signal was
+ * already dispatched before.
+ * @property {boolean} memorize
+ */
memorize: false,
/**
- * @type boolean
- * @private
- */
+ * @property {boolean} _shouldPropagate
+ * @private
+ */
_shouldPropagate: true,
/**
- * If Signal is active and should broadcast events.
- *
IMPORTANT: Setting this property during a dispatch will only affect the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.
- * @type boolean
- */
+ * If Signal is active and should broadcast events.
+ *
IMPORTANT: Setting this property during a dispatch will only affect the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.
+ * @property {boolean} active
+ * @default
+ */
active: true,
+ /**
+ * @method Phaser.Signal#validateListener
+ * @param {function} listener - Signal handler function.
+ * @param {Description} fnName - Description.
+ * @private
+ */
validateListener: function (listener, fnName) {
if (typeof listener !== 'function') {
throw new Error( 'listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName) );
@@ -8286,11 +8464,12 @@ Phaser.Signal.prototype = {
},
/**
- * @param {Function} listener
- * @param {boolean} isOnce
- * @param {Object} [listenerContext]
- * @param {Number} [priority]
- * @return {Phaser.SignalBinding}
+ * @method Phaser.Signal#_registerListener
+ * @param {function} listener - Signal handler function.
+ * @param {boolean} isOnce - Description.
+ * @param {object} [listenerContext] - Description.
+ * @param {number} [priority] - The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0).
+ * @return {Phaser.SignalBinding} An Object representing the binding between the Signal and listener.
* @private
*/
_registerListener: function (listener, isOnce, listenerContext, priority) {
@@ -8316,7 +8495,8 @@ Phaser.Signal.prototype = {
},
/**
- * @param {Phaser.SignalBinding} binding
+ * @method Phaser.Signal#_addBinding
+ * @param {Phaser.SignalBinding} binding - An Object representing the binding between the Signal and listener.
* @private
*/
_addBinding: function (binding) {
@@ -8327,8 +8507,9 @@ Phaser.Signal.prototype = {
},
/**
- * @param {Function} listener
- * @return {number}
+ * @method Phaser.Signal#_indexOfListener
+ * @param {function} listener - Signal handler function.
+ * @return {number} Description.
* @private
*/
_indexOfListener: function (listener, context) {
@@ -8345,9 +8526,11 @@ Phaser.Signal.prototype = {
/**
* Check if listener was attached to Signal.
- * @param {Function} listener
- * @param {Object} [context]
- * @return {boolean} if Signal has the specified listener.
+ *
+ * @method Phaser.Signal#has
+ * @param {Function} listener - Signal handler function.
+ * @param {Object} [context] - Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+ * @return {boolean} If Signal has the specified listener.
*/
has: function (listener, context) {
return this._indexOfListener(listener, context) !== -1;
@@ -8355,9 +8538,11 @@ Phaser.Signal.prototype = {
/**
* Add a listener to the signal.
- * @param {Function} listener Signal handler function.
- * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @param {Number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0)
+ *
+ * @method Phaser.Signal#add
+ * @param {function} listener - Signal handler function.
+ * @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+ * @param {number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0).
* @return {Phaser.SignalBinding} An Object representing the binding between the Signal and listener.
*/
add: function (listener, listenerContext, priority) {
@@ -8366,37 +8551,48 @@ Phaser.Signal.prototype = {
},
/**
- * Add listener to the signal that should be removed after first execution (will be executed only once).
- * @param {Function} listener Signal handler function.
- * @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @param {Number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0)
- * @return {Phaser.SignalBinding} An Object representing the binding between the Signal and listener.
- */
+ * Add listener to the signal that should be removed after first execution (will be executed only once).
+ *
+ * @method Phaser.Signal#addOnce
+ * @param {function} listener Signal handler function.
+ * @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+ * @param {number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0)
+ * @return {Phaser.SignalBinding} An Object representing the binding between the Signal and listener.
+ */
addOnce: function (listener, listenerContext, priority) {
this.validateListener(listener, 'addOnce');
return this._registerListener(listener, true, listenerContext, priority);
},
/**
- * Remove a single listener from the dispatch queue.
- * @param {Function} listener Handler function that should be removed.
- * @param {Object} [context] Execution context (since you can add the same handler multiple times if executing in a different context).
- * @return {Function} Listener handler function.
- */
+ * Remove a single listener from the dispatch queue.
+ *
+ * @method Phaser.Signal#remove
+ * @param {function} listener Handler function that should be removed.
+ * @param {object} [context] Execution context (since you can add the same handler multiple times if executing in a different context).
+ * @return {function} Listener handler function.
+ */
remove: function (listener, context) {
+
this.validateListener(listener, 'remove');
var i = this._indexOfListener(listener, context);
- if (i !== -1) {
+
+ if (i !== -1)
+ {
this._bindings[i]._destroy(); //no reason to a Phaser.SignalBinding exist if it isn't attached to a signal
this._bindings.splice(i, 1);
}
+
return listener;
+
},
/**
- * Remove all listeners from the Signal.
- */
+ * Remove all listeners from the Signal.
+ *
+ * @method Phaser.Signal#removeAll
+ */
removeAll: function () {
var n = this._bindings.length;
while (n--) {
@@ -8406,25 +8602,32 @@ Phaser.Signal.prototype = {
},
/**
- * @return {number} Number of listeners attached to the Signal.
- */
+ * Gets the total number of listeneres attached to ths Signal.
+ *
+ * @method Phaser.Signal#getNumListeners
+ * @return {number} Number of listeners attached to the Signal.
+ */
getNumListeners: function () {
return this._bindings.length;
},
/**
- * Stop propagation of the event, blocking the dispatch to next listeners on the queue.
- *
IMPORTANT: should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.
- * @see Signal.prototype.disable
- */
+ * Stop propagation of the event, blocking the dispatch to next listeners on the queue.
+ *
IMPORTANT: should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.
+ * @see Signal.prototype.disable
+ *
+ * @method Phaser.Signal#halt
+ */
halt: function () {
this._shouldPropagate = false;
},
/**
- * Dispatch/Broadcast Signal to all listeners added to the queue.
- * @param {...*} [params] Parameters that should be passed to each handler.
- */
+ * Dispatch/Broadcast Signal to all listeners added to the queue.
+ *
+ * @method Phaser.Signal#dispatch
+ * @param {any} [params] - Parameters that should be passed to each handler.
+ */
dispatch: function (params) {
if (! this.active) {
return;
@@ -8452,17 +8655,21 @@ Phaser.Signal.prototype = {
},
/**
- * Forget memorized arguments.
- * @see Signal.memorize
- */
+ * Forget memorized arguments.
+ * @see Signal.memorize
+ *
+ * @method Phaser.Signal#forget
+ */
forget: function(){
this._prevParams = null;
},
/**
- * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
- *
IMPORTANT: calling any method on the signal instance after calling dispose will throw errors.
- */
+ * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
+ *
IMPORTANT: calling any method on the signal instance after calling dispose will throw errors.
+ *
+ * @method Phaser.Signal#dispose
+ */
dispose: function () {
this.removeAll();
delete this._bindings;
@@ -8470,14 +8677,22 @@ Phaser.Signal.prototype = {
},
/**
- * @return {string} String representation of the object.
- */
+ *
+ * @method Phaser.Signal#toString
+ * @return {string} String representation of the object.
+ */
toString: function () {
return '[Phaser.Signal active:'+ this.active +' numListeners:'+ this.getNumListeners() +']';
}
};
+/**
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
/**
* Phaser.SignalBinding
*
@@ -8485,52 +8700,47 @@ Phaser.Signal.prototype = {
* - This is an internal constructor and shouldn't be called by regular users.
* - inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
*
+* @class Phaser.SignalBinding
+* @name SignalBinding
* @author Miller Medeiros http://millermedeiros.github.com/js-signals/
* @constructor
-* @internal
-* @name SignalBinding
-* @param {Signal} signal Reference to Signal object that listener is currently bound to.
-* @param {Function} listener Handler function bound to the signal.
-* @param {boolean} isOnce If binding should be executed just once.
-* @param {Object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
-* @param {Number} [priority] The priority level of the event listener. (default = 0).
+* @inner
+* @param {Signal} signal - Reference to Signal object that listener is currently bound to.
+* @param {function} listener - Handler function bound to the signal.
+* @param {boolean} isOnce - If binding should be executed just once.
+* @param {object} [listenerContext] - Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+* @param {number} [priority] - The priority level of the event listener. (default = 0).
*/
Phaser.SignalBinding = function (signal, listener, isOnce, listenerContext, priority) {
/**
- * Handler function bound to the signal.
- * @type Function
- * @private
- */
+ * @property {Phaser.Game} _listener - Handler function bound to the signal.
+ * @private
+ */
this._listener = listener;
/**
- * If binding should be executed just once.
- * @type boolean
- * @private
- */
+ * @property {boolean} _isOnce - If binding should be executed just once.
+ * @private
+ */
this._isOnce = isOnce;
/**
- * Context on which listener will be executed (object that should represent the `this` variable inside listener function).
- * @memberOf SignalBinding.prototype
- * @name context
- * @type Object|undefined|null
- */
+ * @property {object|undefined|null} context - Context on which listener will be executed (object that should represent the `this` variable inside listener function).
+ * @memberof SignalBinding.prototype
+ */
this.context = listenerContext;
/**
- * Reference to Signal object that listener is currently bound to.
- * @type Signal
- * @private
- */
+ * @property {Signal} _signal - Reference to Signal object that listener is currently bound to.
+ * @private
+ */
this._signal = signal;
/**
- * Listener priority
- * @type Number
- * @private
- */
+ * @property {number} _priority - Listener priority.
+ * @private
+ */
this._priority = priority || 0;
};
@@ -8538,23 +8748,26 @@ Phaser.SignalBinding = function (signal, listener, isOnce, listenerContext, prio
Phaser.SignalBinding.prototype = {
/**
- * If binding is active and should be executed.
- * @type boolean
- */
+ * If binding is active and should be executed.
+ * @property {boolean} active
+ * @default
+ */
active: true,
/**
- * Default parameters passed to listener during `Signal.dispatch` and `SignalBinding.execute`. (curried parameters)
- * @type Array|null
- */
+ * Default parameters passed to listener during `Signal.dispatch` and `SignalBinding.execute` (curried parameters).
+ * @property {array|null} params
+ * @default
+ */
params: null,
/**
- * Call listener passing arbitrary parameters.
- *
If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.
- * @param {Array} [paramsArr] Array of parameters that should be passed to the listener
- * @return {*} Value returned by the listener.
- */
+ * Call listener passing arbitrary parameters.
+ *
If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.
+ * @method Phaser.SignalBinding#execute
+ * @param {array} [paramsArr] - Array of parameters that should be passed to the listener.
+ * @return {Description} Value returned by the listener.
+ */
execute: function (paramsArr) {
var handlerReturn, params;
@@ -8575,46 +8788,52 @@ Phaser.SignalBinding.prototype = {
},
/**
- * Detach binding from signal.
- * - alias to: mySignal.remove(myBinding.getListener());
- * @return {Function|null} Handler function bound to the signal or `null` if binding was previously detached.
- */
+ * Detach binding from signal.
+ *
alias to: @see mySignal.remove(myBinding.getListener());
+ * @method Phaser.SignalBinding#detach
+ * @return {function|null} Handler function bound to the signal or `null` if binding was previously detached.
+ */
detach: function () {
return this.isBound() ? this._signal.remove(this._listener, this.context) : null;
},
/**
- * @return {Boolean} `true` if binding is still bound to the signal and have a listener.
- */
+ * @method Phaser.SignalBinding#isBound
+ * @return {boolean} True if binding is still bound to the signal and has a listener.
+ */
isBound: function () {
return (!!this._signal && !!this._listener);
},
/**
- * @return {boolean} If SignalBinding will only be executed once.
- */
+ * @method Phaser.SignalBinding#isOnce
+ * @return {boolean} If SignalBinding will only be executed once.
+ */
isOnce: function () {
return this._isOnce;
},
/**
- * @return {Function} Handler function bound to the signal.
- */
+ * @method Phaser.SignalBinding#getListener
+ * @return {Function} Handler function bound to the signal.
+ */
getListener: function () {
return this._listener;
},
/**
- * @return {Signal} Signal that listener is currently bound to.
- */
+ * @method Phaser.SignalBinding#getSignal
+ * @return {Signal} Signal that listener is currently bound to.
+ */
getSignal: function () {
return this._signal;
},
/**
- * Delete instance properties
- * @private
- */
+ * @method Phaser.SignalBinding#_destroy
+ * Delete instance properties
+ * @private
+ */
_destroy: function () {
delete this._signal;
delete this._listener;
@@ -8622,8 +8841,9 @@ Phaser.SignalBinding.prototype = {
},
/**
- * @return {string} String representation of the object.
- */
+ * @method Phaser.SignalBinding#toString
+ * @return {string} String representation of the object.
+ */
toString: function () {
return '[Phaser.SignalBinding isOnce:' + this._isOnce +', isBound:'+ this.isBound() +', active:' + this.active + ']';
}
@@ -8631,21 +8851,68 @@ Phaser.SignalBinding.prototype = {
};
/**
-* Phaser - Plugin
-*
-* This is a base Plugin template to use for any Phaser plugin development
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
+* This is a base Plugin template to use for any Phaser plugin development.
+*
+* @class Phaser.Plugin
+* @classdesc Phaser - Plugin
+* @constructor
+* @param {Phaser.Game} game - A reference to the currently running game.
+* @param {Any} parent - The object that owns this plugin, usually Phaser.PluginManager.
*/
Phaser.Plugin = function (game, parent) {
+ if (typeof parent === 'undefined') { parent = null; }
+
+ /**
+ * @property {Phaser.Game} game - A reference to the currently running game.
+ */
this.game = game;
+
+ /**
+ * @property {Any} parent - The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null.
+ */
this.parent = parent;
+ /**
+ * @property {boolean} active - A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped.
+ * @default
+ */
this.active = false;
+
+ /**
+ * @property {boolean} visible - A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped.
+ * @default
+ */
this.visible = false;
+ /**
+ * @property {boolean} hasPreUpdate - A flag to indicate if this plugin has a preUpdate method.
+ * @default
+ */
this.hasPreUpdate = false;
+
+ /**
+ * @property {boolean} hasUpdate - A flag to indicate if this plugin has an update method.
+ * @default
+ */
this.hasUpdate = false;
+
+ /**
+ * @property {boolean} hasRender - A flag to indicate if this plugin has a render method.
+ * @default
+ */
this.hasRender = false;
+
+ /**
+ * @property {boolean} hasPostRender - A flag to indicate if this plugin has a postRender method.
+ * @default
+ */
this.hasPostRender = false;
};
@@ -8653,8 +8920,9 @@ Phaser.Plugin = function (game, parent) {
Phaser.Plugin.prototype = {
/**
- * Pre-update is called at the start of the update cycle, before any other updates have taken place (including Physics).
+ * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics).
* It is only called if active is set to true.
+ * @method Phaser.Plugin#preUpdate
*/
preUpdate: function () {
},
@@ -8662,6 +8930,7 @@ Phaser.Plugin.prototype = {
/**
* Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render.
* It is only called if active is set to true.
+ * @method Phaser.Plugin#update
*/
update: function () {
},
@@ -8669,6 +8938,7 @@ Phaser.Plugin.prototype = {
/**
* Render is called right after the Game Renderer completes, but before the State.render.
* It is only called if visible is set to true.
+ * @method Phaser.Plugin#render
*/
render: function () {
},
@@ -8676,12 +8946,14 @@ Phaser.Plugin.prototype = {
/**
* Post-render is called after the Game Renderer and State.render have run.
* It is only called if visible is set to true.
+ * @method Phaser.Plugin#postRender
*/
postRender: function () {
},
/**
* Clear down this Plugin and null out references
+ * @method Phaser.Plugin#destroy
*/
destroy: function () {
@@ -8695,16 +8967,43 @@ Phaser.Plugin.prototype = {
};
/**
-* Phaser - PluginManager
-*
-* TODO: We can optimise this a lot by using separate hashes per function (update, render, etc)
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
+/**
+* Description.
+*
+* @class Phaser.PluginManager
+* @classdesc Phaser - PluginManager
+* @constructor
+* @param {Phaser.Game} game - A reference to the currently running game.
+* @param {Description} parent - Description.
+*/
Phaser.PluginManager = function(game, parent) {
+ /**
+ * @property {Phaser.Game} game - A reference to the currently running game.
+ */
this.game = game;
+
+ /**
+ * @property {Description} _parent - Description.
+ * @private
+ */
this._parent = parent;
+
+ /**
+ * @property {array} plugins - Description.
+ */
this.plugins = [];
+
+ /**
+ * @property {array} _pluginsLength - Description.
+ * @private
+ * @default
+ */
this._pluginsLength = 0;
};
@@ -8713,8 +9012,10 @@ Phaser.PluginManager.prototype = {
/**
* Add a new Plugin to the PluginManager.
- * The plugins game and parent reference are set to this game and pluginmanager parent.
- * @type {Phaser.Plugin}
+ * The plugin's game and parent reference are set to this game and pluginmanager parent.
+ * @method Phaser.PluginManager#add
+ * @param {Phaser.Plugin} plugin - Description.
+ * @return {Phaser.Plugin} Description.
*/
add: function (plugin) {
@@ -8778,6 +9079,11 @@ Phaser.PluginManager.prototype = {
}
},
+ /**
+ * Remove a Plugin from the PluginManager.
+ * @method Phaser.PluginManager#remove
+ * @param {Phaser.Plugin} plugin - The plugin to be removed.
+ */
remove: function (plugin) {
// TODO
@@ -8785,6 +9091,12 @@ Phaser.PluginManager.prototype = {
},
+ /**
+ * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics).
+ * It only calls plugins who have active=true.
+ *
+ * @method Phaser.PluginManager#preUpdate
+ */
preUpdate: function () {
if (this._pluginsLength == 0)
@@ -8802,6 +9114,12 @@ Phaser.PluginManager.prototype = {
},
+ /**
+ * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render.
+ * It only calls plugins who have active=true.
+ *
+ * @method Phaser.PluginManager#update
+ */
update: function () {
if (this._pluginsLength == 0)
@@ -8819,6 +9137,12 @@ Phaser.PluginManager.prototype = {
},
+ /**
+ * Render is called right after the Game Renderer completes, but before the State.render.
+ * It only calls plugins who have visible=true.
+ *
+ * @method Phaser.PluginManager#render
+ */
render: function () {
if (this._pluginsLength == 0)
@@ -8836,6 +9160,12 @@ Phaser.PluginManager.prototype = {
},
+ /**
+ * Post-render is called after the Game Renderer and State.render have run.
+ * It only calls plugins who have visible=true.
+ *
+ * @method Phaser.PluginManager#postRender
+ */
postRender: function () {
if (this._pluginsLength == 0)
@@ -8853,6 +9183,11 @@ Phaser.PluginManager.prototype = {
},
+ /**
+ * Clear down this PluginManager and null out references
+ *
+ * @method Phaser.PluginManager#destroy
+ */
destroy: function () {
this.plugins.length = 0;
@@ -8867,87 +9202,64 @@ Phaser.PluginManager.prototype = {
/**
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
-* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License
-* @module Phaser.Stage
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
-*
* The Stage controls the canvas on which everything is displayed. It handles display within the browser,
* focus handling, game resizing, scaling and the pause, boot and orientation screens.
*
-* @class Stage
+* @class Phaser.Stage
* @constructor
-* @param {Phaser.Game} game Game reference to the currently running game.
-* @param {number} width Width of the canvas element
-* @param {number} height Height of the canvas element
+* @param {Phaser.Game} game - Game reference to the currently running game.
+* @param {number} width - Width of the canvas element.
+* @param {number} height - Height of the canvas element.
*/
Phaser.Stage = function (game, width, height) {
- /**
- * A reference to the currently running Game.
- * @property game
- * @public
- * @type {Phaser.Game}
- */
+ /**
+ * @property {Phaser.Game} game - A reference to the currently running Game.
+ */
this.game = game;
/**
- * Background color of the stage (defaults to black). Set via the public backgroundColor property.
- * @property _backgroundColor
- * @private
- * @type {string}
- */
+ * @property {string} game - Background color of the stage (defaults to black). Set via the public backgroundColor property.
+ * @private
+ * @default 'rgb(0,0,0)'
+ */
this._backgroundColor = 'rgb(0,0,0)';
/**
- * Get the offset values (for input and other things)
- * @property offset
- * @public
- * @type {Phaser.Point}
- */
+ * @property {Phaser.Point} offset - Get the offset values (for input and other things).
+ */
this.offset = new Phaser.Point;
/**
- * reference to the newly created