/**
+* @author Richard Davey <rich@photonstorm.com>
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
+* The Canvas class handles everything related to the <canvas> tag as a DOM Element, like styles, offset, aspect ratio
+*
+* @class Phaser.Canvas
+* @static
+*/
+Phaser.Canvas = {
+
+ /**
+ * Creates the <canvas> tag
+ *
+ * @method Phaser.Canvas.create
+ * @param {number} width - The desired width.
+ * @param {number} height - The desired height.
+ * @return {HTMLCanvasElement} The newly created <canvas> tag.
+ */
+ create: function (width, height) {
+ width = width || 256;
+ height = height || 256;
+
+ var canvas = document.createElement('canvas');
+ canvas.width = width;
+ canvas.height = height;
+ canvas.style.display = 'block';
+
+ return canvas;
+
+ },
+
+ /**
+ * Get the DOM offset values of any given element
+ * @method Phaser.Canvas.getOffset
+ * @param {HTMLElement} element - The targeted element that we want to retrieve the offset.
+ * @param {Phaser.Point} [point] - The point we want to take the x/y values of the offset.
+ * @return {Phaser.Point} - A point objet with the offsetX and Y as its properties.
+ */
+ getOffset: function (element, point) {
+
+ point = point || new Phaser.Point;
+
+ var box = element.getBoundingClientRect();
+ var clientTop = element.clientTop || document.body.clientTop || 0;
+ var clientLeft = element.clientLeft || document.body.clientLeft || 0;
+ var scrollTop = window.pageYOffset || element.scrollTop || document.body.scrollTop;
+ var scrollLeft = window.pageXOffset || element.scrollLeft || document.body.scrollLeft;
+
+ point.x = box.left + scrollLeft - clientLeft;
+ point.y = box.top + scrollTop - clientTop;
+
+ return point;
+
+ },
+
+ /**
+ * Returns the aspect ratio of the given canvas.
+ *
+ * @method Phaser.Canvas.getAspectRatio
+ * @param {HTMLCanvasElement} canvas - The canvas to get the aspect ratio from.
+ * @return {number} The ratio between canvas' width and height.
+ */
+ getAspectRatio: function (canvas) {
+ return canvas.width / canvas.height;
+ },
+
+ /**
+ * Sets the background color behind the canvas. This changes the canvas style property.
+ *
+ * @method Phaser.Canvas.setBackgroundColor
+ * @param {HTMLCanvasElement} canvas - The canvas to set the background color on.
+ * @param {string} [color] - The color to set. Can be in the format 'rgb(r,g,b)', or '#RRGGBB' or any valid CSS color.
+ * @return {HTMLCanvasElement} Returns the source canvas.
+ */
+ setBackgroundColor: function (canvas, color) {
+
+ color = color || 'rgb(0,0,0)';
+
+ canvas.style.backgroundColor = color;
+
+ return canvas;
+
+ },
+
+ /**
+ * Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.
+ *
+ * @method Phaser.Canvas.setTouchAction
+ * @param {HTMLCanvasElement} canvas - The canvas to set the touch action on.
+ * @param {String} [value] - The touch action to set. Defaults to 'none'.
+ * @return {HTMLCanvasElement} The source canvas.
+ */
+ setTouchAction: function (canvas, value) {
+
+ value = value || 'none';
+
+ canvas.style.msTouchAction = value;
+ canvas.style['ms-touch-action'] = value;
+ canvas.style['touch-action'] = value;
+
+ return canvas;
+
+ },
+
+ /**
+ * Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.
+ *
+ * @method Phaser.Canvas.setUserSelect
+ * @param {HTMLCanvasElement} canvas - The canvas to set the touch action on.
+ * @param {String} [value] - The touch action to set. Defaults to 'none'.
+ * @return {HTMLCanvasElement} The source canvas.
+ */
+ setUserSelect: function (canvas, value) {
+
+ value = value || 'none';
+
+ canvas.style['-webkit-touch-callout'] = value;
+ canvas.style['-webkit-user-select'] = value;
+ canvas.style['-khtml-user-select'] = value;
+ canvas.style['-moz-user-select'] = value;
+ canvas.style['-ms-user-select'] = value;
+ canvas.style['user-select'] = value;
+ canvas.style['-webkit-tap-highlight-color'] = 'rgba(0, 0, 0, 0)';
+
+ return canvas;
+
+ },
+
+ /**
+ * Adds the given canvas element to the DOM. The canvas will be added as a child of the given parent.
+ * If no parent is given it will be added as a child of the document.body.
+ *
+ * @method Phaser.Canvas.addToDOM
+ * @param {HTMLCanvasElement} canvas - The canvas to set the touch action on.
+ * @param {string} parent - The DOM element to add the canvas to. Defaults to ''.
+ * @param {boolean} overflowHidden - If set to true it will add the overflow='hidden' style to the parent DOM element.
+ * @return {HTMLCanvasElement} Returns the source canvas.
+ */
+ addToDOM: function (canvas, parent, overflowHidden) {
+
+ parent = parent || '';
+
+ if (typeof overflowHidden === 'undefined') { overflowHidden = true; }
+
+ if (parent !== '')
+ {
+ if (document.getElementById(parent))
+ {
+ document.getElementById(parent).appendChild(canvas);
+
+ if (overflowHidden)
+ {
+ document.getElementById(parent).style.overflow = 'hidden';
+ }
+ }
+ else
+ {
+ document.body.appendChild(canvas);
+ }
+ }
+ else
+ {
+ document.body.appendChild(canvas);
+ }
+
+ return canvas;
+
+ },
+
+ /**
+ * Sets the transform of the given canvas to the matrix values provided.
+ *
+ * @method Phaser.Canvas.setTransform
+ * @param {CanvasRenderingContext2D} context - The context to set the transform on.
+ * @param {number} translateX - The value to translate horizontally by.
+ * @param {number} translateY - The value to translate vertically by.
+ * @param {number} scaleX - The value to scale horizontally by.
+ * @param {number} scaleY - The value to scale vertically by.
+ * @param {number} skewX - The value to skew horizontaly by.
+ * @param {number} skewY - The value to skew vertically by.
+ * @return {CanvasRenderingContext2D} Returns the source context.
+ */
+ setTransform: function (context, translateX, translateY, scaleX, scaleY, skewX, skewY) {
+
+ context.setTransform(scaleX, skewX, skewY, scaleY, translateX, translateY);
+
+ return context;
+
+ },
+
+ /**
+ * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing.
+ * By default browsers have image smoothing enabled, which isn't always what you visually want, especially
+ * when using pixel art in a game. Note that this sets the property on the context itself, so that any image
+ * drawn to the context will be affected. This sets the property across all current browsers but support is
+ * patchy on earlier browsers, especially on mobile.
+ *
+ * @method Phaser.Canvas.setSmoothingEnabled
+ * @param {CanvasRenderingContext2D} context - The context to enable or disable the image smoothing on.
+ * @param {boolean} value - If set to true it will enable image smoothing, false will disable it.
+ * @return {CanvasRenderingContext2D} Returns the source context.
+ */
+ setSmoothingEnabled: function (context, value) {
+
+ context['imageSmoothingEnabled'] = value;
+ context['mozImageSmoothingEnabled'] = value;
+ context['oImageSmoothingEnabled'] = value;
+ context['webkitImageSmoothingEnabled'] = value;
+ context['msImageSmoothingEnabled'] = value;
+
+ return context;
+
+ },
+
+ /**
+ * Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast on webkit').
+ * Note that if this doesn't given the desired result then see the setSmoothingEnabled.
+ *
+ * @method Phaser.Canvas.setImageRenderingCrisp
+ * @param {HTMLCanvasElement} canvas - The canvas to set image-rendering crisp on.
+ * @return {HTMLCanvasElement} Returns the source canvas.
+ */
+ setImageRenderingCrisp: function (canvas) {
+
+ canvas.style['image-rendering'] = 'crisp-edges';
+ canvas.style['image-rendering'] = '-moz-crisp-edges';
+ canvas.style['image-rendering'] = '-webkit-optimize-contrast';
+ canvas.style.msInterpolationMode = 'nearest-neighbor';
+
+ return canvas;
+
+ },
+
+ /**
+ * Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').
+ * Note that if this doesn't given the desired result then see the CanvasUtils.setSmoothingEnabled method.
+ *
+ * @method Phaser.Canvas.setImageRenderingBicubic
+ * @param {HTMLCanvasElement} canvas The canvas to set image-rendering bicubic on.
+ * @return {HTMLCanvasElement} Returns the source canvas.
+ */
+ setImageRenderingBicubic: function (canvas) {
+
+ canvas.style['image-rendering'] = 'auto';
+ canvas.style.msInterpolationMode = 'bicubic';
+
+ return canvas;
+
+ }
+
+};
+
-
@@ -241,18 +251,19 @@
* @constructor
* @extends Phaser.Group
* @param {Phaser.Game} game - Current game instance.
-* @param {number} x - Description.
-* @param {number} y - Description.
-* @param {number} maxParticles - Description.
+* @param {number} [x=0] - The x coordinate within the Emitter that the particles are emitted from.
+* @param {number} [y=0] - The y coordinate within the Emitter that the particles are emitted from.
+* @param {number} [maxParticles=50] - The total number of particles in this emitter..
*/
Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
/**
- * @property {number} maxParticles - Description.
+ * The total number of particles in this emitter.
+ * @property {number} maxParticles - The total number of particles in this emitter..
* @default
*/
- maxParticles = maxParticles || 50;
+ this.maxParticles = maxParticles || 50;
Phaser.Group.call(this, game);
@@ -368,12 +379,6 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
*/
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.
@@ -926,7 +931,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Frame.js.html b/Docs/out/Frame.js.html
index 95fd8cb4..f84e81f9 100644
--- a/Docs/out/Frame.js.html
+++ b/Docs/out/Frame.js.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -2758,7 +2768,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.FrameData.html b/Docs/out/Phaser.Animation.FrameData.html
index bc42e824..6e9e4cf0 100644
--- a/Docs/out/Phaser.Animation.FrameData.html
+++ b/Docs/out/Phaser.Animation.FrameData.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1705,7 +1715,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 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:42 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.Parser.html b/Docs/out/Phaser.Animation.Parser.html
index 1ceb07e3..3bccd7c2 100644
--- a/Docs/out/Phaser.Animation.Parser.html
+++ b/Docs/out/Phaser.Animation.Parser.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1212,7 +1222,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:42 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.html b/Docs/out/Phaser.Animation.html
index d86e8eff..b7a2ed88 100644
--- a/Docs/out/Phaser.Animation.html
+++ b/Docs/out/Phaser.Animation.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -2589,7 +2599,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 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.AnimationManager.html b/Docs/out/Phaser.AnimationManager.html
index 21b11093..513b6d5c 100644
--- a/Docs/out/Phaser.AnimationManager.html
+++ b/Docs/out/Phaser.AnimationManager.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -2413,7 +2423,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 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:42 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Cache.html b/Docs/out/Phaser.Cache.html
index b7d33f00..a2f025d4 100644
--- a/Docs/out/Phaser.Cache.html
+++ b/Docs/out/Phaser.Cache.html
@@ -70,10 +70,18 @@
Camera
+
@@ -6070,7 +6080,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 16:05:23 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:42 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Camera.html b/Docs/out/Phaser.Camera.html
index 11e09604..6f2da9bc 100644
--- a/Docs/out/Phaser.Camera.html
+++ b/Docs/out/Phaser.Camera.html
@@ -70,10 +70,18 @@
Camera
+
Adds the given canvas element to the DOM. The canvas will be added as a child of the given parent.
+If no parent is given it will be added as a child of the document.body.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
canvas
+
+
+
+
+
+HTMLCanvasElement
+
+
+
+
+
+
+
+
+
+
The canvas to set the touch action on.
+
+
+
+
+
+
+
parent
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
The DOM element to add the canvas to. Defaults to ''.
+
+
+
+
+
+
+
overflowHidden
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+
+
If set to true it will add the overflow='hidden' style to the parent DOM element.
Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').
+Note that if this doesn't given the desired result then see the CanvasUtils.setSmoothingEnabled method.
Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast on webkit').
+Note that if this doesn't given the desired result then see the setSmoothingEnabled.
Sets the Image Smoothing property on the given context. Set to false to disable image smoothing.
+By default browsers have image smoothing enabled, which isn't always what you visually want, especially
+when using pixel art in a game. Note that this sets the property on the context itself, so that any image
+drawn to the context will be affected. This sets the property across all current browsers but support is
+patchy on earlier browsers, especially on mobile.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
context
+
+
+
+
+
+CanvasRenderingContext2D
+
+
+
+
+
+
+
+
+
+
The context to enable or disable the image smoothing on.
+
+
+
+
+
+
+
value
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+
+
If set to true it will enable image smoothing, false will disable it.
-
@@ -4090,7 +4100,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 16:05:23 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:42 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Device.html b/Docs/out/Phaser.Device.html
new file mode 100644
index 00000000..b023b825
--- /dev/null
+++ b/Docs/out/Phaser.Device.html
@@ -0,0 +1,4852 @@
+
+
+
+
+
+ Phaser Class: Device
+
+
+
+
+
+
+
+
+
+
+
-
@@ -1293,7 +1303,7 @@ providing quick access to common functions and handling the boot process.
-Phaser.Device
+Phaser.Device
@@ -2651,7 +2661,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
-Phaser.RequestAnimationFrame
+Phaser.RequestAnimationFrame
@@ -3068,7 +3078,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
-Phaser.SoundManager
+Phaser.SoundManager
@@ -4277,7 +4287,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 16:05:23 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:42 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Group.html b/Docs/out/Phaser.Group.html
index f74d30af..996aaf1e 100644
--- a/Docs/out/Phaser.Group.html
+++ b/Docs/out/Phaser.Group.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -6203,7 +6213,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 16:05:23 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:43 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Input.html b/Docs/out/Phaser.Input.html
index 6a18fc24..a8a92d49 100644
--- a/Docs/out/Phaser.Input.html
+++ b/Docs/out/Phaser.Input.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -7375,7 +7385,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 16:05:23 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:43 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.InputHandler.html b/Docs/out/Phaser.InputHandler.html
index e51d45c4..9282d52c 100644
--- a/Docs/out/Phaser.InputHandler.html
+++ b/Docs/out/Phaser.InputHandler.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -7291,7 +7301,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 16:05:23 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:43 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Key.html b/Docs/out/Phaser.Key.html
index a83ce97a..d4dc5b81 100644
--- a/Docs/out/Phaser.Key.html
+++ b/Docs/out/Phaser.Key.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -2338,7 +2348,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 16:05:23 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:43 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Keyboard.html b/Docs/out/Phaser.Keyboard.html
index ff5aa14f..c65f620c 100644
--- a/Docs/out/Phaser.Keyboard.html
+++ b/Docs/out/Phaser.Keyboard.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -2673,7 +2683,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 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:43 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.LinkedList.html b/Docs/out/Phaser.LinkedList.html
index c352407c..8e7030ef 100644
--- a/Docs/out/Phaser.LinkedList.html
+++ b/Docs/out/Phaser.LinkedList.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1257,7 +1267,7 @@ The function must exist on the member.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:43 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Loader.Parser.html b/Docs/out/Phaser.Loader.Parser.html
index d79e3bfe..a68e0d06 100644
--- a/Docs/out/Phaser.Loader.Parser.html
+++ b/Docs/out/Phaser.Loader.Parser.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -491,7 +501,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:43 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Loader.html b/Docs/out/Phaser.Loader.html
index fcc2e152..ef2866eb 100644
--- a/Docs/out/Phaser.Loader.html
+++ b/Docs/out/Phaser.Loader.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -5310,7 +5320,7 @@ This allows you to easily make loading bars for games.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:43 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.MSPointer.html b/Docs/out/Phaser.MSPointer.html
index e1793953..e5ca9737 100644
--- a/Docs/out/Phaser.MSPointer.html
+++ b/Docs/out/Phaser.MSPointer.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1522,7 +1532,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 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Math.html b/Docs/out/Phaser.Math.html
index 6beaaa7c..a5321e5f 100644
--- a/Docs/out/Phaser.Math.html
+++ b/Docs/out/Phaser.Math.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -9801,7 +9811,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 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Mouse.html b/Docs/out/Phaser.Mouse.html
index 6672d770..b9d594f8 100644
--- a/Docs/out/Phaser.Mouse.html
+++ b/Docs/out/Phaser.Mouse.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -2068,7 +2078,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Net.html b/Docs/out/Phaser.Net.html
index 82348ae4..2b23a9ec 100644
--- a/Docs/out/Phaser.Net.html
+++ b/Docs/out/Phaser.Net.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1147,7 +1157,7 @@ Optionally you can redirect to the new url, or just return it as a string.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Particles.Arcade.Emitter.html b/Docs/out/Phaser.Particles.Arcade.Emitter.html
index 1cb631a3..cdb70d11 100644
--- a/Docs/out/Phaser.Particles.Arcade.Emitter.html
+++ b/Docs/out/Phaser.Particles.Arcade.Emitter.html
@@ -70,10 +70,18 @@
Camera
+
@@ -10459,7 +10533,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 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Particles.html b/Docs/out/Phaser.Particles.html
index 1680f012..69f7d173 100644
--- a/Docs/out/Phaser.Particles.html
+++ b/Docs/out/Phaser.Particles.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -938,7 +948,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Plugin.html b/Docs/out/Phaser.Plugin.html
index 5e4deb55..41b946f0 100644
--- a/Docs/out/Phaser.Plugin.html
+++ b/Docs/out/Phaser.Plugin.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1609,7 +1619,7 @@ It is only called if active is set to true.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:24 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.PluginManager.html b/Docs/out/Phaser.PluginManager.html
index 3a3300aa..8b21015f 100644
--- a/Docs/out/Phaser.PluginManager.html
+++ b/Docs/out/Phaser.PluginManager.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1239,7 +1249,7 @@ It only calls plugins who have active=true.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Point.html b/Docs/out/Phaser.Point.html
index 6063824a..3b3896cd 100644
--- a/Docs/out/Phaser.Point.html
+++ b/Docs/out/Phaser.Point.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -4799,7 +4809,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:44 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Pointer.html b/Docs/out/Phaser.Pointer.html
index 86219380..48f5c24c 100644
--- a/Docs/out/Phaser.Pointer.html
+++ b/Docs/out/Phaser.Pointer.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1108,7 +1118,7 @@ Split the node into 4 subnodes
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:45 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.RandomDataGenerator.html b/Docs/out/Phaser.RandomDataGenerator.html
index 767820c1..d47c2a65 100644
--- a/Docs/out/Phaser.RandomDataGenerator.html
+++ b/Docs/out/Phaser.RandomDataGenerator.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1801,7 +1811,7 @@ Random number generator from
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:45 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Rectangle.html b/Docs/out/Phaser.Rectangle.html
index c467e6c3..6f55c154 100644
--- a/Docs/out/Phaser.Rectangle.html
+++ b/Docs/out/Phaser.Rectangle.html
@@ -70,10 +70,18 @@
Camera
+
Adds a marker into the current Sound. A marker is represented by a unique key and a start time and duration.
+This allows you to bundle multiple sounds together into a single audio file and use markers to jump between them for playback.
+
+
+
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
Argument
+
+
+
+
Default
+
+
+
Description
+
+
+
+
+
+
+
+
+
name
+
+
+
+
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A unique name for this marker, i.e. 'explosion', 'gunshot', etc.
+
+
+
+
+
+
+
start
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The start point of this marker in the audio file, given in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.
+
+
+
+
+
+
+
duration
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
The duration of the marker in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.
+
+
+
+
+
+
+
volume
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+ <optional>
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
The volume the sound will play back at, between 0 (silent) and 1 (full volume).
An Animation instance contains a single animation and the controls to play it.
+It is created by the AnimationManager, consists of Animation.Frame objects and belongs to a single Game Object such as a Sprite.
If you wish to align your game in the middle of the page then you can set this value to true.
+ <ul><li>It will place a re-calculated margin-left pixel value onto the canvas element which is updated on orientation/resizing.</li>
+ <li>It doesn't care about any other DOM element that may be on the page, it literally just sets the margin.</li></ul>
If you wish to align your game in the middle of the page then you can set this value to true.
+ <ul><li>It will place a re-calculated margin-left pixel value onto the canvas element which is updated on orientation/resizing.
+ <li>It doesn't care about any other DOM element that may be on the page, it literally just sets the margin.</li></ul>
Tries to enter the browser into full screen mode.
+Please note that this needs to be supported by the web browser and isn't the same thing as setting your game to fill the browser.
-
@@ -1313,7 +1323,7 @@ It provides quick access to common functions such as the camera, cache, input, m
-Phaser.SoundManager
+Phaser.SoundManager
@@ -2376,7 +2386,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 16:05:25 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:46 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.StateManager.html b/Docs/out/Phaser.StateManager.html
index 858397de..34a49233 100644
--- a/Docs/out/Phaser.StateManager.html
+++ b/Docs/out/Phaser.StateManager.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -3233,7 +3243,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:25 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:46 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Touch.html b/Docs/out/Phaser.Touch.html
index 07930ccd..1bc1f8c0 100644
--- a/Docs/out/Phaser.Touch.html
+++ b/Docs/out/Phaser.Touch.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -2348,7 +2358,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 16:05:25 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:46 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.World.html b/Docs/out/Phaser.World.html
index 4c552797..0a9a5c50 100644
--- a/Docs/out/Phaser.World.html
+++ b/Docs/out/Phaser.World.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -1946,7 +1956,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 16:05:25 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:46 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.js.html b/Docs/out/Phaser.js.html
index b19edd1a..7684fc65 100644
--- a/Docs/out/Phaser.js.html
+++ b/Docs/out/Phaser.js.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -287,7 +297,7 @@ PIXI.InteractionManager = function (dummy) {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Plugin.js.html b/Docs/out/Plugin.js.html
index 7c458833..82e28e31 100644
--- a/Docs/out/Plugin.js.html
+++ b/Docs/out/Plugin.js.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -641,7 +651,7 @@ Phaser.Point.rotate = function (a, x, y, angle, asDegrees, distance) {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Pointer.js.html b/Docs/out/Pointer.js.html
index 331e9141..f72b8c0e 100644
--- a/Docs/out/Pointer.js.html
+++ b/Docs/out/Pointer.js.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -543,7 +553,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:26 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:46 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/SignalBinding.js.html b/Docs/out/SignalBinding.js.html
index ca60d527..107f0379 100644
--- a/Docs/out/SignalBinding.js.html
+++ b/Docs/out/SignalBinding.js.html
@@ -70,10 +70,18 @@
Camera
+
@@ -424,7 +452,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/index.html b/Docs/out/index.html
index 8300085a..c8577595 100644
--- a/Docs/out/index.html
+++ b/Docs/out/index.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -347,7 +357,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/module-Phaser.html b/Docs/out/module-Phaser.html
index f5d18185..a61c1b91 100644
--- a/Docs/out/module-Phaser.html
+++ b/Docs/out/module-Phaser.html
@@ -70,10 +70,18 @@
Camera
+
-
@@ -314,7 +324,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/modules.list.html b/Docs/out/modules.list.html
index ad45ec32..9fe3d706 100644
--- a/Docs/out/modules.list.html
+++ b/Docs/out/modules.list.html
@@ -70,10 +70,18 @@
Camera
+
@@ -424,7 +452,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 16:05:22 GMT+0100 (BST) using the DocStrap template.
+ on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template.
diff --git a/examples/js.php b/examples/js.php
index 32e1a272..05487a68 100644
--- a/examples/js.php
+++ b/examples/js.php
@@ -95,7 +95,7 @@
-
+
diff --git a/src/animation/Parser.js b/src/animation/AnimationParser.js
similarity index 92%
rename from src/animation/Parser.js
rename to src/animation/AnimationParser.js
index caa1907e..f28e4375 100644
--- a/src/animation/Parser.js
+++ b/src/animation/AnimationParser.js
@@ -7,14 +7,14 @@
/**
* Responsible for parsing sprite sheet and JSON data into the internal FrameData format that Phaser uses for animations.
*
-* @class Phaser.Animation.Parser
+* @class Phaser.AnimationParser
*/
-Phaser.Animation.Parser = {
+Phaser.AnimationParser = {
/**
* Parse a Sprite Sheet and extract the animation frame data from it.
*
- * @method Phaser.Animation.Parser.spriteSheet
+ * @method Phaser.AnimationParser.spriteSheet
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {string} key - The Game.Cache asset key of the Sprite Sheet image.
* @param {number} frameWidth - The fixed width of each frame of the animation.
@@ -57,7 +57,7 @@ Phaser.Animation.Parser = {
// Zero or smaller than frame sizes?
if (width == 0 || height == 0 || width < frameWidth || height < frameHeight || total === 0)
{
- console.warn("Phaser.Animation.Parser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight");
+ console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight");
return null;
}
@@ -95,7 +95,7 @@ Phaser.Animation.Parser = {
/**
* Parse the JSON data and extract the animation frame data from it.
*
- * @method Phaser.Animation.Parser.JSONData
+ * @method Phaser.AnimationParser.JSONData
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {Object} json - The JSON data from the Texture Atlas. Must be in Array format.
* @param {string} cacheKey - The Game.Cache asset key of the texture image.
@@ -106,7 +106,7 @@ Phaser.Animation.Parser = {
// Malformed?
if (!json['frames'])
{
- console.warn("Phaser.Animation.Parser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array");
+ console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array");
console.log(json);
return;
}
@@ -166,7 +166,7 @@ Phaser.Animation.Parser = {
/**
* Parse the JSON data and extract the animation frame data from it.
*
- * @method Phaser.Animation.Parser.JSONDataHash
+ * @method Phaser.AnimationParser.JSONDataHash
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {Object} json - The JSON data from the Texture Atlas. Must be in JSON Hash format.
* @param {string} cacheKey - The Game.Cache asset key of the texture image.
@@ -177,7 +177,7 @@ Phaser.Animation.Parser = {
// Malformed?
if (!json['frames'])
{
- console.warn("Phaser.Animation.Parser.JSONDataHash: Invalid Texture Atlas JSON given, missing 'frames' object");
+ console.warn("Phaser.AnimationParser.JSONDataHash: Invalid Texture Atlas JSON given, missing 'frames' object");
console.log(json);
return;
}
@@ -240,7 +240,7 @@ Phaser.Animation.Parser = {
/**
* Parse the XML data and extract the animation frame data from it.
*
- * @method Phaser.Animation.Parser.XMLData
+ * @method Phaser.AnimationParser.XMLData
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {Object} xml - The XML data from the Texture Atlas. Must be in Starling XML format.
* @param {string} cacheKey - The Game.Cache asset key of the texture image.
@@ -251,7 +251,7 @@ Phaser.Animation.Parser = {
// Malformed?
if (!xml.getElementsByTagName('TextureAtlas'))
{
- console.warn("Phaser.Animation.Parser.XMLData: Invalid Texture Atlas XML given, missing tag");
+ console.warn("Phaser.AnimationParser.XMLData: Invalid Texture Atlas XML given, missing tag");
return;
}
diff --git a/src/core/Camera.js b/src/core/Camera.js
index e8f74708..219098e7 100644
--- a/src/core/Camera.js
+++ b/src/core/Camera.js
@@ -5,7 +5,6 @@
*/
/**
-*
* 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
*
diff --git a/src/loader/Cache.js b/src/loader/Cache.js
index 312cecaa..4a21f5fa 100644
--- a/src/loader/Cache.js
+++ b/src/loader/Cache.js
@@ -114,7 +114,7 @@ Phaser.Cache.prototype = {
PIXI.BaseTextureCache[key] = new PIXI.BaseTexture(data);
PIXI.TextureCache[key] = new PIXI.Texture(PIXI.BaseTextureCache[key]);
- this._images[key].frameData = Phaser.Animation.Parser.spriteSheet(this.game, key, frameWidth, frameHeight, frameMax);
+ this._images[key].frameData = Phaser.AnimationParser.spriteSheet(this.game, key, frameWidth, frameHeight, frameMax);
},
@@ -156,15 +156,15 @@ Phaser.Cache.prototype = {
if (format == Phaser.Loader.TEXTURE_ATLAS_JSON_ARRAY)
{
- this._images[key].frameData = Phaser.Animation.Parser.JSONData(this.game, atlasData, key);
+ this._images[key].frameData = Phaser.AnimationParser.JSONData(this.game, atlasData, key);
}
else if (format == Phaser.Loader.TEXTURE_ATLAS_JSON_HASH)
{
- this._images[key].frameData = Phaser.Animation.Parser.JSONDataHash(this.game, atlasData, key);
+ this._images[key].frameData = Phaser.AnimationParser.JSONDataHash(this.game, atlasData, key);
}
else if (format == Phaser.Loader.TEXTURE_ATLAS_XML_STARLING)
{
- this._images[key].frameData = Phaser.Animation.Parser.XMLData(this.game, atlasData, key);
+ this._images[key].frameData = Phaser.AnimationParser.XMLData(this.game, atlasData, key);
}
},
@@ -186,7 +186,7 @@ Phaser.Cache.prototype = {
PIXI.TextureCache[key] = new PIXI.Texture(PIXI.BaseTextureCache[key]);
Phaser.Loader.Parser.bitmapFont(this.game, xmlData, key);
- // this._images[key].frameData = Phaser.Animation.Parser.XMLData(this.game, xmlData, key);
+ // this._images[key].frameData = Phaser.AnimationParser.XMLData(this.game, xmlData, key);
},
diff --git a/src/sound/Sound.js b/src/sound/Sound.js
index 0f73b4d4..bbd5948d 100644
--- a/src/sound/Sound.js
+++ b/src/sound/Sound.js
@@ -600,10 +600,10 @@ Phaser.Sound.prototype = {
/**
* Restart the sound, or a marked section of it.
* @method Phaser.Sound#restart
- * @param {string} marker - Assets key of the sound you want to play.
- * @param {number} position - The starting position.
- * @param {number} [volume] - Volume of the sound you want to play.
- * @param {boolean} [loop] - Loop when it finished playing? (Default to false)
+ * @param {string} [marker=''] - If you want to play a marker then give the key here, otherwise leave blank to play the full sound.
+ * @param {number} [position=0] - The starting position to play the sound from - this is ignored if you provide a marker.
+ * @param {number} [volume=1] - Volume of the sound you want to play.
+ * @param {boolean} [loop=false] - Loop when it finished playing?
*/
restart: function (marker, position, volume, loop) {
@@ -700,8 +700,9 @@ Phaser.Sound.prototype = {
};
/**
-* Get
-* @return {boolean} Description.
+* @name Phaser.Sound#isDecoding
+* @property {boolean} isDecoding - Returns true if the sound file is still decoding.
+* @readonly
*/
Object.defineProperty(Phaser.Sound.prototype, "isDecoding", {
@@ -712,8 +713,9 @@ Object.defineProperty(Phaser.Sound.prototype, "isDecoding", {
});
/**
-* Get
-* @return {boolean} Description.
+* @name Phaser.Sound#isDecoded
+* @property {boolean} isDecoded - Returns true if the sound file has decoded.
+* @readonly
*/
Object.defineProperty(Phaser.Sound.prototype, "isDecoded", {
@@ -724,11 +726,8 @@ Object.defineProperty(Phaser.Sound.prototype, "isDecoded", {
});
/**
-* Get
-* @return {boolean} Whether or not the sound is muted.
-*//**
-* Mutes sound.
-* @param {boolean} value - Whether or not the sound is muted.
+* @name Phaser.Sound#mute
+* @property {boolean} mute - Gets or sets the muted state of this sound.
*/
Object.defineProperty(Phaser.Sound.prototype, "mute", {
@@ -776,11 +775,9 @@ Object.defineProperty(Phaser.Sound.prototype, "mute", {
});
/**
-* Get the current volume. A value between 0 (silence) and 1 (full volume).
-* @return {number}
-*//**
-* Set
-* @param {number} value - Sets the current volume. A value between 0 (silence) and 1 (full volume).
+* @name Phaser.Sound#volume
+* @property {number} volume - Gets or sets the volume of this sound, a value between 0 and 1.
+* @readonly
*/
Object.defineProperty(Phaser.Sound.prototype, "volume", {
diff --git a/src/sound/SoundManager.js b/src/sound/SoundManager.js
index a1c0bc36..5fa60eb6 100644
--- a/src/sound/SoundManager.js
+++ b/src/sound/SoundManager.js
@@ -2,10 +2,8 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.SoundManager
*/
-
/**
* Sound Manager constructor.
*
@@ -96,7 +94,8 @@ Phaser.SoundManager.prototype = {
/**
* Initialises the sound manager.
- * @method boot
+ * @method Phaser.SoundManager#boot
+ * @protected
*/
boot: function () {
@@ -178,7 +177,7 @@ Phaser.SoundManager.prototype = {
/**
* Enables the audio, usually after the first touch.
- * @method unlock
+ * @method Phaser.SoundManager#unlock
*/
unlock: function () {
@@ -212,7 +211,7 @@ Phaser.SoundManager.prototype = {
/**
* Stops all the sounds in the game.
- * @method stopAll
+ * @method Phaser.SoundManager#stopAll
*/
stopAll: function () {
@@ -228,7 +227,7 @@ Phaser.SoundManager.prototype = {
/**
* Pauses all the sounds in the game.
- * @method pauseAll
+ * @method Phaser.SoundManager#pauseAll
*/
pauseAll: function () {
@@ -244,7 +243,7 @@ Phaser.SoundManager.prototype = {
/**
* resumes every sound in the game.
- * @method resumeAll
+ * @method Phaser.SoundManager#resumeAll
*/
resumeAll: function () {
@@ -259,8 +258,8 @@ Phaser.SoundManager.prototype = {
},
/**
- * Decode a sound with its assets key.
- * @method decode
+ * Decode a sound by its assets key.
+ * @method Phaser.SoundManager#decode
* @param {string} key - Assets key of the sound to be decoded.
* @param {Phaser.Sound} [sound] - Its buffer will be set to decoded data.
*/
@@ -292,7 +291,7 @@ Phaser.SoundManager.prototype = {
/**
* Updates every sound in the game.
- * @method update
+ * @method Phaser.SoundManager#update
*/
update: function () {
@@ -317,21 +316,18 @@ Phaser.SoundManager.prototype = {
},
-
/**
- * Description.
- * @method add
+ * Adds a new Sound into the SoundManager.
+ * @method Phaser.SoundManager#add
* @param {string} key - Asset key for the sound.
- * @param {number} volume - Default value for the volume.
- * @param {boolean} loop - Whether or not the sound will loop.
+ * @param {number} [volume=1] - Default value for the volume.
+ * @param {boolean} [loop=false] - Whether or not the sound will loop.
*/
add: function (key, volume, loop) {
volume = volume || 1;
if (typeof loop == 'undefined') { loop = false; }
-
-
var sound = new Phaser.Sound(this.game, key, volume, loop);
this._sounds.push(sound);
@@ -343,11 +339,8 @@ Phaser.SoundManager.prototype = {
};
/**
-* A global audio mute toggle.
-* @return {boolean} Whether or not the game is on "mute".
-*//**
-* Mute sounds.
-* @param {boolean} value - Whether or not the game is on "mute"
+* @name Phaser.SoundManager#mute
+* @property {boolean} mute - Gets or sets the muted state of the SoundManager. This effects all sounds in the game.
*/
Object.defineProperty(Phaser.SoundManager.prototype, "mute", {
@@ -413,11 +406,8 @@ Object.defineProperty(Phaser.SoundManager.prototype, "mute", {
});
/**
-* Get
-* @return {number} The global audio volume. A value between 0 (silence) and 1 (full volume).
-*//**
-* Sets the global volume
-* @return {number} value - The global audio volume. A value between 0 (silence) and 1 (full volume).
+* @name Phaser.SoundManager#volume
+* @property {number} volume - Gets or sets the global volume of the SoundManager, a value between 0 and 1.
*/
Object.defineProperty(Phaser.SoundManager.prototype, "volume", {
diff --git a/src/system/Canvas.js b/src/system/Canvas.js
index 80b88779..5815bb64 100644
--- a/src/system/Canvas.js
+++ b/src/system/Canvas.js
@@ -2,20 +2,20 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.Canvas
*/
/**
* The Canvas class handles everything related to the <canvas> tag as a DOM Element, like styles, offset, aspect ratio
*
-* @class Canvas
+* @class Phaser.Canvas
* @static
*/
Phaser.Canvas = {
+
/**
* Creates the <canvas> tag
*
- * @method create
+ * @method Phaser.Canvas.create
* @param {number} width - The desired width.
* @param {number} height - The desired height.
* @return {HTMLCanvasElement} The newly created <canvas> tag.
@@ -35,7 +35,7 @@ Phaser.Canvas = {
/**
* Get the DOM offset values of any given element
- * @method getOffset
+ * @method Phaser.Canvas.getOffset
* @param {HTMLElement} element - The targeted element that we want to retrieve the offset.
* @param {Phaser.Point} [point] - The point we want to take the x/y values of the offset.
* @return {Phaser.Point} - A point objet with the offsetX and Y as its properties.
@@ -60,7 +60,7 @@ Phaser.Canvas = {
/**
* Returns the aspect ratio of the given canvas.
*
- * @method getAspectRatio
+ * @method Phaser.Canvas.getAspectRatio
* @param {HTMLCanvasElement} canvas - The canvas to get the aspect ratio from.
* @return {number} The ratio between canvas' width and height.
*/
@@ -71,7 +71,7 @@ Phaser.Canvas = {
/**
* Sets the background color behind the canvas. This changes the canvas style property.
*
- * @method setBackgroundColor
+ * @method Phaser.Canvas.setBackgroundColor
* @param {HTMLCanvasElement} canvas - The canvas to set the background color on.
* @param {string} [color] - The color to set. Can be in the format 'rgb(r,g,b)', or '#RRGGBB' or any valid CSS color.
* @return {HTMLCanvasElement} Returns the source canvas.
@@ -89,7 +89,7 @@ Phaser.Canvas = {
/**
* Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.
*
- * @method setTouchAction
+ * @method Phaser.Canvas.setTouchAction
* @param {HTMLCanvasElement} canvas - The canvas to set the touch action on.
* @param {String} [value] - The touch action to set. Defaults to 'none'.
* @return {HTMLCanvasElement} The source canvas.
@@ -106,8 +106,18 @@ Phaser.Canvas = {
},
+ /**
+ * Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.
+ *
+ * @method Phaser.Canvas.setUserSelect
+ * @param {HTMLCanvasElement} canvas - The canvas to set the touch action on.
+ * @param {String} [value] - The touch action to set. Defaults to 'none'.
+ * @return {HTMLCanvasElement} The source canvas.
+ */
setUserSelect: function (canvas, value) {
+ value = value || 'none';
+
canvas.style['-webkit-touch-callout'] = value;
canvas.style['-webkit-user-select'] = value;
canvas.style['-khtml-user-select'] = value;
@@ -124,7 +134,7 @@ Phaser.Canvas = {
* Adds the given canvas element to the DOM. The canvas will be added as a child of the given parent.
* If no parent is given it will be added as a child of the document.body.
*
- * @method addToDOM
+ * @method Phaser.Canvas.addToDOM
* @param {HTMLCanvasElement} canvas - The canvas to set the touch action on.
* @param {string} parent - The DOM element to add the canvas to. Defaults to ''.
* @param {boolean} overflowHidden - If set to true it will add the overflow='hidden' style to the parent DOM element.
@@ -164,7 +174,7 @@ Phaser.Canvas = {
/**
* Sets the transform of the given canvas to the matrix values provided.
*
- * @method setTransform
+ * @method Phaser.Canvas.setTransform
* @param {CanvasRenderingContext2D} context - The context to set the transform on.
* @param {number} translateX - The value to translate horizontally by.
* @param {number} translateY - The value to translate vertically by.
@@ -189,7 +199,7 @@ Phaser.Canvas = {
* drawn to the context will be affected. This sets the property across all current browsers but support is
* patchy on earlier browsers, especially on mobile.
*
- * @method setSmoothingEnabled
+ * @method Phaser.Canvas.setSmoothingEnabled
* @param {CanvasRenderingContext2D} context - The context to enable or disable the image smoothing on.
* @param {boolean} value - If set to true it will enable image smoothing, false will disable it.
* @return {CanvasRenderingContext2D} Returns the source context.
@@ -210,7 +220,7 @@ Phaser.Canvas = {
* Sets the CSS image-rendering property on the given canvas to be 'crisp' (aka 'optimize contrast on webkit').
* Note that if this doesn't given the desired result then see the setSmoothingEnabled.
*
- * @method setImageRenderingCrisp
+ * @method Phaser.Canvas.setImageRenderingCrisp
* @param {HTMLCanvasElement} canvas - The canvas to set image-rendering crisp on.
* @return {HTMLCanvasElement} Returns the source canvas.
*/
@@ -229,7 +239,7 @@ Phaser.Canvas = {
* Sets the CSS image-rendering property on the given canvas to be 'bicubic' (aka 'auto').
* Note that if this doesn't given the desired result then see the CanvasUtils.setSmoothingEnabled method.
*
- * @method setImageRenderingBicubic
+ * @method Phaser.Canvas.setImageRenderingBicubic
* @param {HTMLCanvasElement} canvas The canvas to set image-rendering bicubic on.
* @return {HTMLCanvasElement} Returns the source canvas.
*/
diff --git a/src/system/Device.js b/src/system/Device.js
index f6748636..fffd771e 100644
--- a/src/system/Device.js
+++ b/src/system/Device.js
@@ -2,13 +2,10 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.Device
*/
-
/**
* Detects device support capabilities. Using some elements from System.js by MrDoob and Modernizr
-* {@link https://github.com/Modernizr/Modernizr/blob/master/feature-detects/audio.js}
*
* @class Phaser.Device
* @constructor
@@ -17,8 +14,7 @@
Phaser.Device = function () {
/**
- * An optional 'fix' for the horrendous Android stock browser bug
- * {@link https://code.google.com/p/android/issues/detail?id=39247}
+ * An optional 'fix' for the horrendous Android stock browser bug https://code.google.com/p/android/issues/detail?id=39247
* @property {boolean} patchAndroidClearRectBug - Description.
* @default
*/
@@ -283,7 +279,7 @@ Phaser.Device.prototype = {
/**
* Check which OS is game running on.
- * @method _checkOS
+ * @method Phaser.Device#_checkOS
* @private
*/
_checkOS: function () {
@@ -312,7 +308,7 @@ Phaser.Device.prototype = {
/**
* Check HTML5 features of the host environment.
- * @method _checkFeatures
+ * @method Phaser.Device#_checkFeatures
* @private
*/
_checkFeatures: function () {
@@ -345,7 +341,7 @@ Phaser.Device.prototype = {
/**
* Check what browser is game running in.
- * @method _checkBrowser
+ * @method Phaser.Device#_checkBrowser
* @private
*/
_checkBrowser: function () {
@@ -382,7 +378,7 @@ Phaser.Device.prototype = {
/**
* Check audio support.
- * @method _checkAudio
+ * @method Phaser.Device#_checkAudio
* @private
*/
_checkAudio: function () {
@@ -429,7 +425,7 @@ Phaser.Device.prototype = {
/**
* Check PixelRatio of devices.
- * @method _checkDevice
+ * @method Phaser.Device#_checkDevice
* @private
*/
_checkDevice: function () {
@@ -443,10 +439,11 @@ Phaser.Device.prototype = {
/**
* Check whether the host environment support 3D CSS.
- * @method _checkCSS3D
+ * @method Phaser.Device#_checkCSS3D
* @private
*/
_checkCSS3D: function () {
+
var el = document.createElement('p');
var has3d;
var transforms = {
@@ -456,6 +453,7 @@ Phaser.Device.prototype = {
'MozTransform': '-moz-transform',
'transform': 'transform'
};
+
// Add it to the body to get the computed style.
document.body.insertBefore(el, null);
@@ -465,6 +463,7 @@ Phaser.Device.prototype = {
has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
}
}
+
document.body.removeChild(el);
this.css3D = (has3d !== undefined && has3d.length > 0 && has3d !== "none");
@@ -472,20 +471,30 @@ Phaser.Device.prototype = {
/**
* Check whether the host environment can play audio.
- * @method canPlayAudio
+ * @method Phaser.Device#canPlayAudio
* @param {string} type - One of 'mp3, 'ogg', 'm4a', 'wav', 'webm'.
+ * @return {boolean} True if the given file type is supported by the browser, otherwise false.
*/
canPlayAudio: function (type) {
- if (type == 'mp3' && this.mp3) {
+ if (type == 'mp3' && this.mp3)
+ {
return true;
- } else if (type == 'ogg' && (this.ogg || this.opus)) {
+ }
+ else if (type == 'ogg' && (this.ogg || this.opus))
+ {
return true;
- } else if (type == 'm4a' && this.m4a) {
+ }
+ else if (type == 'm4a' && this.m4a)
+ {
return true;
- } else if (type == 'wav' && this.wav) {
+ }
+ else if (type == 'wav' && this.wav)
+ {
return true;
- } else if (type == 'webm' && this.webm) {
+ }
+ else if (type == 'webm' && this.webm)
+ {
return true;
}
@@ -495,21 +504,23 @@ Phaser.Device.prototype = {
/**
* Check whether the console is open.
- * @method isConsoleOpen
- * @return {boolean} True if console is open.
+ * @method Phaser.Device#isConsoleOpen
+ * @return {boolean} True if the browser dev console is open.
*/
-
isConsoleOpen: function () {
- if (window.console && window.console['firebug']) {
+ if (window.console && window.console['firebug'])
+ {
return true;
}
- if (window.console) {
+ if (window.console)
+ {
console.profile();
console.profileEnd();
- if (console.clear) {
+ if (console.clear)
+ {
console.clear();
}
diff --git a/src/system/RequestAnimationFrame.js b/src/system/RequestAnimationFrame.js
index 816c14ec..6fe2ae74 100644
--- a/src/system/RequestAnimationFrame.js
+++ b/src/system/RequestAnimationFrame.js
@@ -2,10 +2,8 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.RequestAnimationFrame
*/
-
/**
* Abstracts away the use of RAF or setTimeOut for the core game update loop.
*
@@ -39,26 +37,28 @@ Phaser.RequestAnimationFrame = function(game) {
'o'
];
- for (var x = 0; x < vendors.length && !window.requestAnimationFrame; x++) {
+ for (var x = 0; x < vendors.length && !window.requestAnimationFrame; x++)
+ {
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'];
}
-};
-
-Phaser.RequestAnimationFrame.prototype = {
-
/**
* The function called by the update
* @property _onLoop
* @private
- **/
- _onLoop: null,
+ */
+ this._onLoop = null;
+
+};
+
+Phaser.RequestAnimationFrame.prototype = {
+
/**
* Starts the requestAnimatioFrame running or setTimeout if unavailable in browser
- * @method start
- **/
+ * @method Phaser.RequestAnimationFrame#start
+ */
start: function () {
this.isRunning = true;
@@ -90,9 +90,9 @@ Phaser.RequestAnimationFrame.prototype = {
/**
* The update method for the requestAnimationFrame
- * @method updateRAF
- * @param {number} time - Description.
- **/
+ * @method Phaser.RequestAnimationFrame#updateRAF
+ * @param {number} time - A timestamp, either from RAF or setTimeOut
+ */
updateRAF: function (time) {
this.game.update(time);
@@ -103,8 +103,8 @@ Phaser.RequestAnimationFrame.prototype = {
/**
* The update method for the setTimeout.
- * @method updateSetTimeout
- **/
+ * @method Phaser.RequestAnimationFrame#updateSetTimeout
+ */
updateSetTimeout: function () {
this.game.update(Date.now());
@@ -115,8 +115,8 @@ Phaser.RequestAnimationFrame.prototype = {
/**
* Stops the requestAnimationFrame from running.
- * @method stop
- **/
+ * @method Phaser.RequestAnimationFrame#stop
+ */
stop: function () {
if (this._isSetTimeOut)
@@ -134,18 +134,18 @@ Phaser.RequestAnimationFrame.prototype = {
/**
* Is the browser using setTimeout?
- * @method isSetTimeOut
+ * @method Phaser.RequestAnimationFrame#isSetTimeOut
* @return {boolean}
- **/
+ */
isSetTimeOut: function () {
return this._isSetTimeOut;
},
/**
* Is the browser using requestAnimationFrame?
- * @method isRAF
+ * @method Phaser.RequestAnimationFrame#isRAF
* @return {boolean}
- **/
+ */
isRAF: function () {
return (this._isSetTimeOut === false);
}
diff --git a/src/system/StageScaleMode.js b/src/system/StageScaleMode.js
index 8fc6155c..f154a142 100644
--- a/src/system/StageScaleMode.js
+++ b/src/system/StageScaleMode.js
@@ -2,7 +2,6 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.StageScaleMode
*/
/**
@@ -156,14 +155,30 @@ Phaser.StageScaleMode = function (game, width, height) {
};
+/**
+* @constant
+* @type {number}
+*/
Phaser.StageScaleMode.EXACT_FIT = 0;
+
+/**
+* @constant
+* @type {number}
+*/
Phaser.StageScaleMode.NO_SCALE = 1;
+
+/**
+* @constant
+* @type {number}
+*/
Phaser.StageScaleMode.SHOW_ALL = 2;
Phaser.StageScaleMode.prototype = {
+
/**
- * Description.
- * @method startFullScreen
+ * Tries to enter the browser into full screen mode.
+ * Please note that this needs to be supported by the web browser and isn't the same thing as setting your game to fill the browser.
+ * @method Phaser.StageScaleMode#startFullScreen
*/
startFullScreen: function () {
@@ -193,8 +208,8 @@ Phaser.StageScaleMode.prototype = {
},
/**
- * Description.
- * @method stopFullScreen
+ * Stops full screen mode if the browser is in it.
+ * @method Phaser.StageScaleMode#stopFullScreen
*/
stopFullScreen: function () {
@@ -214,8 +229,8 @@ Phaser.StageScaleMode.prototype = {
},
/**
- * Description.
- * @method checkOrientationState
+ * Checks if the browser is in the correct orientation for your game (if forceLandscape or forcePortrait have been set)
+ * @method Phaser.StageScaleMode#checkOrientationState
*/
checkOrientationState: function () {
@@ -244,8 +259,8 @@ Phaser.StageScaleMode.prototype = {
/**
* Handle window.orientationchange events
- * @method checkOrientation
- * @param {Description} event - Description.
+ * @method Phaser.StageScaleMode#checkOrientation
+ * @param {Event} event - The orientationchange event data.
*/
checkOrientation: function (event) {
@@ -269,8 +284,8 @@ Phaser.StageScaleMode.prototype = {
/**
* Handle window.resize events
- * @method checkResize
- * @param {Description} event - Description.
+ * @method Phaser.StageScaleMode#checkResize
+ * @param {Event} event - The resize event data.
*/
checkResize: function (event) {
@@ -300,7 +315,7 @@ Phaser.StageScaleMode.prototype = {
/**
* Re-calculate scale mode and update screen size.
- * @method refresh
+ * @method Phaser.StageScaleMode#refresh
*/
refresh: function () {
@@ -335,7 +350,7 @@ Phaser.StageScaleMode.prototype = {
/**
* Set screen size automatically based on the scaleMode.
- * @param {Description} force - Description.
+ * @param {Description} force - If force is true it will try to resize the game regardless of the document dimensions.
*/
setScreenSize: function (force) {
@@ -384,8 +399,8 @@ Phaser.StageScaleMode.prototype = {
},
/**
- * Description.
- * @method setSize
+ * Sets the canvas style width and height values based on minWidth/Height and maxWidth/Height.
+ * @method Phaser.StageScaleMode#setSize
*/
setSize: function () {
@@ -451,8 +466,8 @@ Phaser.StageScaleMode.prototype = {
},
/**
- * Description.
- * @method setMaximum
+ * Sets this.width equal to window.innerWidth and this.height equal to window.innerHeight
+ * @method Phaser.StageScaleMode#setMaximum
*/
setMaximum: function () {
@@ -462,8 +477,8 @@ Phaser.StageScaleMode.prototype = {
},
/**
- * Description.
- * @method setShowAll
+ * Calculates the multiplier needed to scale the game proportionally.
+ * @method Phaser.StageScaleMode#setShowAll
*/
setShowAll: function () {
@@ -475,15 +490,15 @@ Phaser.StageScaleMode.prototype = {
},
/**
- * Description.
- * @method setExactFit
+ * Sets the width and height values of the canvas, no larger than the maxWidth/Height.
+ * @method Phaser.StageScaleMode#setExactFit
*/
setExactFit: function () {
var availableWidth = window.innerWidth - 0;
var availableHeight = window.innerHeight - 5;
- console.log('available', availableWidth, availableHeight);
+ // console.log('available', availableWidth, availableHeight);
if (this.maxWidth && availableWidth > this.maxWidth)
{
@@ -510,8 +525,9 @@ Phaser.StageScaleMode.prototype = {
};
/**
-* Get
-* @return {boolean}
+* @name Phaser.StageScaleMode#isFullScreen
+* @property {boolean} isFullScreen - Returns true if the browser is in full screen mode, otherwise false.
+* @readonly
*/
Object.defineProperty(Phaser.StageScaleMode.prototype, "isFullScreen", {
@@ -529,8 +545,9 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isFullScreen", {
});
/**
-* Get
-* @return {number}
+* @name Phaser.StageScaleMode#isPortrait
+* @property {boolean} isPortrait - Returns true if the browser dimensions match a portrait display.
+* @readonly
*/
Object.defineProperty(Phaser.StageScaleMode.prototype, "isPortrait", {
@@ -541,8 +558,9 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isPortrait", {
});
/**
-* Get
-* @return {number}
+* @name Phaser.StageScaleMode#isLandscape
+* @property {boolean} isLandscape - Returns true if the browser dimensions match a landscape display.
+* @readonly
*/
Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", {
@@ -551,4 +569,3 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", {
}
});
-