diff --git a/Docs/conf.json b/Docs/conf.json index f2647232..c04e4df9 100644 --- a/Docs/conf.json +++ b/Docs/conf.json @@ -3,7 +3,7 @@ "allowUnknownTags": true }, "source": { - "include": [ "../src/Phaser.js", "../src/animation/", "../src/core/", "../src/geom/", "../src/input/", "../src/loader/", "../src/math/", "../src/net/", "../src/particles/" ], + "include": [ "../src/Phaser.js", "../src/animation/", "../src/core/", "../src/geom/", "../src/input/", "../src/loader/", "../src/math/", "../src/net/", "../src/particles/", "../src/sound/", "../src/system/" ], "exclude": [], "includePattern": ".+\\.js(doc)?$", "excludePattern": "(^|\\/|\\\\)_" diff --git a/Docs/out/Animation.js.html b/Docs/out/Animation.js.html index e3320831..8cd9d0b5 100644 --- a/Docs/out/Animation.js.html +++ b/Docs/out/Animation.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -669,7 +679,7 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa 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/AnimationManager.js.html b/Docs/out/AnimationManager.js.html index d80662af..b6cf1bc8 100644 --- a/Docs/out/AnimationManager.js.html +++ b/Docs/out/AnimationManager.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -618,7 +628,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", { 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/Cache.js.html b/Docs/out/Cache.js.html index 8f1925a2..72829b93 100644 --- a/Docs/out/Cache.js.html +++ b/Docs/out/Cache.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -981,7 +991,7 @@ Phaser.Cache.prototype = { 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/Camera.js.html b/Docs/out/Camera.js.html index e5b5a893..a97d4c89 100644 --- a/Docs/out/Camera.js.html +++ b/Docs/out/Camera.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -598,7 +608,7 @@ Object.defineProperty(Phaser.Camera.prototype, "height", { 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/Canvas.js.html b/Docs/out/Canvas.js.html new file mode 100644 index 00000000..995fd165 --- /dev/null +++ b/Docs/out/Canvas.js.html @@ -0,0 +1,554 @@ + + + + + + Phaser Source: system/Canvas.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: system/Canvas.js

    + +
    +
    +
    /**
    +* @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;
    +
    +    }
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Circle.js.html b/Docs/out/Circle.js.html index 2f04c9e1..018910a5 100644 --- a/Docs/out/Circle.js.html +++ b/Docs/out/Circle.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -716,7 +726,7 @@ Phaser.Circle.intersectsRectangle = function (c, r) { 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/Device.js.html b/Docs/out/Device.js.html new file mode 100644 index 00000000..420c4ae0 --- /dev/null +++ b/Docs/out/Device.js.html @@ -0,0 +1,833 @@ + + + + + + Phaser Source: system/Device.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: system/Device.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2013 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* Detects device support capabilities. Using some elements from System.js by MrDoob and Modernizr
    +*
    +* @class Phaser.Device
    +* @constructor
    +*/
    +
    +Phaser.Device = function () {
    +
    +    /**
    +    * 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
    +    */
    +    this.patchAndroidClearRectBug = false;
    +
    +    //  Operating System
    +
    +    /**
    +    * @property {boolean} desktop - Is running desktop?
    +    * @default
    +    */
    +    this.desktop = false;
    +
    +    /**
    +    * @property {boolean} iOS - Is running on iOS?
    +    * @default
    +    */
    +    this.iOS = false;
    +
    +    /**
    +    * @property {boolean} android - Is running on android?
    +    * @default
    +    */
    +    this.android = false;
    +
    +    /**
    +    * @property {boolean} chromeOS - Is running on chromeOS?
    +    * @default
    +    */
    +    this.chromeOS = false;
    +
    +    /**
    +    * @property {boolean} linux - Is running on linux?
    +    * @default
    +    */
    +    this.linux = false;
    +
    +    /**
    +    * @property {boolean} macOS - Is running on macOS?
    +    * @default
    +    */
    +    this.macOS = false;
    +
    +    /**
    +    * @property {boolean} windows - Is running on windows?
    +    * @default
    +    */
    +    this.windows = false;
    +
    +    //  Features
    +
    +    /**
    +    * @property {boolean} canvas - Is canvas available?
    +    * @default
    +    */
    +    this.canvas = false;
    +
    +    /**
    +    * @property {boolean} file - Is file available?
    +    * @default
    +    */
    +    this.file = false;
    +
    +    /**
    +    * @property {boolean} fileSystem - Is fileSystem available?
    +    * @default
    +    */
    +    this.fileSystem = false;
    +
    +    /**
    +    * @property {boolean} localStorage - Is localStorage available?
    +    * @default
    +    */
    +    this.localStorage = false;
    +
    +    /**
    +    * @property {boolean} webGL - Is webGL available?
    +    * @default
    +    */
    +    this.webGL = false;
    +
    +    /**
    +    * @property {boolean} worker - Is worker available?
    +    * @default
    +    */
    +    this.worker = false;
    +
    +    /**
    +    * @property {boolean} touch - Is touch available?
    +    * @default
    +    */
    +    this.touch = false;
    +
    +    /**
    +    * @property {boolean} mspointer - Is mspointer available?
    +    * @default
    +    */
    +    this.mspointer = false;
    +
    +    /**
    +    * @property {boolean} css3D - Is css3D available?
    +    * @default
    +    */
    +    this.css3D = false;
    +
    +    /** 
    +    * @property {boolean} pointerLock - Is Pointer Lock available?
    +    * @default
    +    */
    +    this.pointerLock = false;
    +
    +    //  Browser
    +
    +    /**
    +    * @property {boolean} arora - Is running in arora?
    +    * @default
    +    */
    +    this.arora = false;
    +
    +    /**
    +    * @property {boolean} chrome - Is running in chrome?
    +    * @default
    +    */
    +    this.chrome = false;
    +
    +    /**
    +    * @property {boolean} epiphany - Is running in epiphany?
    +    * @default
    +    */
    +    this.epiphany = false;
    +
    +    /**
    +    * @property {boolean} firefox - Is running in firefox?
    +    * @default
    +    */
    +    this.firefox = false;
    +
    +    /**
    +    * @property {boolean} ie - Is running in ie?
    +    * @default
    +    */
    +    this.ie = false;
    +
    +    /**
    +    * @property {number} ieVersion - Version of ie?
    +    * @default
    +    */
    +    this.ieVersion = 0;
    +
    +    /**
    +    * @property {boolean} mobileSafari - Is running in mobileSafari?
    +    * @default
    +    */
    +    this.mobileSafari = false;
    +
    +    /**
    +    * @property {boolean} midori - Is running in midori?
    +    * @default
    +    */
    +    this.midori = false;
    +
    +    /**
    +    * @property {boolean} opera - Is running in opera?
    +    * @default
    +    */
    +    this.opera = false;
    +
    +    /**
    +    * @property {boolean} safari - Is running in safari?
    +    * @default
    +    */
    +    this.safari = false;
    +    this.webApp = false;
    +
    +    //  Audio
    +
    +    /**
    +    * @property {boolean} audioData - Are Audio tags available?
    +    * @default
    +    */
    +    this.audioData = false;
    +
    +    /**
    +    * @property {boolean} webAudio - Is the WebAudio API available?
    +    * @default
    +    */
    +    this.webAudio = false;
    +
    +    /**
    +    * @property {boolean} ogg - Can this device play ogg files?
    +    * @default
    +    */
    +    this.ogg = false;
    +
    +    /**
    +    * @property {boolean} opus - Can this device play opus files?
    +    * @default
    +    */
    +    this.opus = false;
    +
    +    /**
    +    * @property {boolean} mp3 - Can this device play mp3 files?
    +    * @default
    +    */
    +    this.mp3 = false;
    +
    +    /**
    +    * @property {boolean} wav - Can this device play wav files?
    +    * @default
    +    */
    +    this.wav = false;
    +    /**
    +    * Can this device play m4a files?
    +    * @property {boolean} m4a - True if this device can play m4a files.
    +    * @default
    +    */
    +    this.m4a = false;
    +
    +    /**
    +    * @property {boolean} webm - Can this device play webm files?
    +    * @default
    +    */
    +    this.webm = false;
    +
    +    //  Device
    +
    +    /**
    +    * @property {boolean} iPhone - Is running on iPhone?
    +    * @default
    +    */
    +    this.iPhone = false;
    +
    +    /**
    +    * @property {boolean} iPhone4 - Is running on iPhone4?
    +    * @default
    +    */
    +    this.iPhone4 = false;
    +
    +    /** 
    +    * @property {boolean} iPad - Is running on iPad?
    +    * @default
    +    */
    +    this.iPad = false;
    +
    +    /**
    +    * @property {number} pixelRatio - PixelRatio of the host device?
    +    * @default
    +    */
    +    this.pixelRatio = 0;
    +
    +    //  Run the checks
    +    this._checkAudio();
    +    this._checkBrowser();
    +    this._checkCSS3D();
    +    this._checkDevice();
    +    this._checkFeatures();
    +    this._checkOS();
    +    
    +};
    +
    +Phaser.Device.prototype = {
    +
    +    /**
    +    * Check which OS is game running on.
    +    * @method Phaser.Device#_checkOS
    +    * @private
    +    */
    +    _checkOS: function () {
    +
    +        var ua = navigator.userAgent;
    +
    +        if (/Android/.test(ua)) {
    +            this.android = true;
    +        } else if (/CrOS/.test(ua)) {
    +            this.chromeOS = true;
    +        } else if (/iP[ao]d|iPhone/i.test(ua)) {
    +            this.iOS = true;
    +        } else if (/Linux/.test(ua)) {
    +            this.linux = true;
    +        } else if (/Mac OS/.test(ua)) {
    +            this.macOS = true;
    +        } else if (/Windows/.test(ua)) {
    +            this.windows = true;
    +        }
    +
    +        if (this.windows || this.macOS || this.linux) {
    +            this.desktop = true;
    +        }
    +
    +    },
    +
    +    /**
    +    * Check HTML5 features of the host environment.
    +    * @method Phaser.Device#_checkFeatures
    +    * @private
    +    */
    +    _checkFeatures: function () {
    +
    +        this.canvas = !!window['CanvasRenderingContext2D'];
    +
    +        try {
    +            this.localStorage = !!localStorage.getItem;
    +        } catch (error) {
    +            this.localStorage = false;
    +        }
    +
    +        this.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob'];
    +        this.fileSystem = !!window['requestFileSystem'];
    +        this.webGL = ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )();
    +        // this.webGL = !!window['WebGLRenderingContext'];
    +        this.worker = !!window['Worker'];
    +        
    +        if ('ontouchstart' in document.documentElement || window.navigator.msPointerEnabled) {
    +            this.touch = true;
    +        }
    +
    +        if (window.navigator.msPointerEnabled) {
    +            this.mspointer = true;
    +        }
    +        
    +        this.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document;
    +
    +    },
    +
    +    /**
    +    * Check what browser is game running in.
    +    * @method Phaser.Device#_checkBrowser
    +    * @private
    +    */
    +    _checkBrowser: function () {
    +
    +        var ua = navigator.userAgent;
    +
    +        if (/Arora/.test(ua)) {
    +            this.arora = true;
    +        } else if (/Chrome/.test(ua)) {
    +            this.chrome = true;
    +        } else if (/Epiphany/.test(ua)) {
    +            this.epiphany = true;
    +        } else if (/Firefox/.test(ua)) {
    +            this.firefox = true;
    +        } else if (/Mobile Safari/.test(ua)) {
    +            this.mobileSafari = true;
    +        } else if (/MSIE (\d+\.\d+);/.test(ua)) {
    +            this.ie = true;
    +            this.ieVersion = parseInt(RegExp.$1);
    +        } else if (/Midori/.test(ua)) {
    +            this.midori = true;
    +        } else if (/Opera/.test(ua)) {
    +            this.opera = true;
    +        } else if (/Safari/.test(ua)) {
    +            this.safari = true;
    +        }
    +
    +        // WebApp mode in iOS
    +        if (navigator['standalone']) {
    +            this.webApp = true;
    +        }
    +
    +    },
    +
    +    /**
    +    * Check audio support.
    +    * @method Phaser.Device#_checkAudio
    +    * @private
    +    */
    +    _checkAudio: function () {
    +
    +        this.audioData = !!(window['Audio']);
    +        this.webAudio = !!(window['webkitAudioContext'] || window['AudioContext']);
    +        var audioElement = document.createElement('audio');
    +        var result = false;
    +
    +        try {
    +            if (result = !!audioElement.canPlayType) {
    +                
    +                if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) {
    +                    this.ogg = true;
    +                }
    +
    +                if (audioElement.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, '')) {
    +                    this.opus = true;
    +                }
    +
    +                if (audioElement.canPlayType('audio/mpeg;').replace(/^no$/, '')) {
    +                    this.mp3 = true;
    +                }
    +
    +                // Mimetypes accepted:
    +                //   developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements
    +                //   bit.ly/iphoneoscodecs
    +                if (audioElement.canPlayType('audio/wav; codecs="1"').replace(/^no$/, '')) {
    +                    this.wav = true;
    +                }
    +
    +                if (audioElement.canPlayType('audio/x-m4a;') || audioElement.canPlayType('audio/aac;').replace(/^no$/, '')) {
    +                    this.m4a = true;
    +                }
    +
    +                if (audioElement.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, '')) {
    +                    this.webm = true;
    +                }
    +            }
    +        } catch (e) {
    +        }
    +
    +    },
    +
    +    /**
    +    * Check PixelRatio of devices.
    +    * @method Phaser.Device#_checkDevice
    +    * @private
    +    */
    +    _checkDevice: function () {
    +
    +        this.pixelRatio = window['devicePixelRatio'] || 1;
    +        this.iPhone = navigator.userAgent.toLowerCase().indexOf('iphone') != -1;
    +        this.iPhone4 = (this.pixelRatio == 2 && this.iPhone);
    +        this.iPad = navigator.userAgent.toLowerCase().indexOf('ipad') != -1;
    +
    +    },
    +
    +    /**
    +    * Check whether the host environment support 3D CSS.
    +    * @method Phaser.Device#_checkCSS3D
    +    * @private
    +    */
    +    _checkCSS3D: function () {
    +
    +        var el = document.createElement('p');
    +        var has3d;
    +        var transforms = {
    +            'webkitTransform': '-webkit-transform',
    +            'OTransform': '-o-transform',
    +            'msTransform': '-ms-transform',
    +            'MozTransform': '-moz-transform',
    +            'transform': 'transform'
    +        };
    +
    +        // Add it to the body to get the computed style.
    +        document.body.insertBefore(el, null);
    +
    +        for (var t in transforms) {
    +            if (el.style[t] !== undefined) {
    +                el.style[t] = "translate3d(1px,1px,1px)";
    +                has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
    +            }
    +        }
    +        
    +        document.body.removeChild(el);
    +        this.css3D = (has3d !== undefined && has3d.length > 0 && has3d !== "none");
    +
    +    },
    +
    +    /**
    +    * Check whether the host environment can play audio.
    +    * @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)
    +        {
    +            return true;
    +        }
    +        else if (type == 'ogg' && (this.ogg || this.opus))
    +        {
    +            return true;
    +        }
    +        else if (type == 'm4a' && this.m4a)
    +        {
    +            return true;
    +        }
    +        else if (type == 'wav' && this.wav)
    +        {
    +            return true;
    +        }
    +        else if (type == 'webm' && this.webm)
    +        {
    +            return true;
    +        }
    +
    +        return false;
    +
    +    },
    +
    +    /**
    +    * Check whether the 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'])
    +        {
    +            return true;
    +        }
    +
    +        if (window.console)
    +        {
    +            console.profile();
    +            console.profileEnd();
    +
    +            if (console.clear)
    +            {
    +                console.clear();
    +            }
    +
    +            return console['profiles'].length > 0;
    +        }
    +
    +        return false;
    +
    +    }
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Emitter.js.html b/Docs/out/Emitter.js.html index bafae588..972435b1 100644 --- a/Docs/out/Emitter.js.html +++ b/Docs/out/Emitter.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -406,7 +416,7 @@ Phaser.Animation.Frame.prototype = { 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/FrameData.js.html b/Docs/out/FrameData.js.html index e29ebf1e..570a29a7 100644 --- a/Docs/out/FrameData.js.html +++ b/Docs/out/FrameData.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -480,7 +490,7 @@ Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", { 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/Game.js.html b/Docs/out/Game.js.html index 837392f5..3e32bbe2 100644 --- a/Docs/out/Game.js.html +++ b/Docs/out/Game.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -721,7 +731,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", { 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/Group.js.html b/Docs/out/Group.js.html index 3ceb235a..4e0129ba 100644 --- a/Docs/out/Group.js.html +++ b/Docs/out/Group.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -1402,7 +1412,7 @@ Object.defineProperty(Phaser.Group.prototype, "visible", { 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/Input.js.html b/Docs/out/Input.js.html index ca7787c9..22ff0c06 100644 --- a/Docs/out/Input.js.html +++ b/Docs/out/Input.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -1067,7 +1077,7 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", { 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/InputHandler.js.html b/Docs/out/InputHandler.js.html index da0c6439..23d89119 100644 --- a/Docs/out/InputHandler.js.html +++ b/Docs/out/InputHandler.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -1298,7 +1308,7 @@ Phaser.InputHandler.prototype = { 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/Key.js.html b/Docs/out/Key.js.html index 0f9fd300..2ae08ef7 100644 --- a/Docs/out/Key.js.html +++ b/Docs/out/Key.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -417,7 +427,7 @@ Phaser.Key.prototype = { 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/Keyboard.js.html b/Docs/out/Keyboard.js.html index 04d6ae26..26e8acc9 100644 --- a/Docs/out/Keyboard.js.html +++ b/Docs/out/Keyboard.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -709,7 +719,7 @@ Phaser.Keyboard.NUM_LOCK = 144; 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/LinkedList.js.html b/Docs/out/LinkedList.js.html index 58e26d8c..2889f659 100644 --- a/Docs/out/LinkedList.js.html +++ b/Docs/out/LinkedList.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -399,7 +409,7 @@ Phaser.LinkedList.prototype = { 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/Loader.js.html b/Docs/out/Loader.js.html index 532edc25..7f8839d6 100644 --- a/Docs/out/Loader.js.html +++ b/Docs/out/Loader.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -1309,7 +1319,7 @@ Phaser.Loader.prototype = { 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/MSPointer.js.html b/Docs/out/MSPointer.js.html index af1e9695..0376b56c 100644 --- a/Docs/out/MSPointer.js.html +++ b/Docs/out/MSPointer.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -428,7 +438,7 @@ Phaser.MSPointer.prototype = { 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/Math.js.html b/Docs/out/Math.js.html index 6d5f8f71..47adc120 100644 --- a/Docs/out/Math.js.html +++ b/Docs/out/Math.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -1363,7 +1373,7 @@ Phaser.Math = { 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/Mouse.js.html b/Docs/out/Mouse.js.html index 25d216e0..6c2f4c2b 100644 --- a/Docs/out/Mouse.js.html +++ b/Docs/out/Mouse.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -504,7 +514,7 @@ Phaser.Mouse.prototype = { 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/Net.js.html b/Docs/out/Net.js.html index a8a1fc5b..beea729f 100644 --- a/Docs/out/Net.js.html +++ b/Docs/out/Net.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -414,7 +424,7 @@ Phaser.Net.prototype = { 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/Parser.js.html b/Docs/out/Parser.js.html index 296b8230..4ee8747a 100644 --- a/Docs/out/Parser.js.html +++ b/Docs/out/Parser.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -564,7 +574,7 @@ Phaser.Animation.Parser = { 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/Parser.js_.html b/Docs/out/Parser.js_.html index dc1e7091..3711692e 100644 --- a/Docs/out/Parser.js_.html +++ b/Docs/out/Parser.js_.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -328,7 +338,7 @@ Phaser.Loader.Parser = { 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/Particles.js.html b/Docs/out/Particles.js.html index fcc8ae2d..a7c00a0b 100644 --- a/Docs/out/Particles.js.html +++ b/Docs/out/Particles.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -319,7 +329,7 @@ Phaser.Particles.prototype = { 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.Frame.html b/Docs/out/Phaser.Animation.Frame.html index 6b7cd28b..45f24b81 100644 --- a/Docs/out/Phaser.Animation.Frame.html +++ b/Docs/out/Phaser.Animation.Frame.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -3768,7 +3778,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    -

    getSound(key) → {Phaser.Sound}

    +

    getSound(key) → {Phaser.Sound}

    @@ -3894,7 +3904,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    -Phaser.Sound +Phaser.Sound
    @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -2840,7 +2850,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 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.Canvas.html b/Docs/out/Phaser.Canvas.html new file mode 100644 index 00000000..094ea103 --- /dev/null +++ b/Docs/out/Phaser.Canvas.html @@ -0,0 +1,2367 @@ + + + + + + Phaser Class: Canvas + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Canvas

    +
    + +
    +

    + Canvas +

    + +
    + +
    +
    + + + + +
    +

    new Canvas()

    + + +
    +
    + + +
    +

    The Canvas class handles everything related to the <canvas> tag as a DOM Element, like styles, offset, aspect ratio

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + +

    Methods

    + +
    + +
    +

    <static> addToDOM(canvas, parent, overflowHidden) → {HTMLCanvasElement}

    + + +
    +
    + + +
    +

    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:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    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.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    Returns the source canvas.

    +
    + + + +
    +
    + Type +
    +
    + +HTMLCanvasElement + + +
    +
    + + + + + +
    + + + +
    +

    <static> create(width, height) → {HTMLCanvasElement}

    + + +
    +
    + + +
    +

    Creates the <canvas> tag

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    width + + +number + + + +

    The desired width.

    height + + +number + + + +

    The desired height.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    The newly created <canvas> tag.

    +
    + + + +
    +
    + Type +
    +
    + +HTMLCanvasElement + + +
    +
    + + + + + +
    + + + +
    +

    <static> getAspectRatio(canvas) → {number}

    + + +
    +
    + + +
    +

    Returns the aspect ratio of the given canvas.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    canvas + + +HTMLCanvasElement + + + +

    The canvas to get the aspect ratio from.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    The ratio between canvas' width and height.

    +
    + + + +
    +
    + Type +
    +
    + +number + + +
    +
    + + + + + +
    + + + +
    +

    <static> getOffset(element, point) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Get the DOM offset values of any given element

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    element + + +HTMLElement + + + + + + + + + +

    The targeted element that we want to retrieve the offset.

    point + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    The point we want to take the x/y values of the offset.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +
      +
    • A point objet with the offsetX and Y as its properties.
    • +
    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Point + + +
    +
    + + + + + +
    + + + +
    +

    <static> setBackgroundColor(canvas, color) → {HTMLCanvasElement}

    + + +
    +
    + + +
    +

    Sets the background color behind the canvas. This changes the canvas style property.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    canvas + + +HTMLCanvasElement + + + + + + + + + +

    The canvas to set the background color on.

    color + + +string + + + + + + <optional>
    + + + + + +

    The color to set. Can be in the format 'rgb(r,g,b)', or '#RRGGBB' or any valid CSS color.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    Returns the source canvas.

    +
    + + + +
    +
    + Type +
    +
    + +HTMLCanvasElement + + +
    +
    + + + + + +
    + + + +
    +

    <static> setImageRenderingBicubic(canvas) → {HTMLCanvasElement}

    + + +
    +
    + + +
    +

    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.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    canvas + + +HTMLCanvasElement + + + +

    The canvas to set image-rendering bicubic on.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    Returns the source canvas.

    +
    + + + +
    +
    + Type +
    +
    + +HTMLCanvasElement + + +
    +
    + + + + + +
    + + + +
    +

    <static> setImageRenderingCrisp(canvas) → {HTMLCanvasElement}

    + + +
    +
    + + +
    +

    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.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    canvas + + +HTMLCanvasElement + + + +

    The canvas to set image-rendering crisp on.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    Returns the source canvas.

    +
    + + + +
    +
    + Type +
    +
    + +HTMLCanvasElement + + +
    +
    + + + + + +
    + + + +
    +

    <static> setSmoothingEnabled(context, value) → {CanvasRenderingContext2D}

    + + +
    +
    + + +
    +

    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:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    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.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    Returns the source context.

    +
    + + + +
    +
    + Type +
    +
    + +CanvasRenderingContext2D + + +
    +
    + + + + + +
    + + + +
    +

    <static> setTouchAction(canvas, value) → {HTMLCanvasElement}

    + + +
    +
    + + +
    +

    Sets the touch-action property on the canvas style. Can be used to disable default browser touch actions.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    canvas + + +HTMLCanvasElement + + + + + + + + + +

    The canvas to set the touch action on.

    value + + +String + + + + + + <optional>
    + + + + + +

    The touch action to set. Defaults to 'none'.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    The source canvas.

    +
    + + + +
    +
    + Type +
    +
    + +HTMLCanvasElement + + +
    +
    + + + + + +
    + + + +
    +

    <static> setTransform(context, translateX, translateY, scaleX, scaleY, skewX, skewY) → {CanvasRenderingContext2D}

    + + +
    +
    + + +
    +

    Sets the transform of the given canvas to the matrix values provided.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    context + + +CanvasRenderingContext2D + + + +

    The context to set the transform on.

    translateX + + +number + + + +

    The value to translate horizontally by.

    translateY + + +number + + + +

    The value to translate vertically by.

    scaleX + + +number + + + +

    The value to scale horizontally by.

    scaleY + + +number + + + +

    The value to scale vertically by.

    skewX + + +number + + + +

    The value to skew horizontaly by.

    skewY + + +number + + + +

    The value to skew vertically by.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    Returns the source context.

    +
    + + + +
    +
    + Type +
    +
    + +CanvasRenderingContext2D + + +
    +
    + + + + + +
    + + + +
    +

    <static> setUserSelect(canvas, value) → {HTMLCanvasElement}

    + + +
    +
    + + +
    +

    Sets the user-select property on the canvas style. Can be used to disable default browser selection actions.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    canvas + + +HTMLCanvasElement + + + + + + + + + +

    The canvas to set the touch action on.

    value + + +String + + + + + + <optional>
    + + + + + +

    The touch action to set. Defaults to 'none'.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    The source canvas.

    +
    + + + +
    +
    + Type +
    +
    + +HTMLCanvasElement + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:42 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Circle.html b/Docs/out/Phaser.Circle.html index 90d3165f..03088d06 100644 --- a/Docs/out/Phaser.Circle.html +++ b/Docs/out/Phaser.Circle.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Device

    +
    + +
    +

    + Device +

    + +

    Phaser.Device

    + +
    + +
    +
    + + + + +
    +

    new Device()

    + + +
    +
    + + +
    +

    Detects device support capabilities. Using some elements from System.js by MrDoob and Modernizr

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + +

    Members

    + +
    + +
    +

    android

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    android + + +boolean + + + +

    Is running on android?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    arora

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    arora + + +boolean + + + +

    Is running in arora?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    audioData

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    audioData + + +boolean + + + +

    Are Audio tags available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    canvas

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    canvas + + +boolean + + + +

    Is canvas available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    chrome

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    chrome + + +boolean + + + +

    Is running in chrome?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    chromeOS

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    chromeOS + + +boolean + + + +

    Is running on chromeOS?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    css3D

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    css3D + + +boolean + + + +

    Is css3D available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    desktop

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    desktop + + +boolean + + + +

    Is running desktop?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    epiphany

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    epiphany + + +boolean + + + +

    Is running in epiphany?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    file

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    file + + +boolean + + + +

    Is file available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    fileSystem

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    fileSystem + + +boolean + + + +

    Is fileSystem available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    firefox

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    firefox + + +boolean + + + +

    Is running in firefox?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    ie

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    ie + + +boolean + + + +

    Is running in ie?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    ieVersion

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    ieVersion + + +number + + + +

    Version of ie?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    iOS

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    iOS + + +boolean + + + +

    Is running on iOS?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    iPad

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    iPad + + +boolean + + + +

    Is running on iPad?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    iPhone

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    iPhone + + +boolean + + + +

    Is running on iPhone?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    iPhone4

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    iPhone4 + + +boolean + + + +

    Is running on iPhone4?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    linux

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    linux + + +boolean + + + +

    Is running on linux?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    localStorage

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    localStorage + + +boolean + + + +

    Is localStorage available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    m4a

    + + +
    +
    + +
    +

    Can this device play m4a files?

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    m4a + + +boolean + + + +

    True if this device can play m4a files.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    macOS

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    macOS + + +boolean + + + +

    Is running on macOS?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    midori

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    midori + + +boolean + + + +

    Is running in midori?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    mobileSafari

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    mobileSafari + + +boolean + + + +

    Is running in mobileSafari?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    mp3

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    mp3 + + +boolean + + + +

    Can this device play mp3 files?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    mspointer

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    mspointer + + +boolean + + + +

    Is mspointer available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    ogg

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    ogg + + +boolean + + + +

    Can this device play ogg files?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    opera

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    opera + + +boolean + + + +

    Is running in opera?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    opus

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    opus + + +boolean + + + +

    Can this device play opus files?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    patchAndroidClearRectBug

    + + +
    +
    + +
    +

    An optional 'fix' for the horrendous Android stock browser bug https://code.google.com/p/android/issues/detail?id=39247

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    patchAndroidClearRectBug + + +boolean + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    pixelRatio

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pixelRatio + + +number + + + +

    PixelRatio of the host device?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    pointerLock

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pointerLock + + +boolean + + + +

    Is Pointer Lock available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    safari

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    safari + + +boolean + + + +

    Is running in safari?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    touch

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    touch + + +boolean + + + +

    Is touch available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    wav

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    wav + + +boolean + + + +

    Can this device play wav files?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    webAudio

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    webAudio + + +boolean + + + +

    Is the WebAudio API available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    webGL

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    webGL + + +boolean + + + +

    Is webGL available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    webm

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    webm + + +boolean + + + +

    Can this device play webm files?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    windows

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    windows + + +boolean + + + +

    Is running on windows?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    worker

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    worker + + +boolean + + + +

    Is worker available?

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + +

    Methods

    + +
    + +
    +

    canPlayAudio(type) → {boolean}

    + + +
    +
    + + +
    +

    Check whether the host environment can play audio.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +string + + + +

    One of 'mp3, 'ogg', 'm4a', 'wav', 'webm'.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    True if the given file type is supported by the browser, otherwise false.

    +
    + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    + + + + + +
    + + + +
    +

    isConsoleOpen() → {boolean}

    + + +
    +
    + + +
    +

    Check whether the console is open.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    True if the browser dev console is open.

    +
    + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:42 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Game.html b/Docs/out/Phaser.Game.html index 6728a4c5..3ae8d7cf 100644 --- a/Docs/out/Phaser.Game.html +++ b/Docs/out/Phaser.Game.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -242,7 +252,7 @@ at set intervals, and fixes their positions and velocities accorindgly.

    -

    new Emitter(game, x, y, maxParticles)

    +

    new Emitter(game, x, y, maxParticles)

    @@ -272,8 +282,12 @@ at set intervals, and fixes their positions and velocities accorindgly.

    Type + Argument + + Default + Description @@ -297,7 +311,19 @@ at set intervals, and fixes their positions and velocities accorindgly.

    + + + + + + + + + + + +

    Current game instance.

    @@ -320,10 +346,26 @@ at set intervals, and fixes their positions and velocities accorindgly.

    + + + <optional>
    + + + + + -

    Description.

    + + + + 0 + + + + +

    The x coordinate within the Emitter that the particles are emitted from.

    @@ -343,10 +385,26 @@ at set intervals, and fixes their positions and velocities accorindgly.

    + + + <optional>
    + + + + + -

    Description.

    + + + + 0 + + + + +

    The y coordinate within the Emitter that the particles are emitted from.

    @@ -366,10 +424,26 @@ at set intervals, and fixes their positions and velocities accorindgly.

    + + + <optional>
    + + + + + -

    Description.

    + + + + 50 + + + + +

    The total number of particles in this emitter..

    @@ -539,7 +613,7 @@ at set intervals, and fixes their positions and velocities accorindgly.

    Source:
    @@ -760,7 +834,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -862,7 +936,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -968,7 +1042,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1076,7 +1150,7 @@ Emitter.emitX and Emitter.emitY control the emission location relative to the x/
    Source:
    @@ -1184,7 +1258,7 @@ Emitter.emitX and Emitter.emitY control the emission location relative to the x/
    Source:
    @@ -1293,7 +1367,7 @@ Emitter.emitX and Emitter.emitY control the emission location relative to the x/
    Source:
    @@ -1402,7 +1476,7 @@ Emitter.emitX and Emitter.emitY control the emission location relative to the x/
    Source:
    @@ -1618,7 +1692,7 @@ Emitter.emitX and Emitter.emitY control the emission location relative to the x/
    Source:
    @@ -1723,7 +1797,7 @@ Emitter.emitX and Emitter.emitY control the emission location relative to the x/
    Source:
    @@ -1825,7 +1899,7 @@ Emitter.emitX and Emitter.emitY control the emission location relative to the x/
    Source:
    @@ -2042,7 +2116,7 @@ Set lifespan to 'zero' for particles to live forever.

    Source:
    @@ -2119,7 +2193,7 @@ Set lifespan to 'zero' for particles to live forever.

    - +

    The total number of particles in this emitter..

    @@ -2148,7 +2222,7 @@ Set lifespan to 'zero' for particles to live forever.

    Source:
    @@ -2258,7 +2332,7 @@ The default value is 1.

    Source:
    @@ -2365,7 +2439,7 @@ The default value is (100,100).

    Source:
    @@ -2474,7 +2548,7 @@ The default value is (100,100).

    Source:
    @@ -2584,7 +2658,7 @@ The default value is 1.

    Source:
    @@ -2691,7 +2765,7 @@ The default value is (-100,-100).

    Source:
    @@ -2797,7 +2871,7 @@ The default value is (-100,-100).

    Source:
    @@ -2899,7 +2973,7 @@ The default value is (-100,-100).

    Source:
    @@ -3009,7 +3083,7 @@ It is totally safe to directly toggle this.

    Source:
    @@ -3118,7 +3192,7 @@ It is totally safe to directly toggle this.

    Source:
    @@ -3224,7 +3298,7 @@ It is totally safe to directly toggle this.

    Source:
    @@ -3326,7 +3400,7 @@ It is totally safe to directly toggle this.

    Source:
    @@ -3540,7 +3614,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3642,7 +3716,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3748,7 +3822,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3853,7 +3927,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3955,7 +4029,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -4060,7 +4134,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -4162,7 +4236,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -4267,7 +4341,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -4901,7 +4975,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -6373,7 +6447,7 @@ Group.divideAll('x', 2) will half the child.x value.

    Source:
    @@ -7712,7 +7786,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -7922,7 +7996,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -8686,7 +8760,7 @@ In practice, this is most often called by <code>Object.reset()</code>
    Source:
    @@ -9367,7 +9441,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9508,7 +9582,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9649,7 +9723,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9790,7 +9864,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9977,7 +10051,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -10408,7 +10482,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -4642,7 +4652,7 @@ Default size of 44px (Apple's recommended "finger tip" size).

    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.QuadTree.html b/Docs/out/Phaser.QuadTree.html index f9ba0586..12aa091c 100644 --- a/Docs/out/Phaser.QuadTree.html +++ b/Docs/out/Phaser.QuadTree.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -7140,7 +7150,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 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.RequestAnimationFrame.html b/Docs/out/Phaser.RequestAnimationFrame.html new file mode 100644 index 00000000..50e66a68 --- /dev/null +++ b/Docs/out/Phaser.RequestAnimationFrame.html @@ -0,0 +1,1168 @@ + + + + + + Phaser Class: RequestAnimationFrame + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: RequestAnimationFrame

    +
    + +
    +

    + RequestAnimationFrame +

    + +

    Phaser.RequestAnimationFrame

    + +
    + +
    +
    + + + + +
    +

    new RequestAnimationFrame(game)

    + + +
    +
    + + +
    +

    Abstracts away the use of RAF or setTimeOut for the core game update loop.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +Phaser.Game + + + +

    A reference to the currently running game.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + +

    Members

    + +
    + +
    +

    game

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +Phaser.Game + + + +

    The currently running game.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    isRunning

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    isRunning + + +boolean + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + +

    Methods

    + +
    + +
    +

    isRAF() → {boolean}

    + + +
    +
    + + +
    +

    Is the browser using requestAnimationFrame?

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    + + + + + +
    + + + +
    +

    isSetTimeOut() → {boolean}

    + + +
    +
    + + +
    +

    Is the browser using setTimeout?

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    + + + + + +
    + + + +
    +

    start()

    + + +
    +
    + + +
    +

    Starts the requestAnimatioFrame running or setTimeout if unavailable in browser

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    stop()

    + + +
    +
    + + +
    +

    Stops the requestAnimationFrame from running.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    updateRAF(time)

    + + +
    +
    + + +
    +

    The update method for the requestAnimationFrame

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    time + + +number + + + +

    A timestamp, either from RAF or setTimeOut

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    updateSetTimeout()

    + + +
    +
    + + +
    +

    The update method for the setTimeout.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:45 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Signal.html b/Docs/out/Phaser.Signal.html index 96bbe916..a3238ac5 100644 --- a/Docs/out/Phaser.Signal.html +++ b/Docs/out/Phaser.Signal.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -2096,7 +2106,7 @@ already dispatched before.

    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.Sound.html b/Docs/out/Phaser.Sound.html new file mode 100644 index 00000000..21d18a7a --- /dev/null +++ b/Docs/out/Phaser.Sound.html @@ -0,0 +1,5377 @@ + + + + + + Phaser Class: Sound + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Sound

    +
    + +
    +

    + Sound +

    + +

    The Sound class

    + +
    + +
    +
    + + + + +
    +

    new Sound(game, key, volume, loop)

    + + +
    +
    + + +
    +

    The Sound class constructor.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    game + + +Phaser.Game + + + + + + + + + + + +

    Reference to the current game instance.

    key + + +string + + + + + + + + + + + +

    Asset key for the sound.

    volume + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    Default value for the volume, between 0 and 1.

    loop + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Whether or not the sound will loop.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + +

    Members

    + +
    + +
    +

    context

    + + +
    +
    + +
    +

    Reference to AudioContext instance.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    context + + +AudioContext + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • null
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    currentMarker

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    currentMarker + + +string + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    currentTime

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    currentTime + + +number + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    duration

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    duration + + +number + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    game

    + + +
    +
    + +
    +

    A reference to the currently running Game.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +Phaser.Game + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    <readonly> isDecoded

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    isDecoded + + +boolean + + + +

    Returns true if the sound file has decoded.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    <readonly> isDecoding

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    isDecoding + + +boolean + + + +

    Returns true if the sound file is still decoding.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    isPlaying

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    isPlaying + + +boolean + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    key

    + + +
    +
    + +
    +

    Asset key for the sound.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    key + + +string + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    loop

    + + +
    +
    + +
    +

    Whether or not the sound will loop.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    loop + + +boolean + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    markers

    + + +
    +
    + +
    +

    The sound markers, empty by default.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    markers + + +object + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    mute

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    mute + + +boolean + + + +

    Gets or sets the muted state of this sound.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    name

    + + +
    +
    + +
    +

    Name of the sound.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • key
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onDecoded

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onDecoded + + +Phaser.Signal + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onLoop

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onLoop + + +Phaser.Signal + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onMarkerComplete

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onMarkerComplete + + +Phaser.Signal + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onMute

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onMute + + +Phaser.Signal + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onPause

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onPause + + +Phaser.Signal + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onPlay

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onPlay + + +Phaser.Signal + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onResume

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onResume + + +Phaser.Signal + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onStop

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onStop + + +Phaser.Signal + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    override

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    override + + +boolean + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    paused

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    paused + + +boolean + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    pendingPlayback

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pendingPlayback + + +boolean + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    startTime

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    startTime + + +number + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    stopTime

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    autoplay + + +number + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    totalDuration

    + + +
    +
    + +
    +

    The total duration of the sound, in milliseconds

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    totalDuration + + +number + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    usingAudioTag

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    usingAudioTag + + +Description + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    usingWebAudio

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    usingWebAudio + + +boolean + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    <readonly> volume

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    volume + + +number + + + +

    Gets or sets the volume of this sound, a value between 0 and 1.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + +

    Methods

    + +
    + +
    +

    addMarker(name, start, stop, volume, loop)

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + +

    Description.

    start + + +Description + + + +

    Description.

    stop + + +Description + + + +

    Description.

    volume + + +Description + + + +

    Description.

    loop + + +Description + + + +

    Description. + addMarker: function (name, start, stop, volume, loop) {

    +
        volume = volume || 1;
    +    if (typeof loop == 'undefined') { loop = false; }
    +
    +    this.markers[name] = {
    +        name: name,
    +        start: start,
    +        stop: stop,
    +        volume: volume,
    +        duration: stop - start,
    +        loop: loop
    +    };
    +
    +},
    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    addMarker(name, start, duration, volume, loop)

    + + +
    +
    + + +
    +

    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:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    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).

    loop + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Sets if the sound will loop or not.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    pause()

    + + +
    +
    + + +
    +

    Pauses the sound

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    play(marker, position, volume, loop, forceRestart) → {Sound}

    + + +
    +
    + + +
    +

    Play this sound, or a marked section of it.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    marker + + +string + + + + + + <optional>
    + + + + + +
    + + '' + +

    If you want to play a marker then give the key here, otherwise leave blank to play the full sound.

    position + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    The starting position to play the sound from - this is ignored if you provide a marker.

    volume + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    Volume of the sound you want to play.

    loop + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Loop when it finished playing?

    forceRestart + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If the sound is already playing you can set forceRestart to restart it from the beginning.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    The playing sound object.

    +
    + + + +
    +
    + Type +
    +
    + +Sound + + +
    +
    + + + + + +
    + + + +
    +

    removeMarker(name)

    + + +
    +
    + + +
    +

    Removes a marker from the sound.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + +

    The key of the marker to remove.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    restart(marker, position, volume, loop)

    + + +
    +
    + + +
    +

    Restart the sound, or a marked section of it.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    marker + + +string + + + + + + <optional>
    + + + + + +
    + + '' + +

    If you want to play a marker then give the key here, otherwise leave blank to play the full sound.

    position + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    The starting position to play the sound from - this is ignored if you provide a marker.

    volume + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    Volume of the sound you want to play.

    loop + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Loop when it finished playing?

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    resume()

    + + +
    +
    + + +
    +

    Resumes the sound

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    <protected> soundHasUnlocked(key)

    + + +
    +
    + + +
    +

    Called automatically when this sound is unlocked.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    key + + +string + + + +

    Description.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    stop()

    + + +
    +
    + + +
    +

    Stop playing this sound.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    <protected> update()

    + + +
    +
    + + +
    +

    Called automatically by Phaser.SoundManager.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:45 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.SoundManager.html b/Docs/out/Phaser.SoundManager.html new file mode 100644 index 00000000..ac46cabc --- /dev/null +++ b/Docs/out/Phaser.SoundManager.html @@ -0,0 +1,2285 @@ + + + + + + Phaser Class: SoundManager + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: SoundManager

    +
    + +
    +

    + SoundManager +

    + +

    Phaser Sound Manager.

    + +
    + +
    +
    + + + + +
    +

    new SoundManager(game)

    + + +
    +
    + + +
    +

    Sound Manager constructor.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +Phaser.Game + + + +

    reference to the current game instance.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + +

    Members

    + +
    + +
    +

    channels

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    channels + + +number + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 32
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    context

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    context + + +Description + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • null
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    game

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +Phaser.Game + + + +

    Local reference to game.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    mute

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    mute + + +boolean + + + +

    Gets or sets the muted state of the SoundManager. This effects all sounds in the game.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    noAudio

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    noAudio + + +boolean + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onSoundDecode

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onSoundDecode + + +Phaser.Signal + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    touchLocked

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    touchLocked + + +boolean + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    usingAudioTag

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    usingAudioTag + + +boolean + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    usingWebAudio

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    usingWebAudio + + +boolean + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • true
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    volume

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    volume + + +number + + + +

    Gets or sets the global volume of the SoundManager, a value between 0 and 1.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + +

    Methods

    + +
    + +
    +

    add(key, volume, loop)

    + + +
    +
    + + +
    +

    Adds a new Sound into the SoundManager.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    key + + +string + + + + + + + + + + + +

    Asset key for the sound.

    volume + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    Default value for the volume.

    loop + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Whether or not the sound will loop.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    <protected> boot()

    + + +
    +
    + + +
    +

    Initialises the sound manager.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    decode(key, sound)

    + + +
    +
    + + +
    +

    Decode a sound by its assets key.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    key + + +string + + + + + + + + + +

    Assets key of the sound to be decoded.

    sound + + +Phaser.Sound + + + + + + <optional>
    + + + + + +

    Its buffer will be set to decoded data.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    pauseAll()

    + + +
    +
    + + +
    +

    Pauses all the sounds in the game.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    resumeAll()

    + + +
    +
    + + +
    +

    resumes every sound in the game.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    stopAll()

    + + +
    +
    + + +
    +

    Stops all the sounds in the game.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    unlock()

    + + +
    +
    + + +
    +

    Enables the audio, usually after the first touch.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    update()

    + + +
    +
    + + +
    +

    Updates every sound in the game.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:45 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Stage.html b/Docs/out/Phaser.Stage.html index 2d9867e0..26c7bc91 100644 --- a/Docs/out/Phaser.Stage.html +++ b/Docs/out/Phaser.Stage.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -979,7 +989,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree -Phaser.StageScaleMode +Phaser.StageScaleMode @@ -1285,7 +1295,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 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.StageScaleMode.html b/Docs/out/Phaser.StageScaleMode.html new file mode 100644 index 00000000..e8b4ac7e --- /dev/null +++ b/Docs/out/Phaser.StageScaleMode.html @@ -0,0 +1,3679 @@ + + + + + + Phaser Class: StageScaleMode + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: StageScaleMode

    +
    + +
    +

    + StageScaleMode +

    + +

    Phaser.StageScaleMode

    + +
    + +
    +
    + + + + +
    +

    new StageScaleMode(game, width, height)

    + + +
    +
    + + +
    +

    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.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +Phaser.Game + + + +

    A reference to the currently running game.

    width + + +number + + + +

    Description.

    height + + +number + + + +

    Description.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + +

    Members

    + +
    + +
    +

    <static, constant> EXACT_FIT :number

    + + +
    +
    + + + +
    Type:
    +
      +
    • + +number + + +
    • +
    + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    <static, constant> NO_SCALE :number

    + + +
    +
    + + + +
    Type:
    +
      +
    • + +number + + +
    • +
    + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    <static, constant> SHOW_ALL :number

    + + +
    +
    + + + +
    Type:
    +
      +
    • + +number + + +
    • +
    + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    aspectRatio

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    aspectRatio + + +number + + + +

    Aspect ratio.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    enterLandscape

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    enterLandscape + + +Description + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    enterPortrait

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    enterPortrait + + +Description + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    forceLandscape

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    forceLandscape + + +boolean + + + +

    If the game should be forced to use Landscape mode, this is set to true by Game.Stage

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    forcePortrait

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    forcePortrait + + +boolean + + + +

    If the game should be forced to use Portrait mode, this is set to true by Game.Stage

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    game

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +Phaser.Game + + + +

    A reference to the currently running game.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    height

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    height + + +number + + + +

    Height of the stage after calculation.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    incorrectOrientation

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    incorrectOrientation + + +boolean + + + +

    If the game should be forced to use a specific orientation and the device currently isn't in that orientation this is set to true.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    <readonly> isFullScreen

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    isFullScreen + + +boolean + + + +

    Returns true if the browser is in full screen mode, otherwise false.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    <readonly> isLandscape

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    isLandscape + + +boolean + + + +

    Returns true if the browser dimensions match a landscape display.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    <readonly> isPortrait

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    isPortrait + + +boolean + + + +

    Returns true if the browser dimensions match a portrait display.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    maxHeight

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    maxHeight + + +number + + + +

    Maximum height the canvas should be scaled to (in pixels). +If null it will scale to whatever height the browser can handle.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • null
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    maxIterations

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    maxIterations + + +number + + + +

    The maximum number of times it will try to resize the canvas to fill the browser.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 5
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    maxWidth

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    maxWidth + + +number + + + +

    Maximum width the canvas should be scaled to (in pixels). +If null it will scale to whatever width the browser can handle.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • null
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    minHeight

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    minHeight + + +number + + + +

    Minimum height the canvas should be scaled to (in pixels).

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • null
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    minWidth

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    minWidth + + +number + + + +

    Minimum width the canvas should be scaled to (in pixels).

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • null
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    pageAlignHorizontally

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pageAlignHorizontally + + +boolean + + + +

    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>

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    pageAlignVeritcally

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pageAlignVeritcally + + +boolean + + + +

    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>

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • false
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    scaleFactor

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    scaleFactor + + +Description + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    width

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    width + + +number + + + +

    Width of the stage after calculation.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 0
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + +

    Methods

    + +
    + +
    +

    checkOrientation(event)

    + + +
    +
    + + +
    +

    Handle window.orientationchange events

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    event + + +Event + + + +

    The orientationchange event data.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    checkOrientationState()

    + + +
    +
    + + +
    +

    Checks if the browser is in the correct orientation for your game (if forceLandscape or forcePortrait have been set)

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    checkResize(event)

    + + +
    +
    + + +
    +

    Handle window.resize events

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    event + + +Event + + + +

    The resize event data.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    refresh()

    + + +
    +
    + + +
    +

    Re-calculate scale mode and update screen size.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    setExactFit()

    + + +
    +
    + + +
    +

    Sets the width and height values of the canvas, no larger than the maxWidth/Height.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    setMaximum()

    + + +
    +
    + + +
    +

    Sets this.width equal to window.innerWidth and this.height equal to window.innerHeight

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    setScreenSize(force)

    + + +
    +
    + + +
    +

    Set screen size automatically based on the scaleMode.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    force + + +Description + + + +

    If force is true it will try to resize the game regardless of the document dimensions.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    setShowAll()

    + + +
    +
    + + +
    +

    Calculates the multiplier needed to scale the game proportionally.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    setSize()

    + + +
    +
    + + +
    +

    Sets the canvas style width and height values based on minWidth/Height and maxWidth/Height.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    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.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    stopFullScreen()

    + + +
    +
    + + +
    +

    Stops full screen mode if the browser is in it.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:45 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.State.html b/Docs/out/Phaser.State.html index 20a5394d..87b6e742 100644 --- a/Docs/out/Phaser.State.html +++ b/Docs/out/Phaser.State.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -361,7 +371,7 @@ Phaser.Plugin.prototype = { 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/PluginManager.js.html b/Docs/out/PluginManager.js.html index d3b57f85..cf42d21e 100644 --- a/Docs/out/PluginManager.js.html +++ b/Docs/out/PluginManager.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -478,7 +488,7 @@ Phaser.PluginManager.prototype = { 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/Point.js.html b/Docs/out/Point.js.html index 0e77fe22..d71e36b4 100644 --- a/Docs/out/Point.js.html +++ b/Docs/out/Point.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -937,7 +947,7 @@ Object.defineProperty(Phaser.Pointer.prototype, "worldY", { 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/QuadTree.js.html b/Docs/out/QuadTree.js.html index 748720a9..a3dec105 100644 --- a/Docs/out/QuadTree.js.html +++ b/Docs/out/QuadTree.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -511,7 +521,7 @@ Phaser.QuadTree.prototype = { 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/RandomDataGenerator.js.html b/Docs/out/RandomDataGenerator.js.html index e50a7d07..663767b4 100644 --- a/Docs/out/RandomDataGenerator.js.html +++ b/Docs/out/RandomDataGenerator.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -493,7 +503,7 @@ Phaser.RandomDataGenerator.prototype = { 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/Rectangle.js.html b/Docs/out/Rectangle.js.html index b7a2e26a..dde8c1a5 100644 --- a/Docs/out/Rectangle.js.html +++ b/Docs/out/Rectangle.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -910,7 +920,7 @@ Phaser.Rectangle.union = function (a, b, out) { 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/RequestAnimationFrame.js.html b/Docs/out/RequestAnimationFrame.js.html new file mode 100644 index 00000000..d9dd800e --- /dev/null +++ b/Docs/out/RequestAnimationFrame.js.html @@ -0,0 +1,451 @@ + + + + + + Phaser Source: system/RequestAnimationFrame.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: system/RequestAnimationFrame.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2013 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* Abstracts away the use of RAF or setTimeOut for the core game update loop.
    +*
    +* @class Phaser.RequestAnimationFrame 
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +*/
    +Phaser.RequestAnimationFrame = function(game) {
    +	
    +     /**
    +     * @property {Phaser.Game} game - The currently running game.
    +     */
    +	this.game = game;
    +
    +     /**
    +     * @property {boolean} _isSetTimeOut  - Description.
    +     * @private
    +     */
    +	this._isSetTimeOut = false;
    +     
    +     /**
    +     * @property {boolean} isRunning - Description.
    +     * @default
    +     */
    +	this.isRunning = false;
    +
    +	var vendors = [
    +		'ms', 
    +		'moz', 
    +		'webkit', 
    +		'o'
    +	];
    +
    +	for (var x = 0; x < vendors.length && !window.requestAnimationFrame; x++)
    +	{
    +		window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
    +		window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'];
    +	}
    +
    +	/**
    +	* The function called by the update
    +	* @property _onLoop
    +	* @private
    +	*/
    +	this._onLoop = null;
    +
    +};
    +
    +Phaser.RequestAnimationFrame.prototype = {
    +
    +
    +	/**
    +	* Starts the requestAnimatioFrame running or setTimeout if unavailable in browser
    +	* @method Phaser.RequestAnimationFrame#start
    +	*/
    +	start: function () {
    +
    +		this.isRunning = true;
    +
    +		var _this = this;
    +
    +		if (!window.requestAnimationFrame)
    +		{
    +			this._isSetTimeOut = true;
    +
    +            this._onLoop = function () {
    +                return _this.updateSetTimeout();
    +            };
    +
    +			this._timeOutID = window.setTimeout(this._onLoop, 0);
    +		}
    +		else
    +		{
    +			this._isSetTimeOut = false;
    +
    +            this._onLoop = function (time) {
    +                return _this.updateRAF(time);
    +            };
    +
    +			window.requestAnimationFrame(this._onLoop);
    +		}
    +
    +	},
    +
    +	/**
    +	* The update method for the requestAnimationFrame
    +	* @method Phaser.RequestAnimationFrame#updateRAF	
    +	* @param {number} time - A timestamp, either from RAF or setTimeOut
    +	*/
    +	updateRAF: function (time) {
    +
    +		this.game.update(time);
    +
    +		window.requestAnimationFrame(this._onLoop);
    +
    +	},
    +
    +	/**
    +	* The update method for the setTimeout.
    +	* @method Phaser.RequestAnimationFrame#updateSetTimeout
    +	*/
    +	updateSetTimeout: function () {
    +
    +		this.game.update(Date.now());
    +
    +		this._timeOutID = window.setTimeout(this._onLoop, this.game.time.timeToCall);
    +
    +	},
    +
    +	/**
    +	* Stops the requestAnimationFrame from running.
    +	* @method Phaser.RequestAnimationFrame#stop
    +	*/
    +	stop: function () {
    +
    +		if (this._isSetTimeOut)
    +		{
    +			clearTimeout(this._timeOutID);
    +		}
    +		else
    +		{
    +			window.cancelAnimationFrame;
    +		}
    +
    +		this.isRunning = false;
    +
    +	},
    +
    +	/**
    +	* Is the browser using setTimeout?
    +	* @method Phaser.RequestAnimationFrame#isSetTimeOut
    +	* @return {boolean}
    +	*/
    +	isSetTimeOut: function () {
    +		return this._isSetTimeOut;
    +	},
    +
    +	/**
    +	* Is the browser using requestAnimationFrame?
    +	* @method Phaser.RequestAnimationFrame#isRAF
    +	* @return {boolean}
    +	*/
    +	isRAF: function () {
    +		return (this._isSetTimeOut === false);
    +	}
    +
    +};
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Signal.js.html b/Docs/out/Signal.js.html index dc2302ae..5b2134e9 100644 --- a/Docs/out/Signal.js.html +++ b/Docs/out/Signal.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -543,7 +553,7 @@ Phaser.Signal.prototype = { 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/SignalBinding.html b/Docs/out/SignalBinding.html index 769ff55f..f8ab245a 100644 --- a/Docs/out/SignalBinding.html +++ b/Docs/out/SignalBinding.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -408,7 +418,7 @@ Phaser.SignalBinding.prototype = { 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/Sound.js.html b/Docs/out/Sound.js.html new file mode 100644 index 00000000..36fb04a3 --- /dev/null +++ b/Docs/out/Sound.js.html @@ -0,0 +1,1105 @@ + + + + + + Phaser Source: sound/Sound.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: sound/Sound.js

    + +
    +
    +
    /**
    +* @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 Sound class constructor.
    +*
    +* @class Phaser.Sound
    +* @classdesc The Sound class
    +* @constructor
    +* @param {Phaser.Game} game - Reference to the current game instance.
    +* @param {string} key - Asset key for the sound.
    +* @param {number} [volume=1] - Default value for the volume, between 0 and 1.
    +* @param {boolean} [loop=false] - Whether or not the sound will loop.
    +*/
    +Phaser.Sound = function (game, key, volume, loop) {
    +	
    +	volume = volume || 1;
    +	if (typeof loop == 'undefined') { loop = false; }
    +
    +    /**
    +    * A reference to the currently running Game.
    +    * @property {Phaser.Game} game
    +    */
    +    this.game = game;
    +
    +    /**
    +    * Name of the sound.
    +    * @property {string} name
    +    * @default
    +    */
    +    this.name = key;
    +
    +    /**
    +    * Asset key for the sound.
    +    * @property {string} key
    +    */
    +    this.key = key;
    +
    +    /**
    +    * Whether or not the sound will loop.
    +    * @property {boolean} loop
    +    */
    +    this.loop = loop;
    +
    +    /**
    +    * The global audio volume. A value between 0 (silence) and 1 (full volume).
    +    * @property {number} _volume
    +    * @private
    +    */
    +    this._volume = volume;
    +
    +    /**
    +    * The sound markers, empty by default.
    +    * @property {object} markers
    +    */
    +    this.markers = {};
    +
    +    
    +    /**
    +    * Reference to AudioContext instance.
    +    * @property {AudioContext} context
    +    * @default
    +    */
    +    this.context = null;
    +
    +    /**
    +    * Decoded data buffer / Audio tag.
    +    * @property {Description} _buffer
    +    * @private
    +    */
    +    this._buffer = null;
    +
    +    /**
    +    * Boolean indicating whether the game is on "mute". 
    +    * @property {boolean} _muted
    +    * @private
    +    * @default
    +    */
    +    this._muted = false;
    +
    +    /**
    +    * Boolean indicating whether the sound should start automatically.
    +    * @property {boolean} autoplay
    +    * @private
    +    */
    +    this.autoplay = false;
    +
    +    /**
    +    * The total duration of the sound, in milliseconds
    +    * @property {number} totalDuration
    +    * @default
    +    */
    +    this.totalDuration = 0;
    +   
    +    /**
    +    * Description.
    +    * @property {number} startTime
    +    * @default
    +    */
    +    this.startTime = 0;
    +    
    +    /**
    +    * Description.
    +    * @property {number} currentTime
    +    * @default
    +    */
    +    this.currentTime = 0;
    +    
    +    /**
    +    * Description.
    +    * @property {number} duration
    +    * @default
    +    */
    +    this.duration = 0;
    +    
    +    /**
    +    * Description.
    +    * @property {number} autoplay
    +    * @default
    +    */
    +    this.stopTime = 0;
    +    
    +    /**
    +    * Description.
    +    * @property {boolean} paused
    +    * @default
    +    */
    +    this.paused = false;
    +    
    +    /**
    +    * Description.
    +    * @property {boolean} isPlaying
    +    * @default
    +    */
    +    this.isPlaying = false;
    +    
    +    /**
    +    * Description.
    +    * @property {string} currentMarker
    +    * @default
    +    */
    +    this.currentMarker = '';
    +    
    +    /**
    +    * Description.
    +    * @property {boolean} pendingPlayback
    +    * @default
    +    */
    +    this.pendingPlayback = false;
    +    
    +    /**
    +    * Description.
    +    * @property {boolean} override
    +    * @default
    +    */
    +    this.override = false;
    +    
    +    /**
    +    * Description.
    +    * @property {boolean} usingWebAudio
    +    */
    +    this.usingWebAudio = this.game.sound.usingWebAudio;
    +    
    +    /**
    +    * Description.
    +    * @property {Description} usingAudioTag
    +    */
    +    this.usingAudioTag = this.game.sound.usingAudioTag;
    +
    +    if (this.usingWebAudio)
    +    {
    +        this.context = this.game.sound.context;
    +        this.masterGainNode = this.game.sound.masterGain;
    +
    +        if (typeof this.context.createGain === 'undefined')
    +        {
    +            this.gainNode = this.context.createGainNode();
    +        }
    +        else
    +        {
    +            this.gainNode = this.context.createGain();
    +        }
    +
    +        this.gainNode.gain.value = volume * this.game.sound.volume;
    +        this.gainNode.connect(this.masterGainNode);
    +    }
    +    else
    +    {
    +        if (this.game.cache.getSound(key) && this.game.cache.isSoundReady(key))
    +        {
    +            this._sound = this.game.cache.getSoundData(key);
    +            this.totalDuration = 0;
    +
    +            if (this._sound.duration)
    +            {
    +                this.totalDuration = this._sound.duration;
    +            }
    +        }
    +        else
    +        {
    +            this.game.cache.onSoundUnlock.add(this.soundHasUnlocked, this);
    +        }
    +    }
    +
    +    /**
    +    * Description.
    +    * @property {Phaser.Signal} onDecoded
    +    */
    +    this.onDecoded = new Phaser.Signal;
    +    
    +    /**
    +    * Description.
    +    * @property {Phaser.Signal} onPlay
    +    */
    +    this.onPlay = new Phaser.Signal;
    +    
    +    /**
    +    * Description.
    +    * @property {Phaser.Signal} onPause
    +    */
    +    this.onPause = new Phaser.Signal;
    +    
    +    /**
    +    * Description.
    +    * @property {Phaser.Signal} onResume
    +    */
    +    this.onResume = new Phaser.Signal;
    +    
    +    /**
    +    * Description.
    +    * @property {Phaser.Signal} onLoop
    +    */
    +    this.onLoop = new Phaser.Signal;
    +    
    +    /**
    +    * Description.
    +    * @property {Phaser.Signal} onStop
    +    */
    +    this.onStop = new Phaser.Signal;
    +    
    +    /**
    +    * Description.
    +    * @property {Phaser.Signal} onMute
    +    */
    +    this.onMute = new Phaser.Signal;
    +    
    +    /**
    +    * Description.
    +    * @property {Phaser.Signal} onMarkerComplete
    +    */
    +    this.onMarkerComplete = new Phaser.Signal;
    +
    +};
    +
    +Phaser.Sound.prototype = {
    +
    +	/**
    +    * Called automatically when this sound is unlocked.
    +	* @method Phaser.Sound#soundHasUnlocked
    +	* @param {string} key - Description.
    +    * @protected
    +	*/
    +    soundHasUnlocked: function (key) {
    +
    +        if (key == this.key)
    +        {
    +            this._sound = this.game.cache.getSoundData(this.key);
    +            this.totalDuration = this._sound.duration;
    +            // console.log('sound has unlocked' + this._sound);
    +	    }
    +
    +	},
    +
    +	/**
    +	 * Description.
    +	 * @method Phaser.Sound#addMarker
    +	 * @param {string} name - Description.
    +	 * @param {Description} start - Description.
    +	 * @param {Description} stop - Description.
    +	 * @param {Description} volume - Description.
    +	 * @param {Description} loop - Description.
    +    addMarker: function (name, start, stop, volume, loop) {
    +
    +    	volume = volume || 1;
    +    	if (typeof loop == 'undefined') { loop = false; }
    +
    +        this.markers[name] = {
    +            name: name,
    +            start: start,
    +            stop: stop,
    +            volume: volume,
    +            duration: stop - start,
    +            loop: loop
    +        };
    +
    +    },
    +    */
    +
    +    /**
    +    * 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.
    +    *
    +    * @method Phaser.Sound#addMarker
    +    * @param {string} name - A unique name for this marker, i.e. 'explosion', 'gunshot', etc.
    +    * @param {number} start - The start point of this marker in the audio file, given in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.
    +    * @param {number} duration - The duration of the marker in seconds. 2.5 = 2500ms, 0.5 = 500ms, etc.
    +    * @param {number} [volume=1] - The volume the sound will play back at, between 0 (silent) and 1 (full volume).
    +    * @param {boolean} [loop=false] - Sets if the sound will loop or not.
    +    */
    +    addMarker: function (name, start, duration, volume, loop) {
    +
    +        volume = volume || 1;
    +        if (typeof loop == 'undefined') { loop = false; }
    +
    +        this.markers[name] = {
    +            name: name,
    +            start: start,
    +            stop: start + duration,
    +            volume: volume,
    +            duration: duration,
    +            durationMS: duration * 1000,
    +            loop: loop
    +        };
    +
    +    },
    +
    +	/**
    +	* Removes a marker from the sound.
    +	* @method Phaser.Sound#removeMarker
    +	* @param {string} name - The key of the marker to remove.
    +	*/
    +    removeMarker: function (name) {
    +
    +        delete this.markers[name];
    +
    +    },
    +
    +	/**
    +	* Called automatically by Phaser.SoundManager.
    +	* @method Phaser.Sound#update
    +    * @protected
    +	*/
    +    update: function () {
    +
    +        if (this.pendingPlayback && this.game.cache.isSoundReady(this.key))
    +        {
    +            this.pendingPlayback = false;
    +            this.play(this._tempMarker, this._tempPosition, this._tempVolume, this._tempLoop);
    +        }
    +
    +        if (this.isPlaying)
    +        {
    +            this.currentTime = this.game.time.now - this.startTime;
    +
    +            if (this.currentTime >= this.durationMS)
    +            {
    +                //console.log(this.currentMarker, 'has hit duration');
    +                if (this.usingWebAudio)
    +                {
    +                    if (this.loop)
    +                    {
    +                        //console.log('loop1');
    +                        //  won't work with markers, needs to reset the position
    +                        this.onLoop.dispatch(this);
    +
    +                        if (this.currentMarker == '')
    +                        {
    +                            //console.log('loop2');
    +                            this.currentTime = 0;
    +                            this.startTime = this.game.time.now;
    +                        }
    +                        else
    +                        {
    +                            //console.log('loop3');
    +                            this.play(this.currentMarker, 0, this.volume, true, true);
    +                        }
    +                    }
    +                    else
    +                    {
    +                        //console.log('stopping, no loop for marker');
    +                        this.stop();
    +                    }
    +                }
    +                else
    +                {
    +                    if (this.loop)
    +                    {
    +                        this.onLoop.dispatch(this);
    +                        this.play(this.currentMarker, 0, this.volume, true, true);
    +                    }
    +                    else
    +                    {
    +                        this.stop();
    +                    }
    +                }
    +            }
    +        }
    +    },
    +
    +	/**
    +    * Play this sound, or a marked section of it.
    +    * @method Phaser.Sound#play
    +    * @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?
    +    * @param {boolean} [forceRestart=true] - If the sound is already playing you can set forceRestart to restart it from the beginning.
    +    * @return {Sound} The playing sound object.
    +    */
    +    play: function (marker, position, volume, loop, forceRestart) {
    +
    +    	marker = marker || '';
    +    	position = position || 0;
    +    	volume = volume || 1;
    +    	if (typeof loop == 'undefined') { loop = false; }
    +    	if (typeof forceRestart == 'undefined') { forceRestart = true; }
    +
    +        // console.log(this.name + ' play ' + marker + ' position ' + position + ' volume ' + volume + ' loop ' + loop, 'force', forceRestart);
    +
    +        if (this.isPlaying == true && forceRestart == false && this.override == false)
    +        {
    +            //  Use Restart instead
    +            return;
    +        }
    +
    +        if (this.isPlaying && this.override)
    +        {
    +            // console.log('asked to play ' + marker + ' but already playing ' + this.currentMarker);
    +        
    +            if (this.usingWebAudio)
    +            {
    +                if (typeof this._sound.stop === 'undefined')
    +                {
    +                    this._sound.noteOff(0);
    +                }
    +                else
    +                {
    +                    this._sound.stop(0);
    +                }
    +            }
    +            else if (this.usingAudioTag)
    +            {
    +                this._sound.pause();
    +                this._sound.currentTime = 0;
    +            }
    +        }
    +
    +        this.currentMarker = marker;
    +
    +        if (marker !== '')
    +        {
    +            if (this.markers[marker])
    +            {
    +                this.position = this.markers[marker].start;
    +                this.volume = this.markers[marker].volume;
    +                this.loop = this.markers[marker].loop;
    +                this.duration = this.markers[marker].duration;
    +                this.durationMS = this.markers[marker].durationMS;
    +
    +                // console.log('Marker Loaded: ', marker, 'start:', this.position, 'end: ', this.duration, 'loop', this.loop);
    +
    +                this._tempMarker = marker;
    +                this._tempPosition = this.position;
    +                this._tempVolume = this.volume;
    +                this._tempLoop = this.loop;
    +            }
    +            else
    +            {
    +                console.warn("Phaser.Sound.play: audio marker " + marker + " doesn't exist");
    +                return;
    +            }
    +        }
    +        else
    +        {
    +            // console.log('no marker info loaded', marker);
    +
    +            this.position = position;
    +            this.volume = volume;
    +            this.loop = loop;
    +            this.duration = 0;
    +            this.durationMS = 0;
    +
    +            this._tempMarker = marker;
    +            this._tempPosition = position;
    +            this._tempVolume = volume;
    +            this._tempLoop = loop;
    +        }
    +
    +        if (this.usingWebAudio)
    +        {
    +            //  Does the sound need decoding?
    +            if (this.game.cache.isSoundDecoded(this.key))
    +            {
    +                //  Do we need to do this every time we play? How about just if the buffer is empty?
    +                if (this._buffer == null)
    +                {
    +                    this._buffer = this.game.cache.getSoundData(this.key);
    +                }
    +
    +                this._sound = this.context.createBufferSource();
    +                this._sound.buffer = this._buffer;
    +                this._sound.connect(this.gainNode);
    +                this.totalDuration = this._sound.buffer.duration;
    +
    +                if (this.duration == 0)
    +                {
    +                    // console.log('duration reset');
    +                    this.duration = this.totalDuration;
    +                    this.durationMS = this.totalDuration * 1000;
    +                }
    +
    +                if (this.loop && marker == '')
    +                {
    +                    this._sound.loop = true;
    +                }
    +
    +                //  Useful to cache this somewhere perhaps?
    +                if (typeof this._sound.start === 'undefined')
    +                {
    +                    this._sound.noteGrainOn(0, this.position, this.duration);
    +                    // this._sound.noteGrainOn(0, this.position, this.duration / 1000);
    +                    //this._sound.noteOn(0); // the zero is vitally important, crashes iOS6 without it
    +				}
    +				else
    +				{
    +                    // this._sound.start(0, this.position, this.duration / 1000);
    +                    this._sound.start(0, this.position, this.duration);
    +                }
    +
    +                this.isPlaying = true;
    +                this.startTime = this.game.time.now;
    +                this.currentTime = 0;
    +                this.stopTime = this.startTime + this.durationMS;
    +                this.onPlay.dispatch(this);
    +			}
    +			else
    +			{
    +                this.pendingPlayback = true;
    +
    +                if (this.game.cache.getSound(this.key) && this.game.cache.getSound(this.key).isDecoding == false)
    +                {
    +                    this.game.sound.decode(this.key, this);
    +                }
    +            }
    +        }
    +        else
    +        {
    +            // console.log('Sound play Audio');
    +            if (this.game.cache.getSound(this.key) && this.game.cache.getSound(this.key).locked)
    +            {
    +                // console.log('tried playing locked sound, pending set, reload started');
    +                this.game.cache.reloadSound(this.key);
    +                this.pendingPlayback = true;
    +            }
    +            else
    +            {
    +                // console.log('sound not locked, state?', this._sound.readyState);
    +                if (this._sound && this._sound.readyState == 4)
    +                {
    +                    this._sound.play();
    +                    //  This doesn't become available until you call play(), wonderful ...
    +                    this.totalDuration = this._sound.duration;
    +
    +                    if (this.duration == 0)
    +                    {
    +                        this.duration = this.totalDuration;
    +                        this.durationMS = this.totalDuration * 1000;
    +                    }
    +
    +                    // console.log('playing', this._sound);
    +                    this._sound.currentTime = this.position;
    +                    this._sound.muted = this._muted;
    +                    
    +                    if (this._muted)
    +                    {
    +                        this._sound.volume = 0;
    +                    }
    +                    else
    +                    {
    +                        this._sound.volume = this._volume;
    +                    }
    +
    +                    this.isPlaying = true;
    +                    this.startTime = this.game.time.now;
    +                    this.currentTime = 0;
    +                    this.stopTime = this.startTime + this.durationMS;
    +                    this.onPlay.dispatch(this);
    +                }
    +                else
    +                {
    +                    this.pendingPlayback = true;
    +                }
    +            }
    +        }
    +    },
    +
    +    /**
    +    * Restart the sound, or a marked section of it.
    +    * @method Phaser.Sound#restart
    +    * @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) {
    +
    +    	marker = marker || '';
    +    	position = position || 0;
    +    	volume = volume || 1;
    +    	if (typeof loop == 'undefined') { loop = false; }
    +
    +        this.play(marker, position, volume, loop, true);
    +
    +    },
    +
    +    /**
    +    * Pauses the sound
    +    * @method Phaser.Sound#pause
    +    */
    +    pause: function () {
    +
    +        if (this.isPlaying && this._sound)
    +        {
    +            this.stop();
    +            this.isPlaying = false;
    +            this.paused = true;
    +            this.onPause.dispatch(this);
    +        }
    +
    +    },
    +    /**
    +    * Resumes the sound
    +    * @method Phaser.Sound#resume
    +    */
    +    resume: function () {
    +
    +        if (this.paused && this._sound)
    +        {
    +            if (this.usingWebAudio)
    +            {
    +                if (typeof this._sound.start === 'undefined')
    +                {
    +                    this._sound.noteGrainOn(0, this.position, this.duration);
    +                    //this._sound.noteOn(0); // the zero is vitally important, crashes iOS6 without it
    +				}
    +				else
    +				{
    +                    this._sound.start(0, this.position, this.duration);
    +                }
    +            }
    +            else
    +            {
    +                this._sound.play();
    +            }
    +
    +            this.isPlaying = true;
    +            this.paused = false;
    +            this.onResume.dispatch(this);
    +        }
    +
    +    },
    +
    +	/**
    +    * Stop playing this sound.
    +    * @method Phaser.Sound#stop
    +    */
    +    stop: function () {
    +
    +        if (this.isPlaying && this._sound)
    +        {
    +            if (this.usingWebAudio)
    +            {
    +                if (typeof this._sound.stop === 'undefined')
    +                {
    +                    this._sound.noteOff(0);
    +                }
    +                else
    +                {
    +                    this._sound.stop(0);
    +                }
    +            }
    +            else if (this.usingAudioTag)
    +            {
    +                this._sound.pause();
    +                this._sound.currentTime = 0;
    +            }
    +        }
    +
    +        this.isPlaying = false;
    +        var prevMarker = this.currentMarker;
    +        
    +        this.currentMarker = '';
    +        this.onStop.dispatch(this, prevMarker);
    +
    +    }
    +
    +};
    +
    +/**
    +* @name Phaser.Sound#isDecoding
    +* @property {boolean} isDecoding - Returns true if the sound file is still decoding.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.Sound.prototype, "isDecoding", {
    +
    +    get: function () {
    +        return this.game.cache.getSound(this.key).isDecoding;
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.Sound#isDecoded
    +* @property {boolean} isDecoded - Returns true if the sound file has decoded.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.Sound.prototype, "isDecoded", {
    +
    +    get: function () {
    +        return this.game.cache.isSoundDecoded(this.key);
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.Sound#mute
    +* @property {boolean} mute - Gets or sets the muted state of this sound.
    +*/
    +Object.defineProperty(Phaser.Sound.prototype, "mute", {
    +	
    +    get: function () {
    +        return this._muted;
    +    },
    + 
    +    set: function (value) {
    +
    +    	value = value || null;
    +
    +        if (value)
    +        {
    +            this._muted = true;
    +
    +            if (this.usingWebAudio)
    +            {
    +                this._muteVolume = this.gainNode.gain.value;
    +                this.gainNode.gain.value = 0;
    +            }
    +            else if (this.usingAudioTag && this._sound)
    +            {
    +                this._muteVolume = this._sound.volume;
    +                this._sound.volume = 0;
    +            }
    +        }
    +        else
    +        {
    +            this._muted = false;
    +
    +            if (this.usingWebAudio)
    +            {
    +                this.gainNode.gain.value = this._muteVolume;
    +            }
    +            else if (this.usingAudioTag && this._sound)
    +            {
    +                this._sound.volume = this._muteVolume;
    +            }
    +        }
    +
    +        this.onMute.dispatch(this);
    +
    +    }
    +
    +});
    +
    +/**
    +* @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", {
    +
    +    get: function () {
    +        return this._volume;
    +    },
    +
    +    set: function (value) {
    +
    +        if (this.usingWebAudio)
    +        {
    +            this._volume = value;
    +            this.gainNode.gain.value = value;
    +        }
    +        else if (this.usingAudioTag && this._sound)
    +        {
    +            //  Causes an Index size error in Firefox if you don't clamp the value
    +            if (value >= 0 && value <= 1)
    +            {
    +                this._volume = value;
    +                this._sound.volume = value;
    +            }
    +        }
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/SoundManager.js.html b/Docs/out/SoundManager.js.html new file mode 100644 index 00000000..1f07bcb5 --- /dev/null +++ b/Docs/out/SoundManager.js.html @@ -0,0 +1,748 @@ + + + + + + Phaser Source: sound/SoundManager.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: sound/SoundManager.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2013 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* Sound Manager constructor.
    +*
    +* @class Phaser.SoundManager
    +* @classdesc Phaser Sound Manager.
    +* @constructor
    +* @param {Phaser.Game} game reference to the current game instance.
    +*/
    +Phaser.SoundManager = function (game) {
    +
    +	/**
    +	* @property {Phaser.Game} game - Local reference to game.
    +	*/
    +	this.game = game;
    +	
    +	/**
    +	* @property {Phaser.Signal} onSoundDecode - Description.
    +	*/
    +	this.onSoundDecode = new Phaser.Signal;
    +	
    +	/**
    +	* @property {boolean} _muted - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._muted = false;
    +   
    +	/**
    +	* @property {Description} _unlockSource - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._unlockSource = null;
    +
    +    /**
    +    * @property {number} _volume - The global audio volume. A value between 0 (silence) and 1 (full volume).
    +    * @private
    +    * @default 
    +    */
    +    this._volume = 1;
    +
    +    /**
    +    * @property {array} _sounds - An array containing all the sounds 
    +    * @private
    +    * @default The empty array.
    +    */
    +    this._sounds = [];
    +
    +    /**
    +    * @property {Description} context - Description. 
    +    * @default
    +    */
    +    this.context = null;
    +    
    +	/**
    +	* @property {boolean} usingWebAudio - Description.
    +	* @default
    +	*/
    +    this.usingWebAudio = true;
    +    
    +	/**
    +	* @property {boolean} usingAudioTag - Description.
    +	* @default
    +	*/
    +    this.usingAudioTag = false;
    +    
    +	/**
    +	* @property {boolean} noAudio - Description.
    +	* @default
    +	*/
    +    this.noAudio = false;
    +
    +	/**
    +	* @property {boolean} touchLocked - Description.
    +	* @default
    +	*/
    +    this.touchLocked = false;
    +
    +	/**
    +	* @property {number} channels - Description.
    +	* @default
    +	*/
    +    this.channels = 32;
    +	
    +};
    +
    +Phaser.SoundManager.prototype = {
    +
    +    /**
    +    * Initialises the sound manager.
    +    * @method Phaser.SoundManager#boot
    +    * @protected
    +    */
    +    boot: function () {
    +
    +        if (this.game.device.iOS && this.game.device.webAudio == false)
    +        {
    +            this.channels = 1;
    +        }
    +
    +        if (this.game.device.iOS || (window['PhaserGlobal'] && window['PhaserGlobal'].fakeiOSTouchLock))
    +        {
    +            this.game.input.touch.callbackContext = this;
    +            this.game.input.touch.touchStartCallback = this.unlock;
    +            this.game.input.mouse.callbackContext = this;
    +            this.game.input.mouse.mouseDownCallback = this.unlock;
    +            this.touchLocked = true;
    +        }
    +        else
    +        {
    +            //  What about iOS5?
    +            this.touchLocked = false;
    +        }
    +
    +        if (window['PhaserGlobal'])
    +        {
    +            //  Check to see if all audio playback is disabled (i.e. handled by a 3rd party class)
    +            if (window['PhaserGlobal'].disableAudio == true)
    +            {
    +                this.usingWebAudio = false;
    +                this.noAudio = true;
    +                return;
    +            }
    +
    +            //  Check if the Web Audio API is disabled (for testing Audio Tag playback during development)
    +            if (window['PhaserGlobal'].disableWebAudio == true)
    +            {
    +                this.usingWebAudio = false;
    +                this.usingAudioTag = true;
    +                this.noAudio = false;
    +                return;
    +            }
    +        }
    +
    +        if (!!window['AudioContext'])
    +        {
    +            this.context = new window['AudioContext']();
    +        }
    +        else if (!!window['webkitAudioContext'])
    +        {
    +            this.context = new window['webkitAudioContext']();
    +        }
    +        else if (!!window['Audio'])
    +        {
    +            this.usingWebAudio = false;
    +            this.usingAudioTag = true;
    +        }
    +        else
    +        {
    +            this.usingWebAudio = false;
    +            this.noAudio = true;
    +        }
    +
    +        if (this.context !== null)
    +        {
    +            if (typeof this.context.createGain === 'undefined')
    +            {
    +                this.masterGain = this.context.createGainNode();
    +            }
    +            else
    +            {
    +                this.masterGain = this.context.createGain();
    +            }
    +
    +            this.masterGain.gain.value = 1;
    +            this.masterGain.connect(this.context.destination);
    +        }
    +
    +
    +    },
    +
    +    /**
    +    * Enables the audio, usually after the first touch.
    +    * @method Phaser.SoundManager#unlock
    +    */
    +    unlock: function () {
    +
    +        if (this.touchLocked == false)
    +        {
    +            return;
    +        }
    +
    +        //  Global override (mostly for Audio Tag testing)
    +        if (this.game.device.webAudio == false || (window['PhaserGlobal'] && window['PhaserGlobal'].disableWebAudio == true))
    +        {
    +            //  Create an Audio tag?
    +            this.touchLocked = false;
    +            this._unlockSource = null;
    +            this.game.input.touch.callbackContext = null;
    +            this.game.input.touch.touchStartCallback = null;
    +            this.game.input.mouse.callbackContext = null;
    +            this.game.input.mouse.mouseDownCallback = null;
    +        }
    +        else
    +        {
    +            // Create empty buffer and play it
    +            var buffer = this.context.createBuffer(1, 1, 22050);
    +            this._unlockSource = this.context.createBufferSource();
    +            this._unlockSource.buffer = buffer;
    +            this._unlockSource.connect(this.context.destination);
    +            this._unlockSource.noteOn(0);
    +        }
    +
    +    },
    +
    +    /**
    +    * Stops all the sounds in the game.
    +    * @method Phaser.SoundManager#stopAll
    +    */
    +    stopAll: function () {
    +
    +        for (var i = 0; i < this._sounds.length; i++)
    +        {
    +            if (this._sounds[i])
    +            {
    +                this._sounds[i].stop();
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * Pauses all the sounds in the game.
    +    * @method Phaser.SoundManager#pauseAll
    +    */
    +    pauseAll: function () {
    +
    +        for (var i = 0; i < this._sounds.length; i++)
    +        {
    +            if (this._sounds[i])
    +            {
    +                this._sounds[i].pause();
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * resumes every sound in the game.
    +    * @method Phaser.SoundManager#resumeAll
    +    */
    +    resumeAll: function () {
    +
    +        for (var i = 0; i < this._sounds.length; i++)
    +        {
    +            if (this._sounds[i])
    +            {
    +                this._sounds[i].resume();
    +            }
    +        }
    +   
    +	},
    +
    +	/**
    +    * 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.
    +    */
    +    decode: function (key, sound) {
    +
    +        sound = sound || null;
    +
    +        var soundData = this.game.cache.getSoundData(key);
    +
    +        if (soundData)
    +        {
    +            if (this.game.cache.isSoundDecoded(key) === false)
    +            {
    +                this.game.cache.updateSound(key, 'isDecoding', true);
    +
    +                var that = this;
    +
    +                this.context.decodeAudioData(soundData, function (buffer) {
    +                    that.game.cache.decodedSound(key, buffer);
    +                    if (sound)
    +                    {
    +                        that.onSoundDecode.dispatch(sound);
    +                    }
    +                });
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * Updates every sound in the game.
    +    * @method Phaser.SoundManager#update
    +    */
    +    update: function () {
    +
    +        if (this.touchLocked)
    +        {
    +            if (this.game.device.webAudio && this._unlockSource !== null)
    +            {
    +                if ((this._unlockSource.playbackState === this._unlockSource.PLAYING_STATE || this._unlockSource.playbackState === this._unlockSource.FINISHED_STATE))
    +                {
    +                    this.touchLocked = false;
    +                    this._unlockSource = null;
    +                    this.game.input.touch.callbackContext = null;
    +                    this.game.input.touch.touchStartCallback = null;
    +                }
    +            }
    +        }
    +
    +        for (var i = 0; i < this._sounds.length; i++)
    +        {
    +            this._sounds[i].update();
    +        }
    +
    +    },
    +
    +    /**
    +    * Adds a new Sound into the SoundManager.
    +    * @method Phaser.SoundManager#add
    +    * @param {string} key - Asset key for the sound.
    +    * @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);
    +
    +        return sound;
    +
    +    }
    +
    +};
    +
    +/**
    +* @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", {
    +
    +    get: function () {
    +
    +        return this._muted;
    +
    +    },
    +
    +    set: function (value) {
    +
    +        value = value || null;
    +
    +        if (value)
    +        {
    +            if (this._muted)
    +            {
    +                return;
    +            }
    +
    +            this._muted = true;
    +            
    +            if (this.usingWebAudio)
    +            {
    +                this._muteVolume = this.masterGain.gain.value;
    +                this.masterGain.gain.value = 0;
    +            }
    +
    +            //  Loop through sounds
    +            for (var i = 0; i < this._sounds.length; i++)
    +            {
    +                if (this._sounds[i].usingAudioTag)
    +                {
    +                    this._sounds[i].mute = true;
    +                }
    +            }
    +        }
    +        else
    +        {
    +            if (this._muted == false)
    +            {
    +                return;
    +            }
    +
    +            this._muted = false;
    +
    +            if (this.usingWebAudio)
    +            {
    +                this.masterGain.gain.value = this._muteVolume;
    +            }
    +
    +            //  Loop through sounds
    +            for (var i = 0; i < this._sounds.length; i++)
    +            {
    +                if (this._sounds[i].usingAudioTag)
    +                {
    +                    this._sounds[i].mute = false;
    +                }
    +            }
    +        }
    +    }
    +
    +});
    +
    +/**
    +* @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", {
    +    
    +    get: function () {
    +
    +        if (this.usingWebAudio)
    +        {
    +            return this.masterGain.gain.value;
    +        }
    +        else
    +        {
    +            return this._volume;
    +        }
    +
    +    },
    +
    +    set: function (value) {
    +
    +        value = this.game.math.clamp(value, 1, 0);
    +
    +        this._volume = value;
    +
    +        if (this.usingWebAudio)
    +        {
    +            this.masterGain.gain.value = value;
    +        }
    +
    +        //  Loop through the sound cache and change the volume of all html audio tags
    +        for (var i = 0; i < this._sounds.length; i++)
    +        {
    +            if (this._sounds[i].usingAudioTag)
    +            {
    +                this._sounds[i].volume = this._sounds[i].volume * value;
    +            }
    +        }
    +        
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Stage.js.html b/Docs/out/Stage.js.html index 005c6328..c30552bc 100644 --- a/Docs/out/Stage.js.html +++ b/Docs/out/Stage.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -392,7 +402,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", { 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/StageScaleMode.js.html b/Docs/out/StageScaleMode.js.html new file mode 100644 index 00000000..4921b965 --- /dev/null +++ b/Docs/out/StageScaleMode.js.html @@ -0,0 +1,870 @@ + + + + + + Phaser Source: system/StageScaleMode.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: system/StageScaleMode.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2013 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* 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.
    +*
    +* @class Phaser.StageScaleMode 
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +* @param {number} width - Description.
    +* @param {number} height - Description.
    +*/
    +Phaser.StageScaleMode = function (game, width, height) {
    +
    +    /**
    +    * @property {number} _startHeight - Stage height when starting the game.
    +    * @default
    +    * @private
    +    */
    +    this._startHeight = 0;
    +
    +    /**
    +    * @property {boolean} forceLandscape - If the game should be forced to use Landscape mode, this is set to true by Game.Stage
    +    * @default
    +    */
    +    this.forceLandscape = false;
    +
    +    /**
    +    * @property {boolean} forcePortrait - If the game should be forced to use Portrait mode, this is set to true by Game.Stage
    +    * @default
    +    */
    +     this.forcePortrait = false;
    +
    +    /**
    +    * @property {boolean} incorrectOrientation - If the game should be forced to use a specific orientation and the device currently isn't in that orientation this is set to true.
    +    * @default
    +    */
    +    this.incorrectOrientation = false;
    +
    +    /**
    +    * @property {boolean} pageAlignHorizontally - 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>
    +    * @default
    +    */
    +    this.pageAlignHorizontally = false;
    +
    +    /**
    +    * @property {boolean} pageAlignVeritcally - 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>
    +    * @default
    +    */
    +    this.pageAlignVeritcally = false;
    +
    +    /**
    +    * @property {number} minWidth - Minimum width the canvas should be scaled to (in pixels).
    +    * @default
    +    */
    +    this.minWidth = null;
    +
    +    /**
    +    * @property {number} maxWidth - Maximum width the canvas should be scaled to (in pixels).
    +    * If null it will scale to whatever width the browser can handle.
    +    * @default
    +    */
    +    this.maxWidth = null;
    +
    +    /**
    +    * @property {number} minHeight - Minimum height the canvas should be scaled to (in pixels).
    +    * @default
    +    */
    +    this.minHeight = null;
    +
    +    /**
    +    * @property {number} maxHeight - Maximum height the canvas should be scaled to (in pixels).
    +    * If null it will scale to whatever height the browser can handle.
    +    * @default
    +    */
    +    this.maxHeight = null;
    +
    +    /**
    +    * @property {number} width - Width of the stage after calculation.
    +    * @default
    +    */
    +    this.width = 0;
    +
    +    /**
    +    * @property {number} height - Height of the stage after calculation.
    +    * @default
    +    */
    +    this.height = 0;
    +
    +    /**
    +    * @property {number} maxIterations - The maximum number of times it will try to resize the canvas to fill the browser.
    +    * @default
    +    */
    +    this.maxIterations = 5;
    +    
    +    /**
    +    * @property {Phaser.Game} game - A reference to the currently running game.
    +    */
    +    this.game = game;
    +
    +    /**
    +    * @property {Description} enterLandscape - Description.
    +    */
    +    this.enterLandscape = new Phaser.Signal();
    +
    +    /**
    +    * @property {Description} enterPortrait - Description.
    +    */
    +    this.enterPortrait = new Phaser.Signal();
    +
    +    if (window['orientation'])
    +    {
    +        this.orientation = window['orientation'];
    +    }
    +    else
    +    {
    +        if (window.outerWidth > window.outerHeight)
    +        {
    +            this.orientation = 90;
    +        }
    +        else
    +        {
    +            this.orientation = 0;
    +        }
    +    }
    +
    +    /**
    +    * @property {Description} scaleFactor - Description.
    +    */
    +    this.scaleFactor = new Phaser.Point(1, 1);
    +
    +    /**
    +    * @property {number} aspectRatio - Aspect ratio.
    +    * @default
    +    */
    +    this.aspectRatio = 0;
    +
    +    var _this = this;
    +
    +    window.addEventListener('orientationchange', function (event) {
    +        return _this.checkOrientation(event);
    +    }, false);
    +
    +    window.addEventListener('resize', function (event) {
    +        return _this.checkResize(event);
    +    }, false);
    +	
    +};
    +
    +/**
    +* @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 = {
    +
    +    /**
    +    * 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 () {
    +
    +        if (this.isFullScreen)
    +        {
    +            return;
    +        }
    +
    +        var element = this.game.canvas;
    +        
    +        if (element['requestFullScreen'])
    +        {
    +            element['requestFullScreen']();
    +        }
    +        else if (element['mozRequestFullScreen'])
    +        {
    +            element['mozRequestFullScreen']();
    +        }
    +        else if (element['webkitRequestFullScreen'])
    +        {
    +            element['webkitRequestFullScreen'](Element.ALLOW_KEYBOARD_INPUT);
    +        }
    +
    +        this.game.stage.canvas.style['width'] = '100%';
    +        this.game.stage.canvas.style['height'] = '100%';
    +
    +    },
    +
    +    /**
    +    * Stops full screen mode if the browser is in it.
    +    * @method Phaser.StageScaleMode#stopFullScreen
    +    */
    +    stopFullScreen: function () {
    +
    +        if (document['cancelFullScreen'])
    +        {
    +            document['cancelFullScreen']();
    +        }
    +        else if (document['mozCancelFullScreen'])
    +        {
    +            document['mozCancelFullScreen']();
    +        }
    +        else if (document['webkitCancelFullScreen'])
    +        {
    +            document['webkitCancelFullScreen']();
    +        }
    +
    +    },
    +
    +    /**
    +    * 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 () {
    +
    +        //  They are in the wrong orientation
    +        if (this.incorrectOrientation)
    +        {
    +            if ((this.forceLandscape && window.innerWidth > window.innerHeight) || (this.forcePortrait && window.innerHeight > window.innerWidth))
    +            {
    +                //  Back to normal
    +                this.game.paused = false;
    +                this.incorrectOrientation = false;
    +                this.refresh();
    +            }
    +        }
    +        else
    +        {
    +            if ((this.forceLandscape && window.innerWidth < window.innerHeight) || (this.forcePortrait && window.innerHeight < window.innerWidth))
    +            {
    +                //  Show orientation screen
    +                this.game.paused = true;
    +                this.incorrectOrientation = true;
    +                this.refresh();
    +            }
    +        }
    +    },
    +
    +    /**
    +    * Handle window.orientationchange events
    +    * @method Phaser.StageScaleMode#checkOrientation
    +    * @param {Event} event - The orientationchange event data.
    +    */
    +    checkOrientation: function (event) {
    +
    +        this.orientation = window['orientation'];
    +
    +        if (this.isLandscape)
    +        {
    +            this.enterLandscape.dispatch(this.orientation, true, false);
    +        }
    +        else
    +        {
    +            this.enterPortrait.dispatch(this.orientation, false, true);
    +        }
    +
    +        if (this.game.stage.scaleMode !== Phaser.StageScaleMode.NO_SCALE)
    +        {
    +            this.refresh();
    +        }
    +
    +    },
    +
    +    /**
    +    * Handle window.resize events
    +    * @method Phaser.StageScaleMode#checkResize
    +    * @param {Event} event - The resize event data.
    +    */
    +    checkResize: function (event) {
    +
    +        if (window.outerWidth > window.outerHeight)
    +        {
    +            this.orientation = 90;
    +        }
    +        else
    +        {
    +            this.orientation = 0;
    +        }
    +
    +        if (this.isLandscape)
    +        {
    +            this.enterLandscape.dispatch(this.orientation, true, false);
    +        }
    +        else
    +        {
    +            this.enterPortrait.dispatch(this.orientation, false, true);
    +        }
    +
    +        if (this.game.stage.scaleMode !== Phaser.StageScaleMode.NO_SCALE)
    +        {
    +            this.refresh();
    +        }
    +    },
    +
    +    /**
    +    * Re-calculate scale mode and update screen size.
    +    * @method Phaser.StageScaleMode#refresh
    +    */
    +    refresh: function () {
    +
    +        var _this = this;
    +        
    +        //  We can't do anything about the status bars in iPads, web apps or desktops
    +        if (this.game.device.iPad == false && this.game.device.webApp == false && this.game.device.desktop == false)
    +        {
    +            // document.documentElement['style'].minHeight = '2000px';
    +            // this._startHeight = window.innerHeight;
    +
    +            if (this.game.device.android && this.game.device.chrome == false)
    +            {
    +                window.scrollTo(0, 1);
    +            }
    +            else
    +            {
    +                window.scrollTo(0, 0);
    +            }
    +        }
    +
    +        if (this._check == null && this.maxIterations > 0)
    +        {
    +            this._iterations = this.maxIterations;
    +            this._check = window.setInterval(function () {
    +                return _this.setScreenSize();
    +            }, 10);
    +            this.setScreenSize();
    +        }
    +
    +    },
    +
    +    /**
    +    * Set screen size automatically based on the scaleMode.
    +    * @param {Description} force - If force is true it will try to resize the game regardless of the document dimensions.
    +    */
    +    setScreenSize: function (force) {
    +
    +        if (typeof force == 'undefined')
    +        {
    +            force = false;
    +        }
    +        
    +        if (this.game.device.iPad == false && this.game.device.webApp == false && this.game.device.desktop == false) 
    +        {
    +            if (this.game.device.android && this.game.device.chrome == false)
    +            {
    +                window.scrollTo(0, 1);
    +            }
    +            else
    +            {
    +                window.scrollTo(0, 0);
    +            }
    +        }
    +
    +        this._iterations--;
    +
    +        if (force || window.innerHeight > this._startHeight || this._iterations < 0)
    +        {
    +            // Set minimum height of content to new window height
    +            document.documentElement['style'].minHeight = window.innerHeight + 'px';
    +        
    +            if (this.incorrectOrientation == true)
    +            {
    +                this.setMaximum();
    +            }
    +            else if (this.game.stage.scaleMode == Phaser.StageScaleMode.EXACT_FIT)
    +            {
    +                this.setExactFit();
    +            }
    +            else if (this.game.stage.scaleMode == Phaser.StageScaleMode.SHOW_ALL)
    +            {
    +                this.setShowAll();
    +            }
    +
    +            this.setSize();
    +            clearInterval(this._check);
    +            this._check = null;
    +        }
    +
    +    },
    +
    +    /**
    +    * Sets the canvas style width and height values based on minWidth/Height and maxWidth/Height.
    +    * @method Phaser.StageScaleMode#setSize
    +    */
    +    setSize: function () {
    +
    +        if (this.incorrectOrientation == false)
    +        {
    +            if (this.maxWidth && this.width > this.maxWidth)
    +            {
    +                this.width = this.maxWidth;
    +            }
    +
    +            if (this.maxHeight && this.height > this.maxHeight)
    +            {
    +                this.height = this.maxHeight;
    +            }
    +
    +            if (this.minWidth && this.width < this.minWidth)
    +            {
    +                this.width = this.minWidth;
    +            }
    +
    +            if (this.minHeight && this.height < this.minHeight)
    +            {
    +                this.height = this.minHeight;
    +            }
    +        }
    +
    +        this.game.canvas.style.width = this.width + 'px';
    +        this.game.canvas.style.height = this.height + 'px';
    +        
    +        this.game.input.scale.setTo(this.game.width / this.width, this.game.height / this.height);
    +
    +        if (this.pageAlignHorizontally)
    +        {
    +            if (this.width < window.innerWidth && this.incorrectOrientation == false)
    +            {
    +                this.game.canvas.style.marginLeft = Math.round((window.innerWidth - this.width) / 2) + 'px';
    +            }
    +            else
    +            {
    +                this.game.canvas.style.marginLeft = '0px';
    +            }
    +        }
    +
    +        if (this.pageAlignVeritcally)
    +        {
    +            if (this.height < window.innerHeight && this.incorrectOrientation == false)
    +            {
    +                this.game.canvas.style.marginTop = Math.round((window.innerHeight - this.height) / 2) + 'px';
    +            }
    +            else
    +            {
    +                this.game.canvas.style.marginTop = '0px';
    +            }
    +        }
    +
    +        Phaser.Canvas.getOffset(this.game.canvas, this.game.stage.offset);
    +        
    +        this.aspectRatio = this.width / this.height;
    +        
    +        this.scaleFactor.x = this.game.width / this.width;
    +        this.scaleFactor.y = this.game.height / this.height;
    +
    +    },
    +
    +    /**
    +    * Sets this.width equal to window.innerWidth and this.height equal to window.innerHeight
    +    * @method Phaser.StageScaleMode#setMaximum
    +    */
    +    setMaximum: function () {
    +
    +        this.width = window.innerWidth;
    +        this.height = window.innerHeight;
    +
    +    },
    +
    +    /**
    +    * Calculates the multiplier needed to scale the game proportionally.
    +    * @method Phaser.StageScaleMode#setShowAll
    +    */
    +    setShowAll: function () {
    +
    +        var multiplier = Math.min((window.innerHeight / this.game.height), (window.innerWidth / this.game.width));
    +
    +        this.width = Math.round(this.game.width * multiplier);
    +        this.height = Math.round(this.game.height * multiplier);
    +
    +    },
    +
    +    /**
    +    * 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);
    +
    +        if (this.maxWidth && availableWidth > this.maxWidth)
    +        {
    +            this.width = this.maxWidth;
    +        }
    +        else
    +        {
    +            this.width = availableWidth;
    +        }
    +
    +        if (this.maxHeight && availableHeight > this.maxHeight)
    +        {
    +            this.height = this.maxHeight;
    +        }
    +        else
    +        {
    +            this.height = availableHeight;
    +        }
    +
    +        console.log('setExactFit', this.width, this.height, this.game.stage.offset);
    +
    +    }
    +
    +};
    +
    +/**
    +* @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", {
    +
    +    get: function () {
    +
    +        if (document['fullscreenElement'] === null || document['mozFullScreenElement'] === null || document['webkitFullscreenElement'] === null)
    +        {
    +            return false;
    +        }
    +
    +        return true;
    +
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.StageScaleMode#isPortrait
    +* @property {boolean} isPortrait - Returns true if the browser dimensions match a portrait display.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.StageScaleMode.prototype, "isPortrait", {
    +
    +    get: function () {
    +        return this.orientation == 0 || this.orientation == 180;
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.StageScaleMode#isLandscape
    +* @property {boolean} isLandscape - Returns true if the browser dimensions match a landscape display.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", {
    +
    +    get: function () {
    +        return this.orientation === 90 || this.orientation === -90;
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Thu Oct 03 2013 01:18:41 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/State.js.html b/Docs/out/State.js.html index 3b8d02c8..0d701d24 100644 --- a/Docs/out/State.js.html +++ b/Docs/out/State.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -415,7 +425,7 @@ Phaser.State.prototype = { 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/StateManager.js.html b/Docs/out/StateManager.js.html index 46c4bafe..e3f8037a 100644 --- a/Docs/out/StateManager.js.html +++ b/Docs/out/StateManager.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -771,7 +781,7 @@ Phaser.StateManager.prototype = { 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/Touch.js.html b/Docs/out/Touch.js.html index abba765b..c0d8e1ec 100644 --- a/Docs/out/Touch.js.html +++ b/Docs/out/Touch.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -579,7 +589,7 @@ Phaser.Touch.prototype = { 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/World.js.html b/Docs/out/World.js.html index d86a539e..4b18494f 100644 --- a/Docs/out/World.js.html +++ b/Docs/out/World.js.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -488,7 +498,7 @@ Object.defineProperty(Phaser.World.prototype, "randomY", { 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/classes.list.html b/Docs/out/classes.list.html index 70aff74c..0b8a4e1a 100644 --- a/Docs/out/classes.list.html +++ b/Docs/out/classes.list.html @@ -70,10 +70,18 @@ Camera +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -303,9 +313,15 @@
    Camera
    +
    Canvas
    +
    +
    Circle
    +
    Device
    +
    +
    Game
    @@ -372,12 +388,24 @@
    Rectangle
    +
    RequestAnimationFrame
    +
    +
    Signal
    +
    Sound
    +
    + +
    SoundManager
    +
    +
    Stage
    +
    StageScaleMode
    +
    +
    State
    @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -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 +
  • + Canvas +
  • +
  • Circle
  • +
  • + Device +
  • +
  • Game
  • @@ -162,14 +170,30 @@ Rectangle +
  • + RequestAnimationFrame +
  • +
  • Signal
  • +
  • + Sound +
  • + +
  • + SoundManager +
  • +
  • Stage
  • +
  • + StageScaleMode +
  • +
  • State
  • @@ -194,20 +218,6 @@ - - @@ -303,9 +313,15 @@
    Camera
    +
    Canvas
    +
    +
    Circle
    +
    Device
    +
    +
    Game
    @@ -372,12 +388,24 @@
    Rectangle
    +
    RequestAnimationFrame
    +
    +
    Signal
    +
    Sound
    +
    + +
    SoundManager
    +
    +
    Stage
    +
    StageScaleMode
    +
    +
    State
    @@ -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", { } }); -