From 9f9e6a2a573c8d116340c031f1b77dc2bc27f59e Mon Sep 17 00:00:00 2001 From: photonstorm Date: Fri, 25 Oct 2013 16:54:40 +0100 Subject: [PATCH] Lots of doc updates! --- docs/Animation.js.html | 172 +- docs/AnimationManager.js.html | 124 +- docs/AnimationParser.js.html | 124 +- docs/ArcadePhysics.js.html | 1778 +++++ docs/BitmapText.js.html | 731 ++ docs/Body.js.html | 840 +++ docs/Bullet.js.html | 1128 +++ docs/Button.js.html | 825 +++ docs/Cache.js.html | 127 +- docs/Camera.js.html | 124 +- docs/Canvas.js.html | 124 +- docs/Circle.js.html | 124 +- docs/Color.js.html | 124 +- docs/Debug.js.html | 132 +- docs/Device.js.html | 134 +- docs/Easing.js.html | 124 +- docs/Emitter.js.html | 124 +- docs/Events.js.html | 572 ++ docs/Frame.js.html | 124 +- docs/FrameData.js.html | 124 +- docs/Game.js.html | 154 +- docs/GameObjectFactory.js.html | 795 +++ docs/Graphics.js.html | 592 ++ docs/Group.js.html | 136 +- docs/Input.js.html | 159 +- docs/InputHandler.js.html | 167 +- docs/Intro.js.html | 126 +- docs/Key.js.html | 124 +- docs/Keyboard.js.html | 124 +- docs/LinkedList.js.html | 124 +- docs/Loader.js.html | 133 +- docs/LoaderParser.js.html | 124 +- docs/MSPointer.js.html | 124 +- docs/Math.js.html | 124 +- docs/Mouse.js.html | 124 +- docs/Net.js.html | 124 +- docs/Particles.js.html | 124 +- docs/Phaser.Animation.html | 136 +- docs/Phaser.AnimationManager.html | 128 +- docs/Phaser.AnimationParser.html | 124 +- docs/Phaser.BitmapText.html | 1654 +++++ docs/Phaser.Bullet.html | 4145 +++++++++++ docs/Phaser.Button.html | 2139 ++++++ docs/Phaser.Cache.html | 192 +- docs/Phaser.Camera.html | 128 +- docs/Phaser.Canvas.html | 124 +- docs/Phaser.Circle.html | 124 +- docs/Phaser.Color.html | 124 +- docs/Phaser.Device.html | 128 +- docs/Phaser.Easing.Back.html | 124 +- docs/Phaser.Easing.Bounce.html | 124 +- docs/Phaser.Easing.Circular.html | 124 +- docs/Phaser.Easing.Cubic.html | 124 +- docs/Phaser.Easing.Elastic.html | 124 +- docs/Phaser.Easing.Exponential.html | 124 +- docs/Phaser.Easing.Linear.html | 124 +- docs/Phaser.Easing.Quadratic.html | 124 +- docs/Phaser.Easing.Quartic.html | 124 +- docs/Phaser.Easing.Quintic.html | 124 +- docs/Phaser.Easing.Sinusoidal.html | 124 +- docs/Phaser.Easing.html | 124 +- docs/Phaser.Events.html | 660 ++ docs/Phaser.Frame.html | 124 +- docs/Phaser.FrameData.html | 124 +- docs/Phaser.Game.html | 136 +- docs/Phaser.GameObjectFactory.html | 1078 +++ docs/Phaser.Graphics.html | 812 +++ docs/Phaser.Group.html | 212 +- docs/Phaser.Input.html | 421 +- docs/Phaser.InputHandler.html | 192 +- docs/Phaser.Key.html | 124 +- docs/Phaser.Keyboard.html | 124 +- docs/Phaser.LinkedList.html | 124 +- docs/Phaser.Loader.html | 172 +- docs/Phaser.LoaderParser.html | 124 +- docs/Phaser.MSPointer.html | 124 +- docs/Phaser.Math.html | 124 +- docs/Phaser.Mouse.html | 124 +- docs/Phaser.Net.html | 124 +- docs/Phaser.Particles.Arcade.Emitter.html | 200 +- docs/Phaser.Particles.html | 124 +- docs/Phaser.Physics.Arcade.html | 6408 +++++++++++++++++ docs/Phaser.Physics.html | 612 ++ docs/Phaser.Plugin.html | 124 +- docs/Phaser.PluginManager.html | 124 +- docs/Phaser.Point.html | 124 +- docs/Phaser.Pointer.html | 124 +- docs/Phaser.QuadTree.html | 124 +- docs/Phaser.RandomDataGenerator.html | 124 +- docs/Phaser.Rectangle.html | 269 +- docs/Phaser.RenderTexture.html | 1452 ++++ docs/Phaser.RequestAnimationFrame.html | 124 +- docs/Phaser.Signal.html | 126 +- docs/Phaser.Sound.html | 401 +- docs/Phaser.SoundManager.html | 124 +- docs/Phaser.Sprite.html | 7799 +++++++++++++++++++++ docs/Phaser.Stage.html | 305 +- docs/Phaser.StageScaleMode.html | 124 +- docs/Phaser.State.html | 126 +- docs/Phaser.StateManager.html | 124 +- docs/Phaser.Text.html | 1886 +++++ docs/Phaser.TileSprite.html | 1219 ++++ docs/Phaser.Time.html | 130 +- docs/Phaser.Touch.html | 124 +- docs/Phaser.Tween.html | 124 +- docs/Phaser.TweenManager.html | 124 +- docs/Phaser.Utils.Debug.html | 174 +- docs/Phaser.Utils.html | 124 +- docs/Phaser.World.html | 124 +- docs/Phaser.html | 157 +- docs/Phaser.js.html | 133 +- docs/Plugin.js.html | 124 +- docs/PluginManager.js.html | 124 +- docs/Point.js.html | 124 +- docs/Pointer.js.html | 128 +- docs/QuadTree.js.html | 124 +- docs/RandomDataGenerator.js.html | 124 +- docs/Rectangle.js.html | 145 +- docs/RenderTexture.js.html | 574 ++ docs/RequestAnimationFrame.js.html | 124 +- docs/Signal.js.html | 124 +- docs/SignalBinding.html | 124 +- docs/SignalBinding.js.html | 124 +- docs/Sound.js.html | 153 +- docs/SoundManager.js.html | 124 +- docs/Sprite.js.html | 1630 +++++ docs/Stage.js.html | 154 +- docs/StageScaleMode.js.html | 124 +- docs/State.js.html | 124 +- docs/StateManager.js.html | 124 +- docs/Text.js.html | 726 ++ docs/TileSprite.js.html | 562 ++ docs/Time.js.html | 130 +- docs/Touch.js.html | 124 +- docs/Tween.js.html | 124 +- docs/TweenManager.js.html | 124 +- docs/Utils.js.html | 124 +- docs/World.js.html | 124 +- docs/build/conf_dev.json | 2 + docs/classes.list.html | 160 +- docs/global.html | 3907 ++++++++++- docs/index.html | 128 +- docs/namespaces.list.html | 160 +- src/gameobjects/Bullet.js | 2 +- src/gameobjects/Sprite.js | 10 +- src/physics/arcade/ArcadePhysics.js | 281 +- src/physics/arcade/Body.js | 327 +- 147 files changed, 60434 insertions(+), 972 deletions(-) create mode 100644 docs/ArcadePhysics.js.html create mode 100644 docs/BitmapText.js.html create mode 100644 docs/Body.js.html create mode 100644 docs/Bullet.js.html create mode 100644 docs/Button.js.html create mode 100644 docs/Events.js.html create mode 100644 docs/GameObjectFactory.js.html create mode 100644 docs/Graphics.js.html create mode 100644 docs/Phaser.BitmapText.html create mode 100644 docs/Phaser.Bullet.html create mode 100644 docs/Phaser.Button.html create mode 100644 docs/Phaser.Events.html create mode 100644 docs/Phaser.GameObjectFactory.html create mode 100644 docs/Phaser.Graphics.html create mode 100644 docs/Phaser.Physics.Arcade.html create mode 100644 docs/Phaser.Physics.html create mode 100644 docs/Phaser.RenderTexture.html create mode 100644 docs/Phaser.Sprite.html create mode 100644 docs/Phaser.Text.html create mode 100644 docs/Phaser.TileSprite.html create mode 100644 docs/RenderTexture.js.html create mode 100644 docs/Sprite.js.html create mode 100644 docs/Text.js.html create mode 100644 docs/TileSprite.js.html diff --git a/docs/Animation.js.html b/docs/Animation.js.html index 9e79967b..b57a3c32 100644 --- a/docs/Animation.js.html +++ b/docs/Animation.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -729,33 +849,55 @@ Object.defineProperty(Phaser.Animation.prototype, "frame", { * * @method Phaser.Animation.generateFrameNames * @param {string} prefix - The start of the filename. If the filename was 'explosion_0001-large' the prefix would be 'explosion_'. -* @param {number} min - The number to start sequentially counting from. If your frames are named 'explosion_0001' to 'explosion_0034' the min is 1. -* @param {number} max - The number to count up to. If your frames are named 'explosion_0001' to 'explosion_0034' the max is 34. +* @param {number} start - The number to start sequentially counting from. If your frames are named 'explosion_0001' to 'explosion_0034' the start is 1. +* @param {number} stop - The number to count to. If your frames are named 'explosion_0001' to 'explosion_0034' the stop value is 34. * @param {string} [suffix=''] - The end of the filename. If the filename was 'explosion_0001-large' the prefix would be '-large'. * @param {number} [zeroPad=0] - The number of zeroes to pad the min and max values with. If your frames are named 'explosion_0001' to 'explosion_0034' then the zeroPad is 4. */ -Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPad) { +Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zeroPad) { if (typeof suffix == 'undefined') { suffix = ''; } var output = []; var frame = ''; - for (var i = min; i <= max; i++) + if (start < stop) { - if (typeof zeroPad == 'number') + for (var i = start; i <= stop; i++) { - // str, len, pad, dir - frame = Phaser.Utils.pad(i.toString(), zeroPad, '0', 1); + if (typeof zeroPad == 'number') + { + // str, len, pad, dir + frame = Phaser.Utils.pad(i.toString(), zeroPad, '0', 1); + } + else + { + frame = i.toString(); + } + + frame = prefix + frame + suffix; + + output.push(frame); } - else + } + else + { + for (var i = start; i >= stop; i--) { - frame = i.toString(); + if (typeof zeroPad == 'number') + { + // str, len, pad, dir + frame = Phaser.Utils.pad(i.toString(), zeroPad, '0', 1); + } + else + { + frame = i.toString(); + } + + frame = prefix + frame + suffix; + + output.push(frame); } - - frame = prefix + frame + suffix; - - output.push(frame); } return output; @@ -781,8 +923,8 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/AnimationManager.js.html b/docs/AnimationManager.js.html index e6f07a55..3e94389f 100644 --- a/docs/AnimationManager.js.html +++ b/docs/AnimationManager.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -745,8 +865,8 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/AnimationParser.js.html b/docs/AnimationParser.js.html index ebf468ab..d0f3c520 100644 --- a/docs/AnimationParser.js.html +++ b/docs/AnimationParser.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -659,8 +779,8 @@ Phaser.AnimationParser = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/ArcadePhysics.js.html b/docs/ArcadePhysics.js.html new file mode 100644 index 00000000..4c8b318e --- /dev/null +++ b/docs/ArcadePhysics.js.html @@ -0,0 +1,1778 @@ + + + + + + Phaser Source: physics/arcade/ArcadePhysics.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: physics/arcade/ArcadePhysics.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}
    +*/
    +
    +/**
    +* @class Phaser.Physics
    +*/
    +Phaser.Physics = {};
    +
    +/**
    +* Arcade Physics constructor.
    +*
    +* @class Phaser.Physics.Arcade
    +* @classdesc Arcade Physics Constructor
    +* @constructor
    +* @param {Phaser.Game} game reference to the current game instance.
    +*/
    +Phaser.Physics.Arcade = function (game) {
    +    
    +    this.game = game;
    +
    +    this.gravity = new Phaser.Point;
    +    this.bounds = new Phaser.Rectangle(0, 0, game.world.width, game.world.height);
    +
    +    /**
    +    * Used by the QuadTree to set the maximum number of objects
    +    * @type {number}
    +    */
    +    this.maxObjects = 10;
    +
    +    /**
    +    * Used by the QuadTree to set the maximum number of levels
    +    * @type {number}
    +    */
    +    this.maxLevels = 4;
    +
    +    this.OVERLAP_BIAS = 4;
    +    this.TILE_OVERLAP = false;
    +
    +    this.quadTree = new Phaser.QuadTree(this, this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels);
    +    this.quadTreeID = 0;
    +
    +    //  Avoid gc spikes by caching these values for re-use
    +    this._bounds1 = new Phaser.Rectangle;
    +    this._bounds2 = new Phaser.Rectangle;
    +    this._overlap = 0;
    +    this._maxOverlap = 0;
    +    this._velocity1 = 0;
    +    this._velocity2 = 0;
    +    this._newVelocity1 = 0;
    +    this._newVelocity2 = 0;
    +    this._average = 0;
    +    this._mapData = [];
    +    this._mapTiles = 0;
    +    this._result = false;
    +    this._total = 0;
    +    this._angle = 0;
    +    this._dx = 0;
    +    this._dy = 0;
    +
    +};
    +
    +Phaser.Physics.Arcade.prototype = {
    +
    +    /**
    +    * Called automatically by a Physics body, it updates all motion related values on the Body.
    +    *
    +    * @method Phaser.Physics.Arcade#updateMotion
    +    * @param {Phaser.Physics.Arcade.Body} The Body object to be updated.
    +    */
    +    updateMotion: function (body) {
    +
    +        //  If you're wondering why the velocity is halved and applied twice, read this: http://www.niksula.hut.fi/~hkankaan/Homepages/gravity.html
    +
    +        //  Rotation
    +        this._velocityDelta = (this.computeVelocity(0, body, body.angularVelocity, body.angularAcceleration, body.angularDrag, body.maxAngular) - body.angularVelocity) / 2;
    +        body.angularVelocity += this._velocityDelta;
    +        body.rotation += (body.angularVelocity * this.game.time.physicsElapsed);
    +        body.angularVelocity += this._velocityDelta;
    +
    +        //  Horizontal
    +        this._velocityDelta = (this.computeVelocity(1, body, body.velocity.x, body.acceleration.x, body.drag.x, body.maxVelocity.x) - body.velocity.x) / 2;
    +        body.velocity.x += this._velocityDelta;
    +        body.x += (body.velocity.x * this.game.time.physicsElapsed);
    +        body.velocity.x += this._velocityDelta;
    +
    +        //  Vertical
    +        this._velocityDelta = (this.computeVelocity(2, body, body.velocity.y, body.acceleration.y, body.drag.y, body.maxVelocity.y) - body.velocity.y) / 2;
    +        body.velocity.y += this._velocityDelta;
    +        body.y += (body.velocity.y * this.game.time.physicsElapsed);
    +        body.velocity.y += this._velocityDelta;
    +
    +    },
    +
    +    /**
    +    * A tween-like function that takes a starting velocity and some other factors and returns an altered velocity.
    +    *
    +    * @method Phaser.Physics.Arcade#computeVelocity
    +    * @param {number} axis - 1 for horizontal, 2 for vertical.
    +    * @param {Phaser.Physics.Arcade.Body} body - The Body object to be updated.
    +    * @param {number} velocity - Any component of velocity (e.g. 20).
    +    * @param {number} acceleration - Rate at which the velocity is changing.
    +    * @param {number} drag - Really kind of a deceleration, this is how much the velocity changes if Acceleration is not set.
    +    * @param {number} mMax - An absolute value cap for the velocity.
    +    * @return {number} The altered Velocity value.
    +    */
    +    computeVelocity: function (axis, body, velocity, acceleration, drag, max) {
    +
    +        max = max || 10000;
    +
    +        if (axis == 1 && body.allowGravity)
    +        {
    +            velocity += this.gravity.x + body.gravity.x;
    +        }
    +        else if (axis == 2 && body.allowGravity)
    +        {
    +            velocity += this.gravity.y + body.gravity.y;
    +        }
    +
    +        if (acceleration !== 0)
    +        {
    +            velocity += acceleration * this.game.time.physicsElapsed;
    +        }
    +        else if (drag !== 0)
    +        {
    +            this._drag = drag * this.game.time.physicsElapsed;
    +
    +            if (velocity - this._drag > 0)
    +            {
    +                velocity -= this._drag;
    +            }
    +            else if (velocity + this._drag < 0)
    +            {
    +                velocity += this._drag;
    +            }
    +            else
    +            {
    +                velocity = 0;
    +            }
    +        }
    +
    +        if (velocity > max)
    +        {
    +            velocity = max;
    +        }
    +        else if (velocity < -max)
    +        {
    +            velocity = -max;
    +        }
    +
    +        return velocity;
    +
    +    },
    +
    +    /**
    +    * Called automatically by the core game loop.
    +    *
    +    * @method Phaser.Physics.Arcade#preUpdate
    +    * @protected
    +    */
    +    preUpdate: function () {
    +
    +        //  Clear the tree
    +        this.quadTree.clear();
    +
    +        //  Create our tree which all of the Physics bodies will add themselves to
    +        this.quadTreeID = 0;
    +        this.quadTree = new Phaser.QuadTree(this, this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels);
    +
    +    },
    +
    +    /**
    +    * Called automatically by the core game loop.
    +    *
    +    * @method Phaser.Physics.Arcade#postUpdate
    +    * @protected
    +    */
    +    postUpdate: function () {
    +
    +        //  Clear the tree ready for the next update
    +        this.quadTree.clear();
    +
    +    },
    +
    +    /**
    +    * Checks if two Sprite objects overlap.
    +    *
    +    * @method Phaser.Physics.Arcade#overlap
    +    * @param {Phaser.Sprite} object1 - The first object to check. Can be an instance of Phaser.Sprite or anything that extends it.
    +    * @param {Phaser.Sprite} object2 - The second object to check. Can be an instance of Phaser.Sprite or anything that extends it.
    +    * @returns {boolean} true if the two objects overlap.
    +    */
    +    overlap: function (object1, object2) {
    +
    +        //  Only test valid objects
    +        if (object1 && object2 && object1.exists && object2.exists)
    +        {
    +            return (Phaser.Rectangle.intersects(object1.body, object2.body));
    +        }
    +
    +        return false;
    +
    +    },
    +
    +    /**
    +    * Checks for collision between two game objects. The objects can be Sprites, Groups, Emitters or Tilemaps.
    +    * You can perform Sprite vs. Sprite, Sprite vs. Group, Group vs. Group, Sprite vs. Tilemap or Group vs. Tilemap collisions.
    +    * The objects are also automatically separated.
    +    *
    +    * @method Phaser.Physics.Arcade#collide
    +    * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.Tilemap} object1 - The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.Tilemap
    +    * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.Tilemap} object2 - The second object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.Tilemap
    +    * @param {function} [collideCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you passed them to Collision.overlap.
    +    * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collideCallback will only be called if processCallback returns true.
    +    * @param {object} [callbackContext] - The context in which to run the callbacks.
    +    * @returns {number} The number of collisions that were processed.
    +    */
    +    collide: function (object1, object2, collideCallback, processCallback, callbackContext) {
    +
    +        collideCallback = collideCallback || null;
    +        processCallback = processCallback || null;
    +        callbackContext = callbackContext || collideCallback;
    +
    +        this._result = false;
    +        this._total = 0;
    +
    +        //  Only collide valid objects
    +        if (object1 && object2 && object1.exists && object2.exists)
    +        {
    +            //  Can expand to support Buttons, Text, etc at a later date. For now these are the essentials.
    +
    +            //  SPRITES
    +            if (object1.type == Phaser.SPRITE)
    +            {
    +                if (object2.type == Phaser.SPRITE)
    +                {
    +                    this.collideSpriteVsSprite(object1, object2, collideCallback, processCallback, callbackContext);
    +                }
    +                else if (object2.type == Phaser.GROUP || object2.type == Phaser.EMITTER)
    +                {
    +                    this.collideSpriteVsGroup(object1, object2, collideCallback, processCallback, callbackContext);
    +                }
    +                else if (object2.type == Phaser.TILEMAPLAYER)
    +                {
    +                    this.collideSpriteVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext);
    +                }
    +            }
    +            //  GROUPS
    +            else if (object1.type == Phaser.GROUP)
    +            {
    +                if (object2.type == Phaser.SPRITE)
    +                {
    +                    this.collideSpriteVsGroup(object2, object1, collideCallback, processCallback, callbackContext);
    +                }
    +                else if (object2.type == Phaser.GROUP || object2.type == Phaser.EMITTER)
    +                {
    +                    this.collideGroupVsGroup(object1, object2, collideCallback, processCallback, callbackContext);
    +                }
    +                else if (object2.type == Phaser.TILEMAPLAYER)
    +                {
    +                    this.collideGroupVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext);
    +                }
    +            }
    +            //  TILEMAP LAYERS
    +            else if (object1.type == Phaser.TILEMAPLAYER)
    +            {
    +                if (object2.type == Phaser.SPRITE)
    +                {
    +                    this.collideSpriteVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext);
    +                }
    +                else if (object2.type == Phaser.GROUP || object2.type == Phaser.EMITTER)
    +                {
    +                    this.collideGroupVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext);
    +                }
    +            }
    +            //  EMITTER
    +            else if (object1.type == Phaser.EMITTER)
    +            {
    +                if (object2.type == Phaser.SPRITE)
    +                {
    +                    this.collideSpriteVsGroup(object2, object1, collideCallback, processCallback, callbackContext);
    +                }
    +                else if (object2.type == Phaser.GROUP || object2.type == Phaser.EMITTER)
    +                {
    +                    this.collideGroupVsGroup(object1, object2, collideCallback, processCallback, callbackContext);
    +                }
    +                else if (object2.type == Phaser.TILEMAPLAYER)
    +                {
    +                    this.collideGroupVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext);
    +                }
    +            }
    +        }
    +
    +        return (this._total > 0);
    +
    +    },
    +
    +    /**
    +    * An internal function. Use Phaser.Physics.Arcade.collide instead.
    +    *
    +    * @method Phaser.Physics.Arcade#collideSpriteVsTilemapLayer
    +    * @private
    +    */
    +    collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext) {
    +
    +        this._mapData = tilemapLayer.getTiles(sprite.body.x, sprite.body.y, sprite.body.width, sprite.body.height, true);
    +
    +        if (this._mapData.length > 1)
    +        {
    +            for (var i = 1; i < this._mapData.length; i++)
    +            {
    +                this.separateTile(sprite.body, this._mapData[i]);
    +
    +                if (this._result)
    +                {
    +                    //  They collided, is there a custom process callback?
    +                    if (processCallback)
    +                    {
    +                        if (processCallback.call(callbackContext, sprite, this._mapData[i]))
    +                        {
    +                            this._total++;
    +
    +                            if (collideCallback)
    +                            {
    +                                collideCallback.call(callbackContext, sprite, this._mapData[i]);
    +                            }
    +                        }
    +                    }
    +                    else
    +                    {
    +                        this._total++;
    +
    +                        if (collideCallback)
    +                        {
    +                            collideCallback.call(callbackContext, sprite, this._mapData[i]);
    +                        }
    +                    }
    +                }
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * An internal function. Use Phaser.Physics.Arcade.collide instead.
    +    *
    +    * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer
    +    * @private
    +    */
    +    collideGroupVsTilemapLayer: function (group, tilemapLayer, collideCallback, processCallback, callbackContext) {
    +
    +        if (group.length == 0)
    +        {
    +            return;
    +        }
    +
    +        if (group._container.first._iNext)
    +        {
    +            var currentNode = group._container.first._iNext;
    +                
    +            do  
    +            {
    +                if (currentNode.exists)
    +                {
    +                    this.collideSpriteVsTilemapLayer(currentNode, tilemapLayer, collideCallback, processCallback, callbackContext);
    +                }
    +                currentNode = currentNode._iNext;
    +            }
    +            while (currentNode != group._container.last._iNext);
    +        }
    +
    +    },
    +
    +    /**
    +    * An internal function. Use Phaser.Physics.Arcade.collide instead.
    +    *
    +    * @method Phaser.Physics.Arcade#collideSpriteVsSprite
    +    * @private
    +    */
    +    collideSpriteVsSprite: function (sprite1, sprite2, collideCallback, processCallback, callbackContext) {
    +
    +        this.separate(sprite1.body, sprite2.body);
    +
    +        if (this._result)
    +        {
    +            //  They collided, is there a custom process callback?
    +            if (processCallback)
    +            {
    +                if (processCallback.call(callbackContext, sprite1, sprite2))
    +                {
    +                    this._total++;
    +
    +                    if (collideCallback)
    +                    {
    +                        collideCallback.call(callbackContext, sprite1, sprite2);
    +                    }
    +                }
    +            }
    +            else
    +            {
    +                this._total++;
    +
    +                if (collideCallback)
    +                {
    +                    collideCallback.call(callbackContext, sprite1, sprite2);
    +                }
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * An internal function. Use Phaser.Physics.Arcade.collide instead.
    +    *
    +    * @method Phaser.Physics.Arcade#collideSpriteVsGroup
    +    * @private
    +    */
    +    collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext) {
    +
    +        if (group.length == 0)
    +        {
    +            return;
    +        }
    +
    +        //  What is the sprite colliding with in the quadtree?
    +        this._potentials = this.quadTree.retrieve(sprite);
    +
    +        for (var i = 0, len = this._potentials.length; i < len; i++)
    +        {
    +            //  We have our potential suspects, are they in this group?
    +            if (this._potentials[i].sprite.group == group)
    +            {
    +                this.separate(sprite.body, this._potentials[i]);
    +
    +                if (this._result && processCallback)
    +                {
    +                    this._result = processCallback.call(callbackContext, sprite, this._potentials[i].sprite);
    +                }
    +
    +                if (this._result)
    +                {
    +                    this._total++;
    +
    +                    if (collideCallback)
    +                    {
    +                        collideCallback.call(callbackContext, sprite, this._potentials[i].sprite);
    +                    }
    +                }
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * An internal function. Use Phaser.Physics.Arcade.collide instead.
    +    *
    +    * @method Phaser.Physics.Arcade#collideGroupVsGroup
    +    * @private
    +    */
    +    collideGroupVsGroup: function (group1, group2, collideCallback, processCallback, callbackContext) {
    +
    +        if (group1.length == 0 || group2.length == 0)
    +        {
    +            return;
    +        }
    +
    +        if (group1._container.first._iNext)
    +        {
    +            var currentNode = group1._container.first._iNext;
    +                
    +            do  
    +            {
    +                if (currentNode.exists)
    +                {
    +                    this.collideSpriteVsGroup(currentNode, group2, collideCallback, processCallback, callbackContext);
    +                }
    +                currentNode = currentNode._iNext;
    +            }
    +            while (currentNode != group1._container.last._iNext);
    +        }
    +
    +    },
    +
    +    /**
    +    * The core separation function to separate two physics bodies.
    +    * @method Phaser.Physics.Arcade#separate
    +    * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate.
    +    * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate.
    +    * @returns {boolean} Returns true if the bodies were separated, otherwise false.
    +    */
    +    separate: function (body1, body2) {
    +
    +        this._result = (this.separateX(body1, body2) || this.separateY(body1, body2));
    +
    +    },
    +
    +    /**
    +    * The core separation function to separate two physics bodies on the x axis.
    +    * @method Phaser.Physics.Arcade#separateX
    +    * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate.
    +    * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate.
    +    * @returns {boolean} Returns true if the bodies were separated, otherwise false.
    +    */
    +    separateX: function (body1, body2) {
    +
    +        //  Can't separate two immovable bodies
    +        if (body1.immovable && body2.immovable)
    +        {
    +            return false;
    +        }
    +
    +        this._overlap = 0;
    +
    +        //  Check if the hulls actually overlap
    +        if (Phaser.Rectangle.intersects(body1, body2))
    +        {
    +            this._maxOverlap = body1.deltaAbsX() + body2.deltaAbsX() + this.OVERLAP_BIAS;
    +
    +            if (body1.deltaX() == 0 && body2.deltaX() == 0)
    +            {
    +                //  They overlap but neither of them are moving
    +                body1.embedded = true;
    +                body2.embedded = true;
    +            }
    +            else if (body1.deltaX() > body2.deltaX())
    +            {
    +                //  Body1 is moving right and/or Body2 is moving left
    +                this._overlap = body1.x + body1.width - body2.x;
    +
    +                if ((this._overlap > this._maxOverlap) || body1.allowCollision.right == false || body2.allowCollision.left == false)
    +                {
    +                    this._overlap = 0;
    +                }
    +                else
    +                {
    +                    body1.touching.right = true;
    +                    body2.touching.left = true;
    +                }
    +            }
    +            else if (body1.deltaX() < body2.deltaX())
    +            {
    +                //  Body1 is moving left and/or Body2 is moving right
    +                this._overlap = body1.x - body2.width - body2.x;
    +
    +                if ((-this._overlap > this._maxOverlap) || body1.allowCollision.left == false || body2.allowCollision.right == false)
    +                {
    +                    this._overlap = 0;
    +                }
    +                else
    +                {
    +                    body1.touching.left = true;
    +                    body2.touching.right = true;
    +                }
    +            }
    +
    +            //  Then adjust their positions and velocities accordingly (if there was any overlap)
    +            if (this._overlap != 0)
    +            {
    +                body1.overlapX = this._overlap;
    +                body2.overlapX = this._overlap;
    +
    +                if (body1.customSeparateX || body2.customSeparateX)
    +                {
    +                    return true;
    +                }
    +
    +                this._velocity1 = body1.velocity.x;
    +                this._velocity2 = body2.velocity.x;
    +
    +                if (!body1.immovable && !body2.immovable)
    +                {
    +                    this._overlap *= 0.5;
    +
    +                    body1.x = body1.x - this._overlap;
    +                    body2.x += this._overlap;
    +
    +                    this._newVelocity1 = Math.sqrt((this._velocity2 * this._velocity2 * body2.mass) / body1.mass) * ((this._velocity2 > 0) ? 1 : -1);
    +                    this._newVelocity2 = Math.sqrt((this._velocity1 * this._velocity1 * body1.mass) / body2.mass) * ((this._velocity1 > 0) ? 1 : -1);
    +                    this._average = (this._newVelocity1 + this._newVelocity2) * 0.5;
    +                    this._newVelocity1 -= this._average;
    +                    this._newVelocity2 -= this._average;
    +
    +                    body1.velocity.x = this._average + this._newVelocity1 * body1.bounce.x;
    +                    body2.velocity.x = this._average + this._newVelocity2 * body2.bounce.x;
    +                }
    +                else if (!body1.immovable)
    +                {
    +                    body1.x = body1.x - this._overlap;
    +                    body1.velocity.x = this._velocity2 - this._velocity1 * body1.bounce.x;
    +                }
    +                else if (!body2.immovable)
    +                {
    +                    body2.x += this._overlap;
    +                    body2.velocity.x = this._velocity1 - this._velocity2 * body2.bounce.x;
    +                }
    +
    +                return true;
    +            }
    +        }
    +
    +        return false;
    +
    +    },
    +
    +    /**
    +    * The core separation function to separate two physics bodies on the y axis.
    +    * @method Phaser.Physics.Arcade#separateY
    +    * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate.
    +    * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate.
    +    * @returns {boolean} Returns true if the bodies were separated, otherwise false.
    +    */
    +    separateY: function (body1, body2) {
    +
    +        //  Can't separate two immovable or non-existing bodys
    +        if (body1.immovable && body2.immovable)
    +        {
    +            return false;
    +        }
    +
    +        this._overlap = 0;
    +
    +        //  Check if the hulls actually overlap
    +        if (Phaser.Rectangle.intersects(body1, body2))
    +        {
    +            this._maxOverlap = body1.deltaAbsY() + body2.deltaAbsY() + this.OVERLAP_BIAS;
    +
    +            if (body1.deltaY() == 0 && body2.deltaY() == 0)
    +            {
    +                //  They overlap but neither of them are moving
    +                body1.embedded = true;
    +                body2.embedded = true;
    +            }
    +            else if (body1.deltaY() > body2.deltaY())
    +            {
    +                //  Body1 is moving down and/or Body2 is moving up
    +                this._overlap = body1.y + body1.height - body2.y;
    +
    +                if ((this._overlap > this._maxOverlap) || body1.allowCollision.down == false || body2.allowCollision.up == false)
    +                {
    +                    this._overlap = 0;
    +                }
    +                else
    +                {
    +                    body1.touching.down = true;
    +                    body2.touching.up = true;
    +                }
    +            }
    +            else if (body1.deltaY() < body2.deltaY())
    +            {
    +                //  Body1 is moving up and/or Body2 is moving down
    +                this._overlap = body1.y - body2.height - body2.y;
    +
    +                if ((-this._overlap > this._maxOverlap) || body1.allowCollision.up == false || body2.allowCollision.down == false)
    +                {
    +                    this._overlap = 0;
    +                }
    +                else
    +                {
    +                    body1.touching.up = true;
    +                    body2.touching.down = true;
    +                }
    +            }
    +
    +            //  Then adjust their positions and velocities accordingly (if there was any overlap)
    +            if (this._overlap != 0)
    +            {
    +                body1.overlapY = this._overlap;
    +                body2.overlapY = this._overlap;
    +
    +                if (body1.customSeparateY || body2.customSeparateY)
    +                {
    +                    return true;
    +                }
    +
    +                this._velocity1 = body1.velocity.y;
    +                this._velocity2 = body2.velocity.y;
    +
    +                if (!body1.immovable && !body2.immovable)
    +                {
    +                    this._overlap *= 0.5;
    +
    +                    body1.y = body1.y - this._overlap;
    +                    body2.y += this._overlap;
    +
    +                    this._newVelocity1 = Math.sqrt((this._velocity2 * this._velocity2 * body2.mass) / body1.mass) * ((this._velocity2 > 0) ? 1 : -1);
    +                    this._newVelocity2 = Math.sqrt((this._velocity1 * this._velocity1 * body1.mass) / body2.mass) * ((this._velocity1 > 0) ? 1 : -1);
    +                    this._average = (this._newVelocity1 + this._newVelocity2) * 0.5;
    +                    this._newVelocity1 -= this._average;
    +                    this._newVelocity2 -= this._average;
    +
    +                    body1.velocity.y = this._average + this._newVelocity1 * body1.bounce.y;
    +                    body2.velocity.y = this._average + this._newVelocity2 * body2.bounce.y;
    +                }
    +                else if (!body1.immovable)
    +                {
    +                    body1.y = body1.y - this._overlap;
    +                    body1.velocity.y = this._velocity2 - this._velocity1 * body1.bounce.y;
    +
    +                    //  This is special case code that handles things like horizontal moving platforms you can ride
    +                    if (body2.active && body2.moves && (body1.deltaY() > body2.deltaY()))
    +                    {
    +                        body1.x += body2.x - body2.lastX;
    +                    }
    +                }
    +                else if (!body2.immovable)
    +                {
    +                    body2.y += this._overlap;
    +                    body2.velocity.y = this._velocity1 - this._velocity2 * body2.bounce.y;
    +
    +                    //  This is special case code that handles things like horizontal moving platforms you can ride
    +                    if (body1.sprite.active && body1.moves && (body1.deltaY() < body2.deltaY()))
    +                    {
    +                        body2.x += body1.x - body1.lastX;
    +                    }
    +                }
    +
    +                return true;
    +            }
    +
    +        }
    +
    +        return false;
    +
    +    },
    +
    +    /**
    +    * The core separation function to separate a physics body and a tile.
    +    * @method Phaser.Physics.Arcade#separateTile
    +    * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate.
    +    * @param {Phaser.Tile} tile - The tile to collide against.
    +    * @returns {boolean} Returns true if the bodies were separated, otherwise false.
    +    */
    +    separateTile: function (body, tile) {
    +
    +        this._result = (this.separateTileX(body, tile, true) || this.separateTileY(body, tile, true));
    +
    +    },
    +
    +    /**
    +    * The core separation function to separate a physics body and a tile on the x axis.
    +    * @method Phaser.Physics.Arcade#separateTileX
    +    * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate.
    +    * @param {Phaser.Tile} tile - The tile to collide against.
    +    * @returns {boolean} Returns true if the bodies were separated, otherwise false.
    +    */
    +    separateTileX: function (body, tile, separate) {
    +
    +        //  Can't separate two immovable objects (tiles are always immovable)
    +        if (body.immovable || body.deltaX() == 0 || Phaser.Rectangle.intersects(body.hullX, tile) == false)
    +        {
    +            return false;
    +        }
    +
    +        this._overlap = 0;
    +
    +        //  The hulls overlap, let's process it
    +        this._maxOverlap = body.deltaAbsX() + this.OVERLAP_BIAS;
    +
    +        if (body.deltaX() < 0)
    +        {
    +            //  Moving left
    +            this._overlap = tile.right - body.hullX.x;
    +
    +            if ((this._overlap > this._maxOverlap) || body.allowCollision.left == false || tile.tile.collideRight == false)
    +            {
    +                this._overlap = 0;
    +            }
    +            else
    +            {
    +                body.touching.left = true;
    +            }
    +        }
    +        else
    +        {
    +            //  Moving right
    +            this._overlap = body.hullX.right - tile.x;
    +
    +            if ((this._overlap > this._maxOverlap) || body.allowCollision.right == false || tile.tile.collideLeft == false)
    +            {
    +                this._overlap = 0;
    +            }
    +            else
    +            {
    +                body.touching.right = true;
    +            }
    +        }
    +
    +        //  Then adjust their positions and velocities accordingly (if there was any overlap)
    +        if (this._overlap != 0)
    +        {
    +            if (separate)
    +            {
    +                if (body.deltaX() < 0)
    +                {
    +                    body.x = body.x + this._overlap;
    +                }
    +                else
    +                {
    +                    body.x = body.x - this._overlap;
    +                }
    +
    +                if (body.bounce.x == 0)
    +                {
    +                    body.velocity.x = 0;
    +                }
    +                else
    +                {
    +                    body.velocity.x = -body.velocity.x * body.bounce.x;
    +                }
    +
    +                body.updateHulls();
    +            }
    +
    +            return true;
    +        }
    +        else
    +        {
    +            return false;
    +        }
    +
    +    },
    +
    +    /**
    +    * The core separation function to separate a physics body and a tile on the x axis.
    +    * @method Phaser.Physics.Arcade#separateTileY
    +    * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate.
    +    * @param {Phaser.Tile} tile - The tile to collide against.
    +    * @returns {boolean} Returns true if the bodies were separated, otherwise false.
    +    */
    +    separateTileY: function (body, tile, separate) {
    +
    +        //  Can't separate two immovable objects (tiles are always immovable)
    +        if (body.immovable || body.deltaY() == 0 || Phaser.Rectangle.intersects(body.hullY, tile) == false)
    +        {
    +            return false;
    +        }
    +
    +        this._overlap = 0;
    +
    +        //  The hulls overlap, let's process it
    +        this._maxOverlap = body.deltaAbsY() + this.OVERLAP_BIAS;
    +
    +        if (body.deltaY() < 0)
    +        {
    +            //  Moving up
    +            this._overlap = tile.bottom - body.hullY.y;
    +
    +            if ((this._overlap > this._maxOverlap) || body.allowCollision.up == false || tile.tile.collideDown == false)
    +            {
    +                this._overlap = 0;
    +            }
    +            else
    +            {
    +                body.touching.up = true;
    +            }
    +        }
    +        else
    +        {
    +            //  Moving down
    +            this._overlap = body.hullY.bottom - tile.y;
    +
    +            if ((this._overlap > this._maxOverlap) || body.allowCollision.down == false || tile.tile.collideUp == false)
    +            {
    +                this._overlap = 0;
    +            }
    +            else
    +            {
    +                body.touching.down = true;
    +            }
    +        }
    +
    +        //  Then adjust their positions and velocities accordingly (if there was any overlap)
    +        if (this._overlap != 0)
    +        {
    +            if (separate)
    +            {
    +                if (body.deltaY() < 0)
    +                {
    +                    body.y = body.y + this._overlap;
    +                }
    +                else
    +                {
    +                    body.y = body.y - this._overlap;
    +                }
    +
    +                if (body.bounce.y == 0)
    +                {
    +                    body.velocity.y = 0;
    +                }
    +                else
    +                {
    +                    body.velocity.y = -body.velocity.y * body.bounce.y;
    +                }
    +
    +                body.updateHulls();
    +            }
    +            
    +            return true;
    +        }
    +        else
    +        {
    +            return false;
    +        }
    +
    +    },
    +
    +    /**
    +    * Move the given display object towards the destination object at a steady velocity.
    +    * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.
    +    * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.
    +    * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
    +    * Note: The display object doesn't stop moving once it reaches the destination coordinates.
    +    * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)
    +    * 
    +    * @method Phaser.Physics.Arcade#moveToObject
    +    * @param {any} displayObject - The display object to move.
    +    * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties.
    +    * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec)
    +    * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.
    +    * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity.
    +    */
    +    moveToObject: function (displayObject, destination, speed, maxTime) {
    +
    +        speed = speed || 60;
    +        maxTime = maxTime || 0;
    +
    +        this._angle = Math.atan2(destination.y - displayObject.y, destination.x - displayObject.x);
    +        
    +        if (maxTime > 0)
    +        {
    +            //  We know how many pixels we need to move, but how fast?
    +            speed = this.distanceBetween(displayObject, destination) / (maxTime / 1000);
    +        }
    +        
    +        displayObject.body.velocity.x = Math.cos(this._angle) * speed;
    +        displayObject.body.velocity.y = Math.sin(this._angle) * speed;
    +
    +        return this._angle;
    +
    +    },
    +
    +    /**
    +    * Move the given display object towards the pointer at a steady velocity. If no pointer is given it will use Phaser.Input.activePointer.
    +    * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.
    +    * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.
    +    * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
    +    * Note: The display object doesn't stop moving once it reaches the destination coordinates.
    +    * 
    +    * @method Phaser.Physics.Arcade#moveToPointer
    +    * @param {any} displayObject - The display object to move.
    +    * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec)
    +    * @param {Phaser.Pointer} [pointer] - The pointer to move towards. Defaults to Phaser.Input.activePointer.
    +    * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.
    +    * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity.
    +    */
    +    moveToPointer: function (displayObject, speed, pointer, maxTime) {
    +
    +        speed = speed || 60;
    +        pointer = pointer || this.game.input.activePointer;
    +        maxTime = maxTime || 0;
    +
    +        this._angle = this.angleToPointer(displayObject, pointer);
    +        
    +        if (maxTime > 0)
    +        {
    +            //  We know how many pixels we need to move, but how fast?
    +            speed = this.distanceToPointer(displayObject, pointer) / (maxTime / 1000);
    +        }
    +        
    +        displayObject.body.velocity.x = Math.cos(this._angle) * speed;
    +        displayObject.body.velocity.y = Math.sin(this._angle) * speed;
    +
    +        return this._angle;
    +
    +    },
    +
    +    /**
    +    * Move the given display object towards the x/y coordinates at a steady velocity.
    +    * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds.
    +    * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms.
    +    * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
    +    * Note: The display object doesn't stop moving once it reaches the destination coordinates.
    +    * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)
    +    * 
    +    * @method Phaser.Physics.Arcade#moveToXY
    +    * @param {any} displayObject - The display object to move.
    +    * @param {number} x - The x coordinate to move towards.
    +    * @param {number} y - The y coordinate to move towards.
    +    * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec)
    +    * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.
    +    * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity.
    +    */
    +    moveToXY: function (displayObject, x, y, speed, maxTime) {
    +
    +        speed = speed || 60;
    +        maxTime = maxTime || 0;
    +
    +        this._angle = Math.atan2(y - displayObject.y, x - displayObject.x);
    +        
    +        if (maxTime > 0)
    +        {
    +            //  We know how many pixels we need to move, but how fast?
    +            speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000);
    +        }
    +        
    +        displayObject.body.velocity.x = Math.cos(this._angle) * speed;
    +        displayObject.body.velocity.y = Math.sin(this._angle) * speed;
    +
    +        return this._angle;
    +
    +    },
    +
    +    /**
    +    * Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object.
    +    * One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.
    +    * 
    +    * @method Phaser.Physics.Arcade#velocityFromAngle
    +    * @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative)
    +    * @param {number} [speed=60] - The speed it will move, in pixels per second sq.
    +    * @param {Phaser.Point|object} [point] - The Point object in which the x and y properties will be set to the calculated velocity.
    +    * @return {Phaser.Point} - A Point where point.x contains the velocity x value and point.y contains the velocity y value.
    +    */
    +    velocityFromAngle: function (angle, speed, point) {
    +
    +        speed = speed || 60;
    +        point = point || new Phaser.Point;
    +
    +        return point.setTo((Math.cos(this.game.math.degToRad(angle)) * speed), (Math.sin(this.game.math.degToRad(angle)) * speed));
    +
    +    },
    +
    +    /**
    +    * Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object.
    +    * One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.
    +    * 
    +    * @method Phaser.Physics.Arcade#velocityFromRotation
    +    * @param {number} rotation - The angle in radians.
    +    * @param {number} [speed=60] - The speed it will move, in pixels per second sq.
    +    * @param {Phaser.Point|object} [point] - The Point object in which the x and y properties will be set to the calculated velocity.
    +    * @return {Phaser.Point} - A Point where point.x contains the velocity x value and point.y contains the velocity y value.
    +    */
    +    velocityFromRotation: function (rotation, speed, point) {
    +
    +        speed = speed || 60;
    +        point = point || new Phaser.Point;
    +
    +        return point.setTo((Math.cos(rotation) * speed), (Math.sin(rotation) * speed));
    +
    +    },
    +
    +    /**
    +    * Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object.
    +    * One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.
    +    * 
    +    * @method Phaser.Physics.Arcade#accelerationFromRotation
    +    * @param {number} rotation - The angle in radians.
    +    * @param {number} [speed=60] - The speed it will move, in pixels per second sq.
    +    * @param {Phaser.Point|object} [point] - The Point object in which the x and y properties will be set to the calculated acceleration.
    +    * @return {Phaser.Point} - A Point where point.x contains the acceleration x value and point.y contains the acceleration y value.
    +    */
    +    accelerationFromRotation: function (rotation, speed, point) {
    +
    +        speed = speed || 60;
    +        point = point || new Phaser.Point;
    +
    +        return point.setTo((Math.cos(rotation) * speed), (Math.sin(rotation) * speed));
    +
    +    },
    +
    +    /**
    +    * Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.)
    +    * You must give a maximum speed value, beyond which the display object won't go any faster.
    +    * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
    +    * Note: The display object doesn't stop moving once it reaches the destination coordinates.
    +    * 
    +    * @method Phaser.Physics.Arcade#accelerateToObject
    +    * @param {any} displayObject - The display object to move.
    +    * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties.
    +    * @param {number} [speed=60] - The speed it will accelerate in pixels per second.
    +    * @param {number} [xSpeedMax=500] - The maximum x velocity the display object can reach.
    +    * @param {number} [ySpeedMax=500] - The maximum y velocity the display object can reach.
    +    * @return {number} The angle (in radians) that the object should be visually set to in order to match its new trajectory.
    +    */
    +    accelerateToObject: function (displayObject, destination, speed, xSpeedMax, ySpeedMax) {
    +
    +        if (typeof speed === 'undefined') { speed = 60; }
    +        if (typeof xSpeedMax === 'undefined') { xSpeedMax = 1000; }
    +        if (typeof ySpeedMax === 'undefined') { ySpeedMax = 1000; }
    +
    +        this._angle = this.angleBetween(displayObject, destination);
    +
    +        displayObject.body.acceleration.setTo(Math.cos(this._angle) * speed, Math.sin(this._angle) * speed);
    +        displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax);
    +
    +        return this._angle;
    +
    +    },
    +
    +    /**
    +    * Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.)
    +    * You must give a maximum speed value, beyond which the display object won't go any faster.
    +    * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
    +    * Note: The display object doesn't stop moving once it reaches the destination coordinates.
    +    * 
    +    * @method Phaser.Physics.Arcade#accelerateToPointer
    +    * @param {any} displayObject - The display object to move.
    +    * @param {Phaser.Pointer} [pointer] - The pointer to move towards. Defaults to Phaser.Input.activePointer.
    +    * @param {number} [speed=60] - The speed it will accelerate in pixels per second.
    +    * @param {number} [xSpeedMax=500] - The maximum x velocity the display object can reach.
    +    * @param {number} [ySpeedMax=500] - The maximum y velocity the display object can reach.
    +    * @return {number} The angle (in radians) that the object should be visually set to in order to match its new trajectory.
    +    */
    +    accelerateToPointer: function (displayObject, pointer, speed, xSpeedMax, ySpeedMax) {
    +
    +        if (typeof speed === 'undefined') { speed = 60; }
    +        if (typeof pointer === 'undefined') { pointer = this.game.input.activePointer; }
    +        if (typeof xSpeedMax === 'undefined') { xSpeedMax = 1000; }
    +        if (typeof ySpeedMax === 'undefined') { ySpeedMax = 1000; }
    +
    +        this._angle = this.angleToPointer(displayObject, pointer);
    +        
    +        displayObject.body.acceleration.setTo(Math.cos(this._angle) * speed, Math.sin(this._angle) * speed);
    +        displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax);
    +
    +        return this._angle;
    +
    +    },
    +
    +    /**
    +    * Sets the acceleration.x/y property on the display object so it will move towards the x/y coordinates at the given speed (in pixels per second sq.)
    +    * You must give a maximum speed value, beyond which the display object won't go any faster.
    +    * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course.
    +    * Note: The display object doesn't stop moving once it reaches the destination coordinates.
    +    * 
    +    * @method Phaser.Physics.Arcade#accelerateToXY
    +    * @param {any} displayObject - The display object to move.
    +    * @param {number} x - The x coordinate to accelerate towards.
    +    * @param {number} y - The y coordinate to accelerate towards.
    +    * @param {number} [speed=60] - The speed it will accelerate in pixels per second.
    +    * @param {number} [xSpeedMax=500] - The maximum x velocity the display object can reach.
    +    * @param {number} [ySpeedMax=500] - The maximum y velocity the display object can reach.
    +    * @return {number} The angle (in radians) that the object should be visually set to in order to match its new trajectory.
    +    */
    +    accelerateToXY: function (displayObject, x, y, speed, xSpeedMax, ySpeedMax) {
    +
    +        if (typeof speed === 'undefined') { speed = 60; }
    +        if (typeof xSpeedMax === 'undefined') { xSpeedMax = 1000; }
    +        if (typeof ySpeedMax === 'undefined') { ySpeedMax = 1000; }
    +
    +        this._angle = this.angleToXY(displayObject, x, y);
    +
    +        displayObject.body.acceleration.setTo(Math.cos(this._angle) * speed, Math.sin(this._angle) * speed);
    +        displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax);
    +
    +        return this._angle;
    +
    +    },
    +
    +    /**
    +    * Find the distance between two display objects (like Sprites).
    +    * 
    +    * @method Phaser.Physics.Arcade#distanceBetween
    +    * @param {any} source - The Display Object to test from.
    +    * @param {any} target - The Display Object to test to.
    +    * @return {number} The distance between the source and target objects.
    +    */
    +    distanceBetween: function (source, target) {
    +
    +        this._dx = source.x - target.x;
    +        this._dy = source.y - target.y;
    +        
    +        return Math.sqrt(this._dx * this._dx + this._dy * this._dy);
    +
    +    },
    +
    +    /**
    +    * Find the distance between a display object (like a Sprite) and the given x/y coordinates.
    +    * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed.
    +    * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters()
    +    * 
    +    * @method Phaser.Physics.Arcade#distanceToXY
    +    * @param {any} displayObject - The Display Object to test from.
    +    * @param {number} x - The x coordinate to move towards.
    +    * @param {number} y - The y coordinate to move towards.
    +    * @return {number} The distance between the object and the x/y coordinates.
    +    */
    +    distanceToXY: function (displayObject, x, y) {
    +
    +        this._dx = displayObject.x - x;
    +        this._dy = displayObject.y - y;
    +        
    +        return Math.sqrt(this._dx * this._dx + this._dy * this._dy);
    +
    +    },
    +
    +    /**
    +    * Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used.
    +    * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed.
    +    * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters()
    +    * 
    +    * @method Phaser.Physics.Arcade#distanceToPointer
    +    * @param {any} displayObject - The Display Object to test from.
    +    * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used.
    +    * @return {number} The distance between the object and the Pointer.
    +    */
    +    distanceToPointer: function (displayObject, pointer) {
    +
    +        pointer = pointer || this.game.input.activePointer;
    +
    +        this._dx = displayObject.worldX - pointer.x;
    +        this._dy = displayObject.worldY - pointer.y;
    +        
    +        return Math.sqrt(this._dx * this._dx + this._dy * this._dy);
    +
    +    },
    +
    +    /**
    +    * Find the angle in radians between two display objects (like Sprites).
    +    * 
    +    * @method Phaser.Physics.Arcade#angleBetween
    +    * @param {any} source - The Display Object to test from.
    +    * @param {any} target - The Display Object to test to.
    +    * @return {number} The angle in radians between the source and target display objects.
    +    */
    +    angleBetween: function (source, target) {
    +
    +        this._dx = target.x - source.x;
    +        this._dy = target.y - source.y;
    +
    +        return Math.atan2(this._dy, this._dx);
    +
    +    },
    +
    +    /**
    +    * Find the angle in radians between a display object (like a Sprite) and the given x/y coordinate.
    +    * 
    +    * @method Phaser.Physics.Arcade#angleToXY
    +    * @param {any} displayObject - The Display Object to test from.
    +    * @param {number} x - The x coordinate to get the angle to.
    +    * @param {number} y - The y coordinate to get the angle to.
    +    * @return {number} The angle in radians between displayObject.x/y to Pointer.x/y
    +    */
    +    angleToXY: function (displayObject, x, y) {
    +
    +        this._dx = x - displayObject.x;
    +        this._dy = y - displayObject.y;
    +        
    +        return Math.atan2(this._dy, this._dx);
    +
    +    },
    +    
    +    /**
    +    * Find the angle in radians between a display object (like a Sprite) and a Pointer, taking their x/y and center into account.
    +    * 
    +    * @method Phaser.Physics.Arcade#angleToPointer
    +    * @param {any} displayObject - The Display Object to test from.
    +    * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used.
    +    * @return {number} The angle in radians between displayObject.x/y to Pointer.x/y
    +    */
    +    angleToPointer: function (displayObject, pointer) {
    +
    +        pointer = pointer || this.game.input.activePointer;
    +
    +        this._dx = pointer.worldX - displayObject.x;
    +        this._dy = pointer.worldY - displayObject.y;
    +        
    +        return Math.atan2(this._dy, this._dx);
    +
    +    }
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/BitmapText.js.html b/docs/BitmapText.js.html new file mode 100644 index 00000000..7c793fa8 --- /dev/null +++ b/docs/BitmapText.js.html @@ -0,0 +1,731 @@ + + + + + + Phaser Source: gameobjects/BitmapText.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/BitmapText.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}
    +*/
    +
    +/**
    +* Creates a new <code>BitmapText</code>.
    +* @class Phaser.BitmapText
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +* @param {number} x - X position of the new bitmapText object.
    +* @param {number} y - Y position of the new bitmapText object.
    +* @param {string} text - The actual text that will be written.
    +* @param {object} style - The style object containing style attributes like font, font size , etc.
    +*/
    +Phaser.BitmapText = function (game, x, y, text, style) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +
    +    text = text || '';
    +    style = style || '';
    +
    +	/** 
    +	* @property {boolean} exists - If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all.
    +	* @default
    +	*/
    +    this.exists = true;
    +
    +	/**
    +    * @property {boolean} alive - This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering.
    +	* @default
    +	*/
    +    this.alive = true;
    +
    +	/**
    +    * @property {Description} group - Description.
    + 	* @default
    + 	*/
    +    this.group = null;
    +
    +	/**
    +    * @property {string} name - Description.
    +  	* @default
    +  	*/
    +    this.name = '';
    +
    +    /**
    +    * @property {Phaser.Game} game - A reference to the currently running Game.
    +    */
    +    this.game = game;
    +
    +    PIXI.BitmapText.call(this, text, style);
    +
    +    /**
    +    * @property {Description} type - Description.
    +    */
    +    this.type = Phaser.BITMAPTEXT;
    +
    +	/**
    +	* @property {number} position.x - Description.
    +	*/
    +    this.position.x = x;
    +    
    +	/**
    +	* @property {number} position.y - Description.
    +	*/
    +    this.position.y = y;
    +
    +    //  Replaces the PIXI.Point with a slightly more flexible one
    +	/**
    +	* @property {Phaser.Point} anchor - Description.
    +	*/
    +    this.anchor = new Phaser.Point();
    +    
    +	/**
    +	* @property {Phaser.Point} scale - Description.
    +	*/
    +    this.scale = new Phaser.Point(1, 1);
    +
    +    //  A mini cache for storing all of the calculated values
    +	/**
    +	* @property {function} _cache - Description.
    +	* @private
    +	*/
    +    this._cache = { 
    +
    +        dirty: false,
    +
    +        //  Transform cache
    +        a00: 1, a01: 0, a02: x, a10: 0, a11: 1, a12: y, id: 1, 
    +
    +        //  The previous calculated position
    +        x: -1, y: -1,
    +
    +        //  The actual scale values based on the worldTransform
    +        scaleX: 1, scaleY: 1
    +
    +    };
    +
    +    this._cache.x = this.x;
    +    this._cache.y = this.y;
    +
    +	/**
    +	* @property {boolean} renderable - Description.
    +	* @private
    +	*/
    +    this.renderable = true;
    +
    +};
    +
    +Phaser.BitmapText.prototype = Object.create(PIXI.BitmapText.prototype);
    +// Phaser.BitmapText.prototype = Phaser.Utils.extend(true, PIXI.BitmapText.prototype);
    +Phaser.BitmapText.prototype.constructor = Phaser.BitmapText;
    +
    +/**
    +* Automatically called by World.update
    +* @method Phaser.BitmapText.prototype.update
    +*/
    +Phaser.BitmapText.prototype.update = function() {
    +
    +    if (!this.exists)
    +    {
    +        return;
    +    }
    +
    +    this._cache.dirty = false;
    +
    +    this._cache.x = this.x;
    +    this._cache.y = this.y;
    +
    +    if (this.position.x != this._cache.x || this.position.y != this._cache.y)
    +    {
    +        this.position.x = this._cache.x;
    +        this.position.y = this._cache.y;
    +        this._cache.dirty = true;
    +    }
    +
    +    this.pivot.x = this.anchor.x*this.width;
    +    this.pivot.y = this.anchor.y*this.height;
    +
    +}
    +
    +/**
    +* @method Phaser.Text.prototype.destroy
    +*/
    +Phaser.BitmapText.prototype.destroy = function() {
    +
    +    if (this.group)
    +    {
    +        this.group.remove(this);
    +    }
    +
    +    if (this.canvas.parentNode)
    +    {
    +        this.canvas.parentNode.removeChild(this.canvas);
    +    }
    +    else
    +    {
    +        this.canvas = null;
    +        this.context = null;
    +    }
    +
    +    this.exists = false;
    +
    +    this.group = null;
    +
    +}
    +
    +/**
    +* Get
    +* @returns {Description}
    +*//**
    +* Set
    +* @param {Description} value - Description
    +*/
    +Object.defineProperty(Phaser.BitmapText.prototype, 'angle', {
    +
    +    get: function() {
    +        return Phaser.Math.radToDeg(this.rotation);
    +    },
    +
    +    set: function(value) {
    +        this.rotation = Phaser.Math.degToRad(value);
    +    }
    +
    +});
    +
    +/**
    +* Get
    +* @returns {Description}
    +*//**
    +* Set
    +* @param {Description} value - Description
    +*/
    +Object.defineProperty(Phaser.BitmapText.prototype, 'x', {
    +
    +    get: function() {
    +        return this.position.x;
    +    },
    +
    +    set: function(value) {
    +        this.position.x = value;
    +    }
    +
    +});
    +
    +/**
    +* Get
    +* @returns {Description}
    +*//**
    +* Set
    +* @param {Description} value - Description
    +*/
    +Object.defineProperty(Phaser.BitmapText.prototype, 'y', {
    +
    +    get: function() {
    +        return this.position.y;
    +    },
    +
    +    set: function(value) {
    +        this.position.y = value;
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Body.js.html b/docs/Body.js.html new file mode 100644 index 00000000..00d0cb23 --- /dev/null +++ b/docs/Body.js.html @@ -0,0 +1,840 @@ + + + + + + Phaser Source: physics/arcade/Body.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: physics/arcade/Body.js

    + +
    +
    +
    Phaser.Physics.Arcade.Body = function (sprite) {
    +
    +	this.sprite = sprite;
    +	this.game = sprite.game;
    +
    +	this.offset = new Phaser.Point;
    +
    +	this.x = sprite.x;
    +	this.y = sprite.y;
    +	this.preX = sprite.x;
    +	this.preY = sprite.y;
    +	this.preRotation = sprite.angle;
    +	this.screenX = sprite.x;
    +	this.screenY = sprite.y;
    +
    +	//	un-scaled original size
    +	this.sourceWidth = sprite.currentFrame.sourceSizeW;
    +	this.sourceHeight = sprite.currentFrame.sourceSizeH;
    +
    +	//	calculated (scaled) size
    +	this.width = sprite.currentFrame.sourceSizeW;
    +	this.height = sprite.currentFrame.sourceSizeH;
    +	this.halfWidth = Math.floor(sprite.currentFrame.sourceSizeW / 2);
    +	this.halfHeight = Math.floor(sprite.currentFrame.sourceSizeH / 2);
    +
    +	//	Scale value cache
    +	this._sx = sprite.scale.x;
    +	this._sy = sprite.scale.y;
    +
    +    this.velocity = new Phaser.Point;
    +    this.acceleration = new Phaser.Point;
    +    this.drag = new Phaser.Point;
    +    this.gravity = new Phaser.Point;
    +    this.bounce = new Phaser.Point;
    +    this.maxVelocity = new Phaser.Point(10000, 10000);
    +
    +    this.angularVelocity = 0;
    +    this.angularAcceleration = 0;
    +    this.angularDrag = 0;
    +    this.maxAngular = 1000;
    +    this.mass = 1;
    +
    +    this.skipQuadTree = false;
    +    this.quadTreeIDs = [];
    +    this.quadTreeIndex = -1;
    +
    +    //	Allow collision
    +    this.allowCollision = { none: false, any: true, up: true, down: true, left: true, right: true };
    +    this.touching = { none: true, up: false, down: false, left: false, right: false };
    +    this.wasTouching = { none: true, up: false, down: false, left: false, right: false };
    +    this.facing = Phaser.NONE;
    +
    +    this.immovable = false;
    +    this.moves = true;
    +    this.rotation = 0;
    +    this.allowRotation = true;
    +    this.allowGravity = true;
    +
    +    //	These two flags allow you to disable the custom separation that takes place
    +    //	Used in combination with your own collision processHandler you can create whatever
    +    //	type of collision response you need.
    +    this.customSeparateX = false;
    +    this.customSeparateY = false;
    +
    +    //	When this body collides with another the amount of overlap is stored in here
    +    //	These values are useful if you want to provide your own custom separation logic.
    +    this.overlapX = 0;
    +    this.overlapY = 0;
    +
    +    this.hullX = new Phaser.Rectangle();
    +    this.hullY = new Phaser.Rectangle();
    +
    +    //	If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true
    +    this.embedded = false;
    +
    +    this.collideWorldBounds = false;
    +
    +};
    +
    +Phaser.Physics.Arcade.Body.prototype = {
    +
    +	updateBounds: function (centerX, centerY, scaleX, scaleY) {
    +
    +		if (scaleX != this._sx || scaleY != this._sy)
    +		{
    +			this.width = this.sourceWidth * scaleX;
    +			this.height = this.sourceHeight * scaleY;
    +			this.halfWidth = Math.floor(this.width / 2);
    +			this.halfHeight = Math.floor(this.height / 2);
    +			this._sx = scaleX;
    +			this._sy = scaleY;
    +		}
    +
    +	},
    +
    +	preUpdate: function () {
    +
    +		//	Store and reset collision flags
    +	    this.wasTouching.none = this.touching.none;
    +	    this.wasTouching.up = this.touching.up;
    +	    this.wasTouching.down = this.touching.down;
    +	    this.wasTouching.left = this.touching.left;
    +	    this.wasTouching.right = this.touching.right;
    +
    +	    this.touching.none = true;
    +	    this.touching.up = false;
    +	    this.touching.down = false;
    +	    this.touching.left = false;
    +	    this.touching.right = false;
    +
    +	    this.embedded = false;
    +
    +		this.screenX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
    +		this.screenY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
    +
    +		this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
    +		this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
    +
    +		this.preRotation = this.sprite.angle;
    +
    +		this.x = this.preX;
    +		this.y = this.preY;
    +		this.rotation = this.preRotation;
    +
    +		if (this.moves)
    +		{
    +			this.game.physics.updateMotion(this);
    +
    +			if (this.collideWorldBounds)
    +			{
    +				this.checkWorldBounds();
    +			}
    +
    +			this.updateHulls();
    +		}
    +
    +		if (this.skipQuadTree == false && this.allowCollision.none == false && this.sprite.visible && this.sprite.alive)
    +		{
    +		    this.quadTreeIDs = [];
    +		    this.quadTreeIndex = -1;
    +			this.game.physics.quadTree.insert(this);
    +		}
    +
    +	},
    +
    +	postUpdate: function () {
    +
    +		//	Calculate forward-facing edge
    +		if (this.deltaX() == 0 && this.deltaY() == 0)
    +		{
    +			//	Can't work it out from the Body, how about from x position?
    +			if (this.sprite.deltaX() == 0 && this.sprite.deltaY() == 0)
    +			{
    +				//	still as a statue
    +			}
    +		}
    +
    +		if (this.deltaX() < 0)
    +		{
    +			this.facing = Phaser.LEFT;
    +		}
    +		else if (this.deltaX() > 0)
    +		{
    +			this.facing = Phaser.RIGHT;
    +		}
    +
    +		if (this.deltaY() < 0)
    +		{
    +			this.facing = Phaser.UP;
    +		}
    +		else if (this.deltaY() > 0)
    +		{
    +			this.facing = Phaser.DOWN;
    +		}
    +
    +		this.sprite.x += this.deltaX();
    +		this.sprite.y += this.deltaY();
    +
    +		if (this.allowRotation)
    +		{
    +			this.sprite.angle += this.deltaZ();
    +		}
    +
    +	},
    +
    +	updateHulls: function () {
    +
    +		this.hullX.setTo(this.x, this.preY, this.width, this.height);
    +		this.hullY.setTo(this.preX, this.y, this.width, this.height);
    +
    +	},
    +
    +	checkWorldBounds: function () {
    +
    +		if (this.x < this.game.world.bounds.x)
    +		{
    +			this.x = this.game.world.bounds.x;
    +			this.velocity.x *= -this.bounce.x;
    +		}
    +		else if (this.right > this.game.world.bounds.right)
    +		{
    +			this.x = this.game.world.bounds.right - this.width;
    +			this.velocity.x *= -this.bounce.x;
    +		}
    +
    +		if (this.y < this.game.world.bounds.y)
    +		{
    +			this.y = this.game.world.bounds.y;
    +			this.velocity.y *= -this.bounce.y;
    +		}
    +		else if (this.bottom > this.game.world.bounds.bottom)
    +		{
    +			this.y = this.game.world.bounds.bottom - this.height;
    +			this.velocity.y *= -this.bounce.y;
    +		}
    +
    +	},
    +
    +	setSize: function (width, height, offsetX, offsetY) {
    +
    +		offsetX = offsetX || this.offset.x;
    +		offsetY = offsetY || this.offset.y;
    +
    +		this.sourceWidth = width;
    +		this.sourceHeight = height;
    +		this.width = this.sourceWidth * this._sx;
    +		this.height = this.sourceHeight * this._sy;
    +		this.halfWidth = Math.floor(this.width / 2);
    +		this.halfHeight = Math.floor(this.height / 2);
    +		this.offset.setTo(offsetX, offsetY);
    +
    +	},
    +
    +	reset: function () {
    +
    +		this.velocity.setTo(0, 0);
    +		this.acceleration.setTo(0, 0);
    +
    +	    this.angularVelocity = 0;
    +	    this.angularAcceleration = 0;
    +		this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
    +		this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
    +		this.preRotation = this.sprite.angle;
    +
    +		this.x = this.preX;
    +		this.y = this.preY;
    +		this.rotation = this.preRotation;
    +
    +	},
    +
    +    deltaAbsX: function () {
    +        return (this.deltaX() > 0 ? this.deltaX() : -this.deltaX());
    +    },
    +
    +    deltaAbsY: function () {
    +        return (this.deltaY() > 0 ? this.deltaY() : -this.deltaY());
    +    },
    +
    +    deltaX: function () {
    +        return this.x - this.preX;
    +    },
    +
    +    deltaY: function () {
    +        return this.y - this.preY;
    +    },
    +
    +    deltaZ: function () {
    +        return this.rotation - this.preRotation;
    +    }
    +
    +};
    +
    +Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", {
    +    
    +    /**
    +    * The sum of the y and height properties. Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property.
    +    * @method bottom
    +    * @return {number}
    +    **/
    +    get: function () {
    +        return this.y + this.height;
    +    },
    +
    +    /**
    +    * The sum of the y and height properties. Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property.
    +    * @method bottom
    +    * @param {number} value
    +    **/    
    +    set: function (value) {
    +
    +        if (value <= this.y)
    +        {
    +            this.height = 0;
    +        }
    +        else
    +        {
    +            this.height = (this.y - value);
    +        }
    +        
    +    }
    +
    +});
    +
    +Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", {
    +    
    +    /**
    +    * The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties.
    +    * However it does affect the width property.
    +    * @method right
    +    * @return {number}
    +    **/    
    +    get: function () {
    +        return this.x + this.width;
    +    },
    +
    +    /**
    +    * The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties.
    +    * However it does affect the width property.
    +    * @method right
    +    * @param {number} value
    +    **/
    +    set: function (value) {
    +
    +        if (value <= this.x)
    +        {
    +            this.width = 0;
    +        }
    +        else
    +        {
    +            this.width = this.x + value;
    +        }
    +
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Bullet.js.html b/docs/Bullet.js.html new file mode 100644 index 00000000..7d551922 --- /dev/null +++ b/docs/Bullet.js.html @@ -0,0 +1,1128 @@ + + + + + + Phaser Source: gameobjects/Bullet.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/Bullet.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}
    +*/
    +
    +/**
    +* Warning: Bullet is an experimental object that we don't advise using for now.
    +*
    +* A Bullet is like a stripped-down Sprite, useful for when you just need to get something moving around the screen quickly with little of the extra
    +* features that a Sprite supports.
    +* Bullet is MISSING the following:
    +*
    +* animation, all input events, crop support, health/damage, loadTexture
    +*
    +* @class Phaser.Bullet
    +* @constructor
    +* @param {Phaser.Game} game - Current game instance.
    +* @param {number} x - X position of the new bullet.
    +* @param {number} y - Y position of the new bullet.
    +* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
    +*/
    +Phaser.Bullet = function (game, x, y, key, frame) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +    key = key || null;
    +    frame = frame || null;
    +    
    +    /**
    +	* @property {Phaser.Game} game - A reference to the currently running Game.
    +	*/
    +	this.game = game;
    + 
    +	/**
    +	* @property {boolean} exists - If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all.
    +	* @default
    +	*/
    +    this.exists = true;
    +
    +	/**
    +    * @property {boolean} alive - This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering.
    +   	* @default
    +   	*/
    +    this.alive = true;
    +
    +	/**
    +    * @property {Description} group - Description.
    +   	* @default
    +   	*/
    +    this.group = null;
    +
    +    /**
    +     * @property {string} name - The user defined name given to this Sprite.
    +     * @default
    +     */
    +    this.name = '';
    +
    +    /**
    +	* @property {Description} type - Description.
    +	*/
    +    this.type = Phaser.BULLET;
    +
    +    /**
    +	* @property {number} renderOrderID - Description.
    +	* @default
    +	*/
    +    this.renderOrderID = -1;
    +
    +    /**
    +    * If you would like the Sprite to have a lifespan once 'born' you can set this to a positive value. Handy for particles, bullets, etc.
    +	* The lifespan is decremented by game.time.elapsed each update, once it reaches zero the kill() function is called.
    +	* @property {number} lifespan
    +	* @default
    +	*/    
    +    this.lifespan = 0;
    +
    +    /**
    +    * @property {Events} events - The Signals you can subscribe to that are dispatched when certain things happen on this Sprite or its components
    +    */
    +    this.events = new Phaser.Events(this);
    +
    +    /**
    +    *  @property {Description} key - Description.
    +    */
    +    this.key = key;
    +
    +    if (key instanceof Phaser.RenderTexture)
    +    {
    +        PIXI.Sprite.call(this, key);
    +
    +        this.currentFrame = this.game.cache.getTextureFrame(key.name);
    +    }
    +    else if (key instanceof PIXI.Texture)
    +    {
    +        PIXI.Sprite.call(this, key);
    +
    +        this.currentFrame = frame;
    +    }
    +    else
    +    {
    +        if (key == null || this.game.cache.checkImageKey(key) == false)
    +        {
    +            key = '__default';
    +        }
    +
    +        PIXI.Sprite.call(this, PIXI.TextureCache[key]);
    +
    +        if (this.game.cache.isSpriteSheet(key))
    +        {
    +        	/*
    +            this.animations.loadFrameData(this.game.cache.getFrameData(key));
    +
    +            if (frame !== null)
    +            {
    +                if (typeof frame === 'string')
    +                {
    +                    this.frameName = frame;
    +                }
    +                else
    +                {
    +                    this.frame = frame;
    +                }
    +            }
    +            */
    +        }
    +        else
    +        {
    +            this.currentFrame = this.game.cache.getFrame(key);
    +        }
    +    }
    +
    +    /**
    +    * The anchor sets the origin point of the texture.
    +    * The default is 0,0 this means the textures origin is the top left 
    +    * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +    * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +    *
    +    * @property {Phaser.Point} anchor
    +    */
    +    this.anchor = new Phaser.Point();
    +
    +    /**
    +    * @property {number} x - Description.
    +    */
    +    this.x = x;
    +    
    +    /**
    +    * @property {number} y - Description.
    +    */
    +    this.y = y;
    +
    +    /**
    +    * @property {Description} position - Description.
    +    */
    +	this.position.x = x;
    +	this.position.y = y;
    +
    +    /**
    +    * Should this Sprite be automatically culled if out of range of the camera?
    +    * A culled sprite has its visible property set to 'false'.
    +    * Note that this check doesn't look at this Sprites children, which may still be in camera range.
    +    * So you should set autoCull to false if the Sprite will have children likely to still be in camera range.
    +    *
    +    * @property {boolean} autoCull
    +    * @default
    +    */
    +    this.autoCull = false;
    +
    +    /**
    +    * @property {Phaser.Point} scale - Replaces the PIXI.Point with a slightly more flexible one.
    +    */ 
    +    this.scale = new Phaser.Point(1, 1);
    +
    +    /**
    +    * @property {Phaser.Point} _cache - A mini cache for storing all of the calculated values.
    +    * @private
    +    */
    +    this._cache = { 
    +
    +        dirty: false,
    +
    +        //  Transform cache
    +        a00: -1, a01: -1, a02: -1, a10: -1, a11: -1, a12: -1, id: -1, 
    +
    +        //  Input specific transform cache
    +        i01: -1, i10: -1, idi: -1,
    +
    +        //  Bounds check
    +        left: null, right: null, top: null, bottom: null, 
    +
    +        //  The previous calculated position
    +        x: -1, y: -1,
    +
    +        //  The actual scale values based on the worldTransform
    +        scaleX: 1, scaleY: 1,
    +
    +        //  The width/height of the image, based on the un-modified frame size multiplied by the final calculated scale size
    +        width: this.currentFrame.sourceSizeW, height: this.currentFrame.sourceSizeH,
    +
    +        //  The actual width/height of the image if from a trimmed atlas, multiplied by the final calculated scale size
    +        halfWidth: Math.floor(this.currentFrame.sourceSizeW / 2), halfHeight: Math.floor(this.currentFrame.sourceSizeH / 2),
    +
    +        boundsX: 0, boundsY: 0,
    +
    +        //  If this sprite visible to the camera (regardless of being set to visible or not)
    +        cameraVisible: true
    +
    +    };
    +  
    +    /**
    +    * @property {Phaser.Point} offset - Corner point defaults.
    +    */    
    +    this.offset = new Phaser.Point;
    +    
    +    /**
    +    * @property {Phaser.Point} center - Description.
    +    */
    +    this.center = new Phaser.Point(x + Math.floor(this._cache.width / 2), y + Math.floor(this._cache.height / 2));
    +   
    +    /**
    +    * @property {Phaser.Point} topLeft - Description.
    +    */
    +    this.topLeft = new Phaser.Point(x, y);
    +    
    +    /**
    +    * @property {Phaser.Point} topRight - Description.
    +    */
    +    this.topRight = new Phaser.Point(x + this._cache.width, y);
    +    
    +    /**
    +    * @property {Phaser.Point} bottomRight - Description.
    +    */
    +    this.bottomRight = new Phaser.Point(x + this._cache.width, y + this._cache.height);
    +    
    +    /**
    +    * @property {Phaser.Point} bottomLeft - Description.
    +    */
    +    this.bottomLeft = new Phaser.Point(x, y + this._cache.height);
    +    
    +    /**
    +    * @property {Phaser.Rectangle} bounds - Description.
    +    */
    +    this.bounds = new Phaser.Rectangle(x, y, this._cache.width, this._cache.height);
    +
    +    /**
    +    * @property {Phaser.Physics.Arcade.Body} body - Set-up the physics body.
    +    */
    +    this.body = new Phaser.Physics.Arcade.Body(this);
    +
    +    /**
    +    * @property {Description} inWorld - World bounds check.
    +    */
    +    this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds);
    +    
    +    /**
    +    * @property {number} inWorldThreshold - World bounds check.
    +    * @default
    +    */
    +    this.inWorldThreshold = 0;
    +
    +    /**
    +    * @property {boolean} outOfBoundsKill - Kills this sprite as soon as it goes outside of the World bounds.
    +    * @default
    +    */
    +    this.outOfBoundsKill = false;
    +    
    +    /**
    +    * @property {boolean} _outOfBoundsFired - Description.
    +    * @private
    +    * @default
    +    */
    +    this._outOfBoundsFired = false;
    +
    +    /**
    +    * A Sprite that is fixed to the camera ignores the position of any ancestors in the display list and uses its x/y coordinates as offsets from the top left of the camera.
    +    * @property {boolean} fixedToCamera - Fixes this Sprite to the Camera.
    +    * @default
    +    */
    +    this.fixedToCamera = false;
    +
    +};
    +
    +Phaser.Bullet.prototype = Object.create(PIXI.Sprite.prototype);
    +Phaser.Bullet.prototype.constructor = Phaser.Bullet;
    +
    +/**
    +* Automatically called by World.preUpdate. You can create your own update in Objects that extend Phaser.Sprite.
    +* @method Phaser.Sprite.prototype.preUpdate
    +*/
    +Phaser.Bullet.prototype.preUpdate = function() {
    +
    +    if (!this.exists)
    +    {
    +        this.renderOrderID = -1;
    +        return;
    +    }
    +
    +    if (this.lifespan > 0)
    +    {
    +        this.lifespan -= this.game.time.elapsed;
    +
    +        if (this.lifespan <= 0)
    +        {
    +            this.kill();
    +            return;
    +        }
    +    }
    +
    +    this._cache.dirty = false;
    +
    +    if (this.visible)
    +    {
    +        this.renderOrderID = this.game.world.currentRenderOrderID++;
    +    }
    +
    +    this.prevX = this.x;
    +    this.prevY = this.y;
    +
    +    //  |a c tx|
    +    //  |b d ty|
    +    //  |0 0  1|
    +
    +    if (this.worldTransform[1] != this._cache.i01 || this.worldTransform[3] != this._cache.i10)
    +    {
    +        this._cache.a00 = this.worldTransform[0];  //  scaleX         a
    +        this._cache.a01 = this.worldTransform[1];  //  skewY          c
    +        this._cache.a10 = this.worldTransform[3];  //  skewX          b
    +        this._cache.a11 = this.worldTransform[4];  //  scaleY         d
    +
    +        this._cache.i01 = this.worldTransform[1];  //  skewY          c (remains non-modified for input checks)
    +        this._cache.i10 = this.worldTransform[3];  //  skewX          b (remains non-modified for input checks)
    +
    +        this._cache.scaleX = Math.sqrt((this._cache.a00 * this._cache.a00) + (this._cache.a01 * this._cache.a01)); // round this off a bit?
    +        this._cache.scaleY = Math.sqrt((this._cache.a10 * this._cache.a10) + (this._cache.a11 * this._cache.a11)); // round this off a bit?
    +
    +        this._cache.a01 *= -1;
    +        this._cache.a10 *= -1;
    +
    +        this._cache.dirty = true;
    +    }
    +
    +    if (this.worldTransform[2] != this._cache.a02 || this.worldTransform[5] != this._cache.a12)
    +    {
    +        this._cache.a02 = this.worldTransform[2];  //  translateX     tx
    +        this._cache.a12 = this.worldTransform[5];  //  translateY     ty
    +        this._cache.dirty = true;
    +    }
    +
    +    //  Re-run the camera visibility check
    +    if (this._cache.dirty)
    +    {
    +        this._cache.cameraVisible = Phaser.Rectangle.intersects(this.game.world.camera.screenView, this.bounds, 0);
    +
    +        if (this.autoCull == true)
    +        {
    +            //  Won't get rendered but will still get its transform updated
    +            this.renderable = this._cache.cameraVisible;
    +        }
    +
    +        //  Update our physics bounds
    +        if (this.body)
    +        {
    +            this.body.updateBounds(this.center.x, this.center.y, this._cache.scaleX, this._cache.scaleY);
    +        }
    +    }
    +
    +    if (this.body)
    +    {
    +        this.body.preUpdate();
    +    }
    +
    +}
    +
    +Phaser.Bullet.prototype.postUpdate = function() {
    +
    +    if (this.exists)
    +    {
    +        //  The sprite is positioned in this call, after taking into consideration motion updates and collision
    +        if (this.body)
    +        {
    +            this.body.postUpdate();
    +        }
    +
    +        if (this.fixedToCamera)
    +        {
    +            this._cache.x = this.game.camera.view.x + this.x;
    +            this._cache.y = this.game.camera.view.y + this.y;
    +        }
    +        else
    +        {
    +            this._cache.x = this.x;
    +            this._cache.y = this.y;
    +        }
    +
    +        if (this.position.x != this._cache.x || this.position.y != this._cache.y)
    +        {
    +            this.position.x = this._cache.x;
    +            this.position.y = this._cache.y;
    +        }
    +    }
    +
    +}
    +
    +Phaser.Bullet.prototype.deltaAbsX = function () {
    +    return (this.deltaX() > 0 ? this.deltaX() : -this.deltaX());
    +}
    +
    +Phaser.Bullet.prototype.deltaAbsY = function () {
    +    return (this.deltaY() > 0 ? this.deltaY() : -this.deltaY());
    +}
    +
    +Phaser.Bullet.prototype.deltaX = function () {
    +    return this.x - this.prevX;
    +}
    +
    +Phaser.Bullet.prototype.deltaY = function () {
    +    return this.y - this.prevY;
    +}
    +
    +/**
    +* Description.
    +* 
    +* @method Phaser.Bullet.prototype.revive
    +*/
    +Phaser.Bullet.prototype.revive = function(health) {
    +
    +    if (typeof health === 'undefined') { health = 1; }
    +
    +    this.alive = true;
    +    this.exists = true;
    +    this.visible = true;
    +    this.health = health;
    +
    +    this.events.onRevived.dispatch(this);
    +
    +}
    +
    +/**
    +* Description.
    +* 
    +* @method Phaser.Bullet.prototype.kill
    +*/
    +Phaser.Bullet.prototype.kill = function() {
    +
    +    this.alive = false;
    +    this.exists = false;
    +    this.visible = false;
    +    this.events.onKilled.dispatch(this);
    +
    +}
    +
    +/**
    +* Description.
    +* 
    +* @method Phaser.Bullet.prototype.destroy
    +*/
    +Phaser.Bullet.prototype.destroy = function() {
    +
    +    if (this.group)
    +    {
    +        this.group.remove(this);
    +    }
    +
    +    this.events.destroy();
    +
    +    this.alive = false;
    +    this.exists = false;
    +    this.visible = false;
    +
    +    this.game = null;
    +
    +}
    +
    +/**
    +* Description.
    +* 
    +* @method Phaser.Sprite.prototype.reset
    +*/
    +Phaser.Bullet.prototype.reset = function(x, y) {
    +
    +    this.x = x;
    +    this.y = y;
    +    this.position.x = this.x;
    +    this.position.y = this.y;
    +    this.alive = true;
    +    this.exists = true;
    +    this.visible = true;
    +    this.renderable = true;
    +    this._outOfBoundsFired = false;
    +
    +    if (this.body)
    +    {
    +        this.body.reset();
    +    }
    +    
    +}
    +
    +/**
    +* Description.
    +*   
    +* @method Phaser.Sprite.prototype.updateBounds
    +*/
    +Phaser.Bullet.prototype.updateBounds = function() {
    +
    +    //  Update the edge points
    +
    +    this.offset.setTo(this._cache.a02 - (this.anchor.x * this._cache.width), this._cache.a12 - (this.anchor.y * this._cache.height));
    +
    +    this.getLocalPosition(this.center, this.offset.x + this._cache.halfWidth, this.offset.y + this._cache.halfHeight);
    +    this.getLocalPosition(this.topLeft, this.offset.x, this.offset.y);
    +    this.getLocalPosition(this.topRight, this.offset.x + this._cache.width, this.offset.y);
    +    this.getLocalPosition(this.bottomLeft, this.offset.x, this.offset.y + this._cache.height);
    +    this.getLocalPosition(this.bottomRight, this.offset.x + this._cache.width, this.offset.y + this._cache.height);
    +
    +    this._cache.left = Phaser.Math.min(this.topLeft.x, this.topRight.x, this.bottomLeft.x, this.bottomRight.x);
    +    this._cache.right = Phaser.Math.max(this.topLeft.x, this.topRight.x, this.bottomLeft.x, this.bottomRight.x);
    +    this._cache.top = Phaser.Math.min(this.topLeft.y, this.topRight.y, this.bottomLeft.y, this.bottomRight.y);
    +    this._cache.bottom = Phaser.Math.max(this.topLeft.y, this.topRight.y, this.bottomLeft.y, this.bottomRight.y);
    +
    +    this.bounds.setTo(this._cache.left, this._cache.top, this._cache.right - this._cache.left, this._cache.bottom - this._cache.top);
    +
    +    //  This is the coordinate the Bullet was at when the last bounds was created
    +    this._cache.boundsX = this._cache.x;
    +    this._cache.boundsY = this._cache.y;
    +
    +    if (this.inWorld == false)
    +    {
    +        //  Bullet WAS out of the screen, is it still?
    +        this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds, this.inWorldThreshold);
    +
    +        if (this.inWorld)
    +        {
    +            //  It's back again, reset the OOB check
    +            this._outOfBoundsFired = false;
    +        }
    +    }
    +    else
    +    {
    +        //   Bullet WAS in the screen, has it now left?
    +        this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds, this.inWorldThreshold);
    +
    +        if (this.inWorld == false)
    +        {
    +            this.events.onOutOfBounds.dispatch(this);
    +            this._outOfBoundsFired = true;
    +
    +            if (this.outOfBoundsKill)
    +            {
    +                this.kill();
    +            }
    +        }
    +    }
    +
    +}
    +
    +/**
    +* Description.
    +* 
    +* @method Phaser.Bullet.prototype.getLocalPosition
    +* @param {Description} p - Description.
    +* @param {number} x - Description.
    +* @param {number} y - Description.
    +* @return {Description} Description.
    +*/
    +Phaser.Bullet.prototype.getLocalPosition = function(p, x, y) {
    +
    +    p.x = ((this._cache.a11 * this._cache.id * x + -this._cache.a01 * this._cache.id * y + (this._cache.a12 * this._cache.a01 - this._cache.a02 * this._cache.a11) * this._cache.id) * this._cache.scaleX) + this._cache.a02;
    +    p.y = ((this._cache.a00 * this._cache.id * y + -this._cache.a10 * this._cache.id * x + (-this._cache.a12 * this._cache.a00 + this._cache.a02 * this._cache.a10) * this._cache.id) * this._cache.scaleY) + this._cache.a12;
    +
    +    return p;
    +
    +}
    +
    +/**
    +* Description.
    +* 
    +* @method Phaser.Bullet.prototype.bringToTop
    +*/
    +Phaser.Bullet.prototype.bringToTop = function() {
    +
    +    if (this.group)
    +    {
    +        this.group.bringToTop(this);
    +    }
    +    else
    +    {
    +        this.game.world.bringToTop(this);
    +    }
    +
    +}
    +
    +/**
    +* Indicates the rotation of the Bullet, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
    +* Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90.
    +* If you wish to work in radians instead of degrees use the property Bullet.rotation instead.
    +* @name Phaser.Bullet#angle
    +* @property {number} angle - Gets or sets the Bullets angle of rotation in degrees.
    +*/
    +Object.defineProperty(Phaser.Bullet.prototype, 'angle', {
    +
    +    get: function() {
    +        return Phaser.Math.wrapAngle(Phaser.Math.radToDeg(this.rotation));
    +    },
    +
    +    set: function(value) {
    +        this.rotation = Phaser.Math.degToRad(Phaser.Math.wrapAngle(value));
    +    }
    +
    +});
    +
    +/**
    +* Is this sprite visible to the camera or not?
    +* @returns {boolean}
    +*/
    +Object.defineProperty(Phaser.Bullet.prototype, "inCamera", {
    +    
    +    get: function () {
    +        return this._cache.cameraVisible;
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Button.js.html b/docs/Button.js.html new file mode 100644 index 00000000..5e9d198d --- /dev/null +++ b/docs/Button.js.html @@ -0,0 +1,825 @@ + + + + + + Phaser Source: gameobjects/Button.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/Button.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}
    +*/
    +
    +
    +/**
    +* Create a new <code>Button</code> object.
    +* @class Phaser.Button
    +* @constructor
    +*
    +* @param {Phaser.Game} game Current game instance.
    +* @param {number} [x] X position of the button.
    +* @param {number} [y] Y position of the button.
    +* @param {string} [key] The image key as defined in the Game.Cache to use as the texture for this button.
    +* @param {function} [callback] The function to call when this button is pressed
    +* @param {object} [callbackContext] The context in which the callback will be called (usually 'this')
    +* @param {string|number} [overFrame] This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.
    +* @param {string|number} [outFrame] This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.
    +* @param {string|number} [downFrame] This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
    +*/
    +Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +    key = key || null;
    +    callback = callback || null;
    +    callbackContext = callbackContext || this;
    +
    +	Phaser.Sprite.call(this, game, x, y, key, outFrame);
    +
    +	/** 
    +	* @property {Description} type - Description.
    +	*/
    +    this.type = Phaser.BUTTON;
    +
    +	/** 
    +	* @property {Description} _onOverFrameName - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._onOverFrameName = null;
    +    
    +	/** 
    +	* @property {Description} _onOutFrameName - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._onOutFrameName = null;
    +    
    +	/** 
    +	* @property {Description} _onDownFrameName - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._onDownFrameName = null;
    +    
    +	/** 
    +	* @property {Description} _onUpFrameName - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._onUpFrameName = null;
    +    
    +	/** 
    +	* @property {Description} _onOverFrameID - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._onOverFrameID = null;
    +    
    +	/** 
    +	* @property {Description} _onOutFrameID - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._onOutFrameID = null;
    +    
    +	/** 
    +	* @property {Description} _onDownFrameID - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._onDownFrameID = null;
    +    
    +	/** 
    +	* @property {Description} _onUpFrameID - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._onUpFrameID = null;
    +
    +    //  These are the signals the game will subscribe to
    +	/** 
    +	* @property {Phaser.Signal} onInputOver - Description.
    +	*/
    +    this.onInputOver = new Phaser.Signal;
    +    
    +	/** 
    +	* @property {Phaser.Signal} onInputOut - Description.
    +	*/
    +    this.onInputOut = new Phaser.Signal;
    +    
    +	/** 
    +	* @property {Phaser.Signal} onInputDown - Description.
    +	*/
    +    this.onInputDown = new Phaser.Signal;
    +    
    +	/** 
    +	* @property {Phaser.Signal} onInputUp - Description.
    +	*/
    +    this.onInputUp = new Phaser.Signal;
    +
    +    this.setFrames(overFrame, outFrame, downFrame);
    +
    +    if (callback !== null)
    +    {
    +        this.onInputUp.add(callback, callbackContext);
    +    }
    +
    +    this.freezeFrames = false;
    +
    +    this.input.start(0, true);
    +
    +    //  Redirect the input events to here so we can handle animation updates, etc
    +    this.events.onInputOver.add(this.onInputOverHandler, this);
    +    this.events.onInputOut.add(this.onInputOutHandler, this);
    +    this.events.onInputDown.add(this.onInputDownHandler, this);
    +    this.events.onInputUp.add(this.onInputUpHandler, this);
    +
    +};
    +
    +Phaser.Button.prototype = Phaser.Utils.extend(true, Phaser.Sprite.prototype, PIXI.Sprite.prototype);
    +Phaser.Button.prototype.constructor = Phaser.Button;
    +
    +/**
    +* Used to manually set the frames that will be used for the different states of the button
    +* exactly like setting them in the constructor.
    +*
    +* @method Phaser.Button.prototype.setFrames
    +* @param {string|number} [overFrame] - This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.
    +* @param {string|number} [outFrame] - This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.
    +* @param {string|number} [downFrame] - This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
    +*/
    +Phaser.Button.prototype.setFrames = function (overFrame, outFrame, downFrame) {
    +
    +    if (overFrame !== null)
    +    {
    +        if (typeof overFrame === 'string')
    +        {
    +            this._onOverFrameName = overFrame;
    +            
    +            if (this.input.pointerOver())
    +            {
    +                this.frameName = overFrame;
    +            }
    +        }
    +        else
    +        {
    +            this._onOverFrameID = overFrame;
    +
    +            if (this.input.pointerOver())
    +            {
    +                this.frame = overFrame;
    +            }
    +        }
    +    }
    +
    +    if (outFrame !== null)
    +    {
    +        if (typeof outFrame === 'string')
    +        {
    +            this._onOutFrameName = outFrame;
    +            this._onUpFrameName = outFrame;
    +
    +            if (this.input.pointerOver() == false)
    +            {
    +                this.frameName = outFrame;
    +            }
    +        }
    +        else
    +        {
    +            this._onOutFrameID = outFrame;
    +            this._onUpFrameID = outFrame;
    +
    +            if (this.input.pointerOver() == false)
    +            {
    +                this.frame = outFrame;
    +            }
    +        }
    +    }
    +
    +    if (downFrame !== null)
    +    {
    +        if (typeof downFrame === 'string')
    +        {
    +            this._onDownFrameName = downFrame;
    +
    +            if (this.input.pointerOver())
    +            {
    +                this.frameName = downFrame;
    +            }
    +        }
    +        else
    +        {
    +            this._onDownFrameID = downFrame;
    +
    +            if (this.input.pointerOver())
    +            {
    +                this.frame = downFrame;
    +            }
    +        }
    +    }
    +
    +};
    +
    +/**
    +* Description.
    +*
    +* @method Phaser.Button.prototype.onInputOverHandler
    +* @param {Description} pointer - Description.
    +*/
    +Phaser.Button.prototype.onInputOverHandler = function (pointer) {
    +
    +    if (this.freezeFrames == false)
    +    {
    +        if (this._onOverFrameName != null)
    +        {
    +            this.frameName = this._onOverFrameName;
    +        }
    +        else if (this._onOverFrameID != null)
    +        {
    +            this.frame = this._onOverFrameID;
    +        }
    +    }
    +
    +    if (this.onInputOver)
    +    {
    +        this.onInputOver.dispatch(this, pointer);
    +    }
    +};
    +
    +/**
    +* Description.
    +*
    +* @method Phaser.Button.prototype.onInputOutHandler
    +* @param {Description} pointer - Description.
    +*/
    +Phaser.Button.prototype.onInputOutHandler = function (pointer) {
    +
    +    if (this.freezeFrames == false)
    +    {
    +        if (this._onOutFrameName != null)
    +        {
    +            this.frameName = this._onOutFrameName;
    +        }
    +        else if (this._onOutFrameID != null)
    +        {
    +            this.frame = this._onOutFrameID;
    +        }
    +    }
    +
    +    if (this.onInputOut)
    +    {
    +        this.onInputOut.dispatch(this, pointer);
    +    }
    +};
    +
    +/**
    +* Description.
    +*
    +* @method Phaser.Button.prototype.onInputDownHandler
    +* @param {Description} pointer - Description.
    +*/
    +Phaser.Button.prototype.onInputDownHandler = function (pointer) {
    +
    +    if (this.freezeFrames == false)
    +    {
    +        if (this._onDownFrameName != null)
    +        {
    +            this.frameName = this._onDownFrameName;
    +        }
    +        else if (this._onDownFrameID != null)
    +        {
    +            this.frame = this._onDownFrameID;
    +        }
    +    }
    +
    +    if (this.onInputDown)
    +    {
    +        this.onInputDown.dispatch(this, pointer);
    +    }
    +};
    +
    +/**
    +* Description.
    +*
    +* @method Phaser.Button.prototype.onInputUpHandler
    +* @param {Description} pointer - Description.
    +*/
    +Phaser.Button.prototype.onInputUpHandler = function (pointer) {
    +
    +    if (this.freezeFrames == false)
    +    {
    +        if (this._onUpFrameName != null)
    +        {
    +            this.frameName = this._onUpFrameName;
    +        }
    +        else if (this._onUpFrameID != null)
    +        {
    +            this.frame = this._onUpFrameID;
    +        }
    +    }
    +
    +    if (this.onInputUp)
    +    {
    +        this.onInputUp.dispatch(this, pointer);
    +    }
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Cache.js.html b/docs/Cache.js.html index 07ba77c1..a8ea6989 100644 --- a/docs/Cache.js.html +++ b/docs/Cache.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -586,7 +706,8 @@ Phaser.Cache.prototype = { addImage: function (key, url, data) { this._images[key] = { url: url, data: data, spriteSheet: false }; - this._images[key].frame = new Phaser.Frame(0, 0, 0, data.width, data.height, '', ''); + + this._images[key].frame = new Phaser.Frame(0, 0, 0, data.width, data.height, key, this.game.rnd.uuid()); PIXI.BaseTextureCache[key] = new PIXI.BaseTexture(data); PIXI.TextureCache[key] = new PIXI.Texture(PIXI.BaseTextureCache[key]); @@ -1137,8 +1258,8 @@ Phaser.Cache.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Camera.js.html b/docs/Camera.js.html index df9a44e3..dde93b3f 100644 --- a/docs/Camera.js.html +++ b/docs/Camera.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -748,8 +868,8 @@ Object.defineProperty(Phaser.Camera.prototype, "height", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Canvas.js.html b/docs/Canvas.js.html index 8132f1f0..0296461c 100644 --- a/docs/Canvas.js.html +++ b/docs/Canvas.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -597,8 +717,8 @@ Phaser.Canvas = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Circle.js.html b/docs/Circle.js.html index e4a6e022..9546d9a2 100644 --- a/docs/Circle.js.html +++ b/docs/Circle.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -811,8 +931,8 @@ Phaser.Circle.intersectsRectangle = function (c, r) {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Color.js.html b/docs/Color.js.html index 6604f3e7..a8b99a3e 100644 --- a/docs/Color.js.html +++ b/docs/Color.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -668,8 +788,8 @@ Phaser.Color = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Debug.js.html b/docs/Debug.js.html index b6aa73f6..8e5b2487 100644 --- a/docs/Debug.js.html +++ b/docs/Debug.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -523,14 +643,16 @@ Phaser.Utils.Debug.prototype = { showText = showText || false; showBounds = showBounds || false; - color = color || 'rgb(255,0,255)'; + color = color || 'rgb(255,255,255)'; this.start(0, 0, color); if (showBounds) { - this.context.strokeStyle = 'rgba(255,0,255,0.5)'; + this.context.beginPath(); + this.context.strokeStyle = 'rgba(0, 255, 0, 0.7)'; this.context.strokeRect(sprite.bounds.x, sprite.bounds.y, sprite.bounds.width, sprite.bounds.height); + this.context.closePath(); this.context.stroke(); } @@ -540,7 +662,7 @@ Phaser.Utils.Debug.prototype = { this.context.lineTo(sprite.bottomRight.x, sprite.bottomRight.y); this.context.lineTo(sprite.bottomLeft.x, sprite.bottomLeft.y); this.context.closePath(); - this.context.strokeStyle = 'rgba(0,0,255,0.8)'; + this.context.strokeStyle = 'rgba(255, 0, 255, 0.7)'; this.context.stroke(); this.renderPoint(sprite.center); @@ -1211,8 +1333,8 @@ Phaser.Utils.Debug.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Device.js.html b/docs/Device.js.html index 87b2e6e7..39e54b21 100644 --- a/docs/Device.js.html +++ b/docs/Device.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -647,6 +767,16 @@ Phaser.Device.prototype = { this.file = !!window['File'] && !!window['FileReader'] && !!window['FileList'] && !!window['Blob']; this.fileSystem = !!window['requestFileSystem']; this.webGL = ( function () { try { var canvas = document.createElement( 'canvas' ); return !! window.WebGLRenderingContext && ( canvas.getContext( 'webgl' ) || canvas.getContext( 'experimental-webgl' ) ); } catch( e ) { return false; } } )(); + + if (this.webGL === null) + { + this.webGL = false; + } + else + { + this.webGL = true; + } + this.worker = !!window['Worker']; if ('ontouchstart' in document.documentElement || window.navigator.msPointerEnabled) { @@ -874,8 +1004,8 @@ Phaser.Device.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Easing.js.html b/docs/Easing.js.html index d4c4e4b6..bcd7d229 100644 --- a/docs/Easing.js.html +++ b/docs/Easing.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -902,8 +1022,8 @@ Phaser.Easing = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Emitter.js.html b/docs/Emitter.js.html index 27495dba..79a282b7 100644 --- a/docs/Emitter.js.html +++ b/docs/Emitter.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1016,8 +1136,8 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Events.js.html b/docs/Events.js.html new file mode 100644 index 00000000..f6d0fa93 --- /dev/null +++ b/docs/Events.js.html @@ -0,0 +1,572 @@ + + + + + + Phaser Source: gameobjects/Events.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/Events.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 Events component is a collection of events fired by the parent game object and its components.
    +* 
    +* @class Phaser.Events
    +* @constructor
    +*
    +* @param {Phaser.Sprite} sprite - A reference to Description.
    +*/
    +Phaser.Events = function (sprite) {
    +	
    +	this.parent = sprite;
    +	this.onAddedToGroup = new Phaser.Signal;
    +	this.onRemovedFromGroup = new Phaser.Signal;
    +	this.onKilled = new Phaser.Signal;
    +	this.onRevived = new Phaser.Signal;
    +	this.onOutOfBounds = new Phaser.Signal;
    +
    +    this.onInputOver = null;
    +    this.onInputOut = null;
    +    this.onInputDown = null;
    +    this.onInputUp = null;
    +    this.onDragStart = null;
    +    this.onDragStop = null;
    +
    +	this.onAnimationStart = null;
    +	this.onAnimationComplete = null;
    +	this.onAnimationLoop = null;
    +
    +};
    +
    +Phaser.Events.prototype = {
    +
    +	destroy: function () {
    +
    +		this.parent = null;
    +		this.onAddedToGroup.dispose();
    +		this.onRemovedFromGroup.dispose();
    +		this.onKilled.dispose();
    +		this.onRevived.dispose();
    +		this.onOutOfBounds.dispose();
    +
    +		if (this.onInputOver)
    +		{
    +		    this.onInputOver.dispose();
    +		    this.onInputOut.dispose();
    +		    this.onInputDown.dispose();
    +		    this.onInputUp.dispose();
    +		    this.onDragStart.dispose();
    +		    this.onDragStop.dispose();
    +		}
    +
    +		if (this.onAnimationStart)
    +		{
    +			this.onAnimationStart.dispose();
    +			this.onAnimationComplete.dispose();
    +			this.onAnimationLoop.dispose();
    +		}
    +
    +	}
    +
    +};
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Frame.js.html b/docs/Frame.js.html index 2eb620b6..ed867b7d 100644 --- a/docs/Frame.js.html +++ b/docs/Frame.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -501,8 +621,8 @@ Phaser.Frame.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/FrameData.js.html b/docs/FrameData.js.html index 28919f5e..6a66f2c0 100644 --- a/docs/FrameData.js.html +++ b/docs/FrameData.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -578,8 +698,8 @@ Object.defineProperty(Phaser.FrameData.prototype, "total", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Game.js.html b/docs/Game.js.html index d0dc6451..630772fa 100644 --- a/docs/Game.js.html +++ b/docs/Game.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -355,7 +475,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant if (typeof transparent == 'undefined') { transparent = false; } if (typeof antialias == 'undefined') { antialias = true; } - + /** * @property {number} id - Phaser Game ID (for when Pixi supports multiple instances). */ @@ -574,7 +694,7 @@ Phaser.Game.prototype = { /** * Initialize engine sub modules and start the game. - * + * * @method Phaser.Game#boot * @protected */ @@ -638,10 +758,13 @@ Phaser.Game.prototype = { console.log('%cPhaser ' + Phaser.VERSION + ' initialized. Rendering to WebGL', 'color: #ffff33; background: #000000'); } - if (Phaser.VERSION.substr(-5) == '-beta') - { - console.warn('You are using a beta version of Phaser. Some things may not work.'); - } + var pos = Phaser.VERSION.indexOf('-'); + var versionQualifier = (pos >= 0) ? Phaser.VERSION.substr(pos + 1) : null; + if (versionQualifier) + { + var article = ['a', 'e', 'i', 'o', 'u', 'y'].indexOf(versionQualifier.charAt(0)) >= 0 ? 'an' : 'a'; + console.warn('You are using %s %s version of Phaser. Some things may not work.', article, versionQualifier); + } this.isRunning = true; this._loadComplete = false; @@ -652,10 +775,10 @@ Phaser.Game.prototype = { } }, - + /** * Checks if the device is capable of using the requested renderer and sets it up or an alternative if not. - * + * * @method Phaser.Game#setUpRenderer * @protected */ @@ -692,7 +815,7 @@ Phaser.Game.prototype = { /** * Called when the load has finished, after preload was run. - * + * * @method Phaser.Game#loadComplete * @protected */ @@ -706,7 +829,7 @@ Phaser.Game.prototype = { /** * The core game loop. - * + * * @method Phaser.Game#update * @protected * @param {number} time - The current time as provided by RequestAnimationFrame. @@ -720,6 +843,7 @@ Phaser.Game.prototype = { this.plugins.preUpdate(); this.physics.preUpdate(); + this.stage.update(); this.input.update(); this.tweens.update(); this.sound.update(); @@ -741,11 +865,15 @@ Phaser.Game.prototype = { /** * Nuke the entire game from orbit - * + * * @method Phaser.Game#destroy */ destroy: function () { + this.raf.stop(); + + this.input.destroy(); + this.state.destroy(); this.state = null; @@ -820,8 +948,8 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/GameObjectFactory.js.html b/docs/GameObjectFactory.js.html new file mode 100644 index 00000000..fbd5c909 --- /dev/null +++ b/docs/GameObjectFactory.js.html @@ -0,0 +1,795 @@ + + + + + + Phaser Source: gameobjects/GameObjectFactory.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/GameObjectFactory.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}
    +*/
    +
    +/**
    +* Description.
    +*
    +* @class Phaser.GameObjectFactory
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +*/
    +Phaser.GameObjectFactory = function (game) {
    +
    +    /**
    +	* @property {Phaser.Game} game - A reference to the currently running Game.
    +	*/
    +	this.game = game;
    +	
    +    /**
    +	* @property {Phaser.World} world - A reference to the game world.
    +	*/
    +	this.world = this.game.world;
    +
    +};
    +
    +Phaser.GameObjectFactory.prototype = {
    +
    +    /**
    +    * @property {Phaser.Game} game - A reference to the currently running Game.
    +    * @default
    +    */
    +	game: null,
    +	
    +    /**
    +	* @property {Phaser.World} world - A reference to the game world.
    +	* @default
    +	*/
    +    world: null,
    +
    +    /**
    +    * Description.
    +    * @method existing.
    +    * @param {*} object - An instance of Phaser.Sprite, Phaser.Button or any other display object..
    +    * @return {*} The child that was added to the Group.
    +    */
    +    existing: function (object) {
    +
    +        return this.world.add(object);
    +
    +    },
    +
    +	/**
    +    * Create a new Sprite with specific position and sprite sheet key.
    +    *
    +    * @method sprite
    +    * @param {number} x - X position of the new sprite.
    +    * @param {number} y - Y position of the new sprite.
    +    * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +    * @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
    +    * @returns {Phaser.Sprite} the newly created sprite object.
    +    */
    +    sprite: function (x, y, key, frame) {
    +
    +        return this.world.create(x, y, key, frame);
    +
    +    },
    +
    +    /**
    +    * Create a new Sprite with specific position and sprite sheet key that will automatically be added as a child of the given parent.
    +    *
    +    * @method child
    +    * @param {Phaser.Group} group - The Group to add this child to.
    +    * @param {number} x - X position of the new sprite.
    +    * @param {number} y - Y position of the new sprite.
    +    * @param {string|RenderTexture} [key] - The image key as defined in the Game.Cache to use as the texture for this sprite OR a RenderTexture.
    +    * @param  {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
    +    * @returns {Phaser.Sprite} the newly created sprite object.
    +    */
    +    child: function (group, x, y, key, frame) {
    +
    +        return group.create(x, y, key, frame);
    +
    +    },
    +
    +    /**
    +    * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.
    +    *
    +    * @method tween
    +    * @param {object} obj - Object the tween will be run on.
    +    * @return {Phaser.Tween} Description.
    +    */
    +    tween: function (obj) {
    +
    +        return this.game.tweens.create(obj);
    +
    +    },
    +
    +    /**
    +    * A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
    +    *
    +    * @method group
    +    * @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
    +    * @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging.
    +    * @return {Phaser.Group} The newly created group.
    +    */
    +    group: function (parent, name) {
    +
    +        return new Phaser.Group(this.game, parent, name);
    +
    +    },
    +
    +    /**
    +     * Creates a new instance of the Sound class.
    +     *
    +     * @method audio
    +     * @param {string} key - The Game.cache key of the sound that this object will use.
    +     * @param {number} volume - The volume at which the sound will be played.
    +     * @param {boolean} loop - Whether or not the sound will loop.
    +     * @return {Phaser.Sound} The newly created text object.
    +     */
    +    audio: function (key, volume, loop) {
    +
    +        return this.game.sound.add(key, volume, loop);
    +        
    +    },
    +
    +    /**
    +     * Creates a new <code>TileSprite</code>.
    +     *
    +     * @method tileSprite
    +     * @param {number} x - X position of the new tileSprite.
    +     * @param {number} y - Y position of the new tileSprite.
    +     * @param {number} width - the width of the tilesprite.
    +     * @param {number} height - the height of the tilesprite.
    +     * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +     * @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
    +     * @return {Phaser.TileSprite} The newly created tileSprite object.
    +     */
    +    tileSprite: function (x, y, width, height, key, frame) {
    +
    +        return this.world.add(new Phaser.TileSprite(this.game, x, y, width, height, key, frame));
    +
    +    },
    +
    +    /**
    +     * Creates a new <code>Text</code>.
    +     *
    +     * @method text
    +     * @param {number} x - X position of the new text object.
    +     * @param {number} y - Y position of the new text object.
    +     * @param {string} text - The actual text that will be written.
    +     * @param {object} style - The style object containing style attributes like font, font size , etc.
    +     * @return {Phaser.Text} The newly created text object.
    +     */
    +    text: function (x, y, text, style) {
    +
    +        return this.world.add(new Phaser.Text(this.game, x, y, text, style));
    +
    +    },
    +
    +    /**
    +    * Creates a new <code>Button</code> object.
    +    *
    +    * @method button
    +    * @param {number} [x] X position of the new button object.
    +    * @param {number} [y] Y position of the new button object.
    +    * @param {string} [key] The image key as defined in the Game.Cache to use as the texture for this button.
    +    * @param {function} [callback] The function to call when this button is pressed
    +    * @param {object} [callbackContext] The context in which the callback will be called (usually 'this')
    +    * @param {string|number} [overFrame] This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.
    +    * @param {string|number} [outFrame] This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.
    +    * @param {string|number} [downFrame] This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
    +    * @return {Phaser.Button} The newly created button object.
    +    */
    +    button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) {
    +
    +        return this.world.add(new Phaser.Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame));
    +
    +    },
    +
    +    /**
    +     * Creates a new <code>Graphics</code> object.
    +     *
    +     * @method graphics
    +     * @param {number} x - X position of the new graphics object.
    +     * @param {number} y - Y position of the new graphics object.
    +     * @return {Phaser.Graphics} The newly created graphics object.
    +     */
    +    graphics: function (x, y) {
    +
    +        return this.world.add(new Phaser.Graphics(this.game, x, y));
    +
    +    },
    +
    +    /**
    +    * Emitter is a lightweight particle emitter. It can be used for one-time explosions or for
    +    * continuous effects like rain and fire. All it really does is launch Particle objects out
    +    * at set intervals, and fixes their positions and velocities accorindgly.
    +    *
    +    * @method emitter
    +    * @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.
    +    * @return {Phaser.Emitter} The newly created emitter object.
    +    */
    +    emitter: function (x, y, maxParticles) {
    +
    +        return this.game.particles.add(new Phaser.Particles.Arcade.Emitter(this.game, x, y, maxParticles));
    +
    +    },
    +
    +    /**
    +    * * Create a new <code>BitmapText</code>.
    +    *
    +    * @method bitmapText
    +    * @param {number} x - X position of the new bitmapText object.
    +    * @param {number} y - Y position of the new bitmapText object.
    +    * @param {string} text - The actual text that will be written.
    +    * @param {object} style - The style object containing style attributes like font, font size , etc.
    +    * @return {Phaser.BitmapText} The newly created bitmapText object.
    +    */
    +    bitmapText: function (x, y, text, style) {
    +
    +        return this.world.add(new Phaser.BitmapText(this.game, x, y, text, style));
    +
    +    },
    +
    +    /**
    +    * Description.
    +    *
    +    * @method tilemap
    +    * @param {string} key - Asset key for the JSON file.
    +    * @return {Phaser.Tilemap} The newly created tilemap object.
    +    */
    +    tilemap: function (key) {
    +
    +        return new Phaser.Tilemap(this.game, key);
    +
    +    },
    +
    +    /**
    +    * Description.
    +    *
    +    * @method tileset
    +    * @param {string} key - The image key as defined in the Game.Cache to use as the tileset.
    +    * @return {Phaser.Tileset} The newly created tileset object.
    +    */
    +    tileset: function (key) {
    +
    +        return this.game.cache.getTileset(key);
    +
    +    },
    +
    +    /**
    +     * Description.
    +     *
    +     * @method tilemaplayer
    +     * @param {number} x - X position of the new tilemapLayer.
    +     * @param {number} y - Y position of the new tilemapLayer.
    +     * @param {number} width - the width of the tilemapLayer.
    +     * @param {number} height - the height of the tilemapLayer.
    +     * @return {Phaser.TilemapLayer} The newly created tilemaplayer object.
    +     */
    +    tilemapLayer: function (x, y, width, height, tileset, tilemap, layer) {
    +
    +        return this.world.add(new Phaser.TilemapLayer(this.game, x, y, width, height, tileset, tilemap, layer));
    +
    +    },
    +
    +    /**
    +    * A dynamic initially blank canvas to which images can be drawn
    +    *
    +    * @method renderTexture
    +    * @param {string} key - Asset key for the render texture.
    +    * @param {number} width - the width of the render texture.
    +    * @param {number} height - the height of the render texture.
    +    * @return {Phaser.RenderTexture} The newly created renderTexture object.
    +    */
    +    renderTexture: function (key, width, height) {
    +
    +        var texture = new Phaser.RenderTexture(this.game, key, width, height);
    +
    +        this.game.cache.addRenderTexture(key, texture);
    +
    +        return texture;
    +
    +    },
    +
    +};
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Graphics.js.html b/docs/Graphics.js.html new file mode 100644 index 00000000..332169a9 --- /dev/null +++ b/docs/Graphics.js.html @@ -0,0 +1,592 @@ + + + + + + Phaser Source: gameobjects/Graphics.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/Graphics.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}
    +*/
    +
    +/**
    +* Creates a new <code>Graphics</code> object.
    +* 
    +* @class Phaser.Graphics
    +* @constructor
    +*
    +* @param {Phaser.Game} game Current game instance.
    +* @param {number} x - X position of the new graphics object.
    +* @param {number} y - Y position of the new graphics object.
    +*/
    +Phaser.Graphics = function (game, x, y) {
    +
    +    this.game = game;
    +
    +    PIXI.Graphics.call(this);
    +
    +    /**
    +	* @property {Description} type - Description.
    +	*/
    +    this.type = Phaser.GRAPHICS;
    +
    +};
    +
    +Phaser.Graphics.prototype = Object.create(PIXI.Graphics.prototype);
    +Phaser.Graphics.prototype.constructor = Phaser.Graphics;
    +
    +//  Add our own custom methods
    +
    +/**
    +* Description.
    +* 
    +* @method Phaser.Sprite.prototype.destroy
    +*/
    +Phaser.Graphics.prototype.destroy = function() {
    +
    +    this.clear();
    +
    +    if (this.group)
    +    {
    +        this.group.remove(this);
    +    }
    +
    +    this.game = null;
    +
    +}
    +
    +Object.defineProperty(Phaser.Graphics.prototype, 'angle', {
    +
    +    get: function() {
    +        return Phaser.Math.wrapAngle(Phaser.Math.radToDeg(this.rotation));
    +    },
    +
    +    set: function(value) {
    +        this.rotation = Phaser.Math.degToRad(Phaser.Math.wrapAngle(value));
    +    }
    +
    +});
    +
    +Object.defineProperty(Phaser.Graphics.prototype, 'x', {
    +
    +    get: function() {
    +        return this.position.x;
    +    },
    +
    +    set: function(value) {
    +        this.position.x = value;
    +    }
    +
    +});
    +
    +Object.defineProperty(Phaser.Graphics.prototype, 'y', {
    +
    +    get: function() {
    +        return this.position.y;
    +    },
    +
    +    set: function(value) {
    +        this.position.y = value;
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Group.js.html b/docs/Group.js.html index a351026c..69a9974b 100644 --- a/docs/Group.js.html +++ b/docs/Group.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -373,15 +493,18 @@ Phaser.Group = function (game, parent, name, useStage) { if (parent instanceof Phaser.Group) { parent._container.addChild(this._container); + parent._container.updateTransform(); } else { parent.addChild(this._container); + parent.updateTransform(); } } else { this.game.stage._stage.addChild(this._container); + this.game.stage._stage.updateTransform(); } } @@ -429,6 +552,8 @@ Phaser.Group.prototype = { } this._container.addChild(child); + + child.updateTransform(); } return child; @@ -456,6 +581,8 @@ Phaser.Group.prototype = { } this._container.addChildAt(child, index); + + child.updateTransform(); } return child; @@ -505,6 +632,8 @@ Phaser.Group.prototype = { } this._container.addChild(child); + + child.updateTransform(); return child; @@ -540,6 +669,8 @@ Phaser.Group.prototype = { } this._container.addChild(child); + child.updateTransform(); + } }, @@ -731,6 +862,7 @@ Phaser.Group.prototype = { this._container.removeChild(oldChild); this._container.addChildAt(newChild, index); newChild.events.onAddedToGroup.dispatch(newChild, this); + newChild.updateTransform(); } }, @@ -1583,8 +1715,8 @@ Object.defineProperty(Phaser.Group.prototype, "alpha", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Input.js.html b/docs/Input.js.html index 0b479b45..99543057 100644 --- a/docs/Input.js.html +++ b/docs/Input.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -718,6 +838,19 @@ Phaser.Input.prototype = { this.mspointer.start(); this.mousePointer.active = true; + }, + + /** + * Stops all of the Input Managers from running. + * @method Phaser.Input#destroy + */ + destroy: function () { + + this.mouse.stop(); + this.keyboard.stop(); + this.touch.stop(); + this.mspointer.stop(); + }, /** @@ -1004,28 +1137,6 @@ Phaser.Input.prototype = { return null; - }, - - /** - * Get the distance between two Pointer objects. - * @method Phaser.Input#getDistance - * @param {Pointer} pointer1 - * @param {Pointer} pointer2 - * @return {Description} Description. - */ - getDistance: function (pointer1, pointer2) { - // return Phaser.Vec2Utils.distance(pointer1.position, pointer2.position); - }, - - /** - * Get the angle between two Pointer objects. - * @method Phaser.Input#getAngle - * @param {Pointer} pointer1 - * @param {Pointer} pointer2 - * @return {Description} Description. - */ - getAngle: function (pointer1, pointer2) { - // return Phaser.Vec2Utils.angle(pointer1.position, pointer2.position); } }; @@ -1162,8 +1273,8 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/InputHandler.js.html b/docs/InputHandler.js.html index f83af112..a7767a3b 100644 --- a/docs/InputHandler.js.html +++ b/docs/InputHandler.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -629,10 +749,13 @@ Phaser.InputHandler.prototype = { if (this.enabled) { + this.enabled = false; + + this.game.input.interactiveItems.remove(this); + this.stop(); - // Null everything + this.sprite = null; - // etc } }, @@ -804,24 +927,15 @@ Phaser.InputHandler.prototype = { { this.sprite.getLocalUnmodifiedPosition(this._tempPoint, pointer.x, pointer.y); - // Check against bounds first (move these to private vars) - var x1 = -(this.sprite.texture.frame.width) * this.sprite.anchor.x; - var y1; - - if (this._tempPoint.x > x1 && this._tempPoint.x < x1 + this.sprite.texture.frame.width) + if (this._tempPoint.x >= 0 && this._tempPoint.x <= this.sprite.currentFrame.width && this._tempPoint.y >= 0 && this._tempPoint.y <= this.sprite.currentFrame.height) { - y1 = -(this.sprite.texture.frame.height) * this.sprite.anchor.y; - - if (this._tempPoint.y > y1 && this._tempPoint.y < y1 + this.sprite.texture.frame.height) + if (this.pixelPerfect) { - if (this.pixelPerfect) - { - return this.checkPixel(this._tempPoint.x, this._tempPoint.y); - } - else - { - return true; - } + return this.checkPixel(this._tempPoint.x, this._tempPoint.y); + } + else + { + return true; } } } @@ -839,16 +953,16 @@ Phaser.InputHandler.prototype = { */ checkPixel: function (x, y) { - x += (this.sprite.texture.frame.width * this.sprite.anchor.x); - y += (this.sprite.texture.frame.height * this.sprite.anchor.y); - // Grab a pixel from our image into the hitCanvas and then test it - if (this.sprite.texture.baseTexture.source) { this.game.input.hitContext.clearRect(0, 0, 1, 1); // This will fail if the image is part of a texture atlas - need to modify the x/y values here + + x += this.sprite.texture.frame.x; + y += this.sprite.texture.frame.y; + this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source, x, y, 1, 1, 0, 0, 1, 1); var rgb = this.game.input.hitContext.getImageData(0, 0, 1, 1); @@ -938,7 +1052,10 @@ Phaser.InputHandler.prototype = { this.game.stage.canvas.style.cursor = "default"; } - this.sprite.events.onInputOut.dispatch(this.sprite, pointer); + if (this.sprite && this.sprite.events) + { + this.sprite.events.onInputOut.dispatch(this.sprite, pointer); + } }, @@ -1393,8 +1510,8 @@ Phaser.InputHandler.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Intro.js.html b/docs/Intro.js.html index c9eb4020..82819e1a 100644 --- a/docs/Intro.js.html +++ b/docs/Intro.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -332,7 +452,7 @@ * * Phaser - http://www.phaser.io * -* v{version} - Built at: {buildDate} +* v<%= version %> - Built at: <%= buildDate %> * * By Richard Davey http://www.photonstorm.com @photonstorm * @@ -370,8 +490,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Key.js.html b/docs/Key.js.html index 606b4622..87eb0438 100644 --- a/docs/Key.js.html +++ b/docs/Key.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -512,8 +632,8 @@ Phaser.Key.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Keyboard.js.html b/docs/Keyboard.js.html index 28178681..09ef56bb 100644 --- a/docs/Keyboard.js.html +++ b/docs/Keyboard.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -834,8 +954,8 @@ Phaser.Keyboard.NUM_LOCK = 144;
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/LinkedList.js.html b/docs/LinkedList.js.html index ea65f1cf..222636ca 100644 --- a/docs/LinkedList.js.html +++ b/docs/LinkedList.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -494,8 +614,8 @@ Phaser.LinkedList.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Loader.js.html b/docs/Loader.js.html index 1bbd6580..206d8fd6 100644 --- a/docs/Loader.js.html +++ b/docs/Loader.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -484,6 +604,7 @@ Phaser.Loader.prototype = { } sprite.crop = this.preloadSprite.crop; + sprite.cropEnabled = true; }, @@ -1258,7 +1379,7 @@ Phaser.Loader.prototype = { break; case 'text': - file.data = this._xhr.response; + file.data = this._xhr.responseText; this.game.cache.addText(file.key, file.url, file.data); break; } @@ -1278,7 +1399,7 @@ Phaser.Loader.prototype = { */ jsonLoadComplete: function (key) { - var data = JSON.parse(this._xhr.response); + var data = JSON.parse(this._xhr.responseText); var file = this._fileList[key]; if (file.type == 'tilemap') @@ -1302,7 +1423,7 @@ Phaser.Loader.prototype = { */ csvLoadComplete: function (key) { - var data = this._xhr.response; + var data = this._xhr.responseText; var file = this._fileList[key]; this.game.cache.addTilemap(file.key, file.url, data, file.format); @@ -1337,7 +1458,7 @@ Phaser.Loader.prototype = { */ xmlLoadComplete: function (key) { - var data = this._xhr.response; + var data = this._xhr.responseText; var xml; try @@ -1447,8 +1568,8 @@ Phaser.Loader.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/LoaderParser.js.html b/docs/LoaderParser.js.html index d3378850..c00d28dd 100644 --- a/docs/LoaderParser.js.html +++ b/docs/LoaderParser.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -423,8 +543,8 @@ Phaser.LoaderParser = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/MSPointer.js.html b/docs/MSPointer.js.html index 86456654..6d271c3d 100644 --- a/docs/MSPointer.js.html +++ b/docs/MSPointer.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -523,8 +643,8 @@ Phaser.MSPointer.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Math.js.html b/docs/Math.js.html index 4bc3ca48..56e7015b 100644 --- a/docs/Math.js.html +++ b/docs/Math.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1511,8 +1631,8 @@ Phaser.Math = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Mouse.js.html b/docs/Mouse.js.html index 9bc49546..579cfe0e 100644 --- a/docs/Mouse.js.html +++ b/docs/Mouse.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -599,8 +719,8 @@ Phaser.Mouse.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Net.js.html b/docs/Net.js.html index 0b179d32..523c046f 100644 --- a/docs/Net.js.html +++ b/docs/Net.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -509,8 +629,8 @@ Phaser.Net.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Particles.js.html b/docs/Particles.js.html index 32c12ac0..1e3babd4 100644 --- a/docs/Particles.js.html +++ b/docs/Particles.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -414,8 +534,8 @@ Phaser.Particles.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Animation.html b/docs/Phaser.Animation.html index 1e3288db..0201aab1 100644 --- a/docs/Phaser.Animation.html +++ b/docs/Phaser.Animation.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -410,7 +530,7 @@ It is created by the AnimationManager, consists of Animation.Frame objects and b -Phaser.Sprite +Phaser.Sprite @@ -1853,7 +1973,7 @@ It is created by the AnimationManager, consists of Animation.Frame objects and b
    -

    <static> generateFrameNames(prefix, min, max, suffix, zeroPad)

    +

    <static> generateFrameNames(prefix, start, stop, suffix, zeroPad)

    @@ -1936,7 +2056,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat - min + start @@ -1964,14 +2084,14 @@ You could use this function to generate those by doing: Phaser.Animation.generat -

    The number to start sequentially counting from. If your frames are named 'explosion_0001' to 'explosion_0034' the min is 1.

    +

    The number to start sequentially counting from. If your frames are named 'explosion_0001' to 'explosion_0034' the start is 1.

    - max + stop @@ -1999,7 +2119,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat -

    The number to count up to. If your frames are named 'explosion_0001' to 'explosion_0034' the max is 34.

    +

    The number to count to. If your frames are named 'explosion_0001' to 'explosion_0034' the stop value is 34.

    @@ -2814,8 +2934,8 @@ You could use this function to generate those by doing: Phaser.Animation.generat
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.AnimationManager.html b/docs/Phaser.AnimationManager.html index cc33f1bc..4c73a71f 100644 --- a/docs/Phaser.AnimationManager.html +++ b/docs/Phaser.AnimationManager.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -387,7 +507,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single -Phaser.Sprite +Phaser.Sprite @@ -1340,7 +1460,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single -Phaser.Sprite +Phaser.Sprite @@ -2723,8 +2843,8 @@ The currentAnim property of the AnimationManager is automatically set to the ani
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.AnimationParser.html b/docs/Phaser.AnimationParser.html index 4e3a2f84..878830e1 100644 --- a/docs/Phaser.AnimationParser.html +++ b/docs/Phaser.AnimationParser.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1307,8 +1427,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.BitmapText.html b/docs/Phaser.BitmapText.html new file mode 100644 index 00000000..b011aeac --- /dev/null +++ b/docs/Phaser.BitmapText.html @@ -0,0 +1,1654 @@ + + + + + + Phaser Class: BitmapText + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: BitmapText

    +
    + +
    +

    + Phaser. + + BitmapText +

    + +

    Phaser.BitmapText

    + +
    + +
    +
    + + + + +
    +

    new BitmapText(game, x, y, text, style)

    + + +
    +
    + + +
    +

    Creates a new <code>BitmapText</code>.

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

    A reference to the currently running game.

    x + + +number + + + +

    X position of the new bitmapText object.

    y + + +number + + + +

    Y position of the new bitmapText object.

    text + + +string + + + +

    The actual text that will be written.

    style + + +object + + + +

    The style object containing style attributes like font, font size , etc.

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

    Members

    + +
    + +
    +

    alive

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    alive + + +boolean + + + +

    This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering.

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

    anchor

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    anchor + + +Phaser.Point + + + +

    Description.

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

    exists

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    exists + + +boolean + + + +

    If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all.

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

    game

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

    A reference to the currently running Game.

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

    group

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    group + + +Description + + + +

    Description.

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

    name

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + +

    Description.

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

    scale

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    scale + + +Phaser.Point + + + +

    Description.

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

    type

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +Description + + + +

    Description.

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

    Methods

    + +
    + +
    +

    update()

    + + +
    +
    + + +
    +

    Automatically called by World.update

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Bullet.html b/docs/Phaser.Bullet.html new file mode 100644 index 00000000..adffcd0e --- /dev/null +++ b/docs/Phaser.Bullet.html @@ -0,0 +1,4145 @@ + + + + + + Phaser Class: Bullet + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Bullet

    +
    + +
    +

    + Phaser. + + Bullet +

    + +

    Phaser.Bullet

    + +
    + +
    +
    + + + + +
    +

    new Bullet(game, x, y, key, frame)

    + + +
    +
    + + +
    +

    Warning: Bullet is an experimental object that we don't advise using for now.

    +

    A Bullet is like a stripped-down Sprite, useful for when you just need to get something moving around the screen quickly with little of the extra +features that a Sprite supports. +Bullet is MISSING the following:

    +

    animation, all input events, crop support, health/damage, loadTexture

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

    Current game instance.

    x + + +number + + + +

    X position of the new bullet.

    y + + +number + + + +

    Y position of the new bullet.

    key + + +string +| + +Phaser.RenderTexture +| + +PIXI.Texture + + + +

    This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.

    frame + + +string +| + +number + + + +

    If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.

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

    Members

    + +
    + +
    +

    alive

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    alive + + +boolean + + + +

    This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering.

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

    anchor

    + + +
    +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    anchor + + +Phaser.Point + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    angle

    + + +
    +
    + +
    +

    Indicates the rotation of the Bullet, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. +Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. +If you wish to work in radians instead of degrees use the property Bullet.rotation instead.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    angle + + +number + + + +

    Gets or sets the Bullets angle of rotation in degrees.

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

    autoCull

    + + +
    +
    + +
    +

    Should this Sprite be automatically culled if out of range of the camera? +A culled sprite has its visible property set to 'false'. +Note that this check doesn't look at this Sprites children, which may still be in camera range. +So you should set autoCull to false if the Sprite will have children likely to still be in camera range.

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

    body

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body + + +Phaser.Physics.Arcade.Body + + + +

    Set-up the physics body.

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

    bottomLeft

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bottomLeft + + +Phaser.Point + + + +

    Description.

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

    bottomRight

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bottomRight + + +Phaser.Point + + + +

    Description.

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

    bounds

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bounds + + +Phaser.Rectangle + + + +

    Description.

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

    center

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    center + + +Phaser.Point + + + +

    Description.

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

    events

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    events + + +Events + + + +

    The Signals you can subscribe to that are dispatched when certain things happen on this Sprite or its components

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

    exists

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    exists + + +boolean + + + +

    If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all.

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

    fixedToCamera

    + + +
    +
    + +
    +

    A Sprite that is fixed to the camera ignores the position of any ancestors in the display list and uses its x/y coordinates as offsets from the top left of the camera.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    fixedToCamera + + +boolean + + + +

    Fixes this Sprite to the Camera.

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

    game

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

    A reference to the currently running Game.

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

    group

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    group + + +Description + + + +

    Description.

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

    inWorld

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    inWorld + + +Description + + + +

    World bounds check.

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

    inWorldThreshold

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    inWorldThreshold + + +number + + + +

    World bounds check.

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

    key

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    key + + +Description + + + +

    Description.

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

    lifespan

    + + +
    +
    + +
    +

    If you would like the Sprite to have a lifespan once 'born' you can set this to a positive value. Handy for particles, bullets, etc. +The lifespan is decremented by game.time.elapsed each update, once it reaches zero the kill() function is called.

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

    name

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + +

    The user defined name given to this Sprite.

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

    offset

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    offset + + +Phaser.Point + + + +

    Corner point defaults.

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

    outOfBoundsKill

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    outOfBoundsKill + + +boolean + + + +

    Kills this sprite as soon as it goes outside of the World bounds.

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

    renderOrderID

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    renderOrderID + + +number + + + +

    Description.

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

    scale

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    scale + + +Phaser.Point + + + +

    Replaces the PIXI.Point with a slightly more flexible one.

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

    topLeft

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    topLeft + + +Phaser.Point + + + +

    Description.

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

    topRight

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    topRight + + +Phaser.Point + + + +

    Description.

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

    type

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +Description + + + +

    Description.

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

    x

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    Description.

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

    y

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    y + + +number + + + +

    Description.

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

    Methods

    + +
    + +
    +

    bringToTop()

    + + +
    +
    + + +
    +

    Description.

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

    destroy()

    + + +
    +
    + + +
    +

    Description.

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

    getLocalPosition(p, x, y) → {Description}

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    p + + +Description + + + +

    Description.

    x + + +number + + + +

    Description.

    y + + +number + + + +

    Description.

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

    Description.

    +
    + + + +
    +
    + Type +
    +
    + +Description + + +
    +
    + + + + + +
    + + + +
    +

    kill()

    + + +
    +
    + + +
    +

    Description.

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

    revive()

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Button.html b/docs/Phaser.Button.html new file mode 100644 index 00000000..a854ce41 --- /dev/null +++ b/docs/Phaser.Button.html @@ -0,0 +1,2139 @@ + + + + + + Phaser Class: Button + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Button

    +
    + +
    +

    + Phaser. + + Button +

    + +

    Phaser.Button

    + +
    + +
    +
    + + + + +
    +

    new Button(game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame)

    + + +
    +
    + + +
    +

    Create a new <code>Button</code> object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    game + + +Phaser.Game + + + + + + + + + +

    Current game instance.

    x + + +number + + + + + + <optional>
    + + + + + +

    X position of the button.

    y + + +number + + + + + + <optional>
    + + + + + +

    Y position of the button.

    key + + +string + + + + + + <optional>
    + + + + + +

    The image key as defined in the Game.Cache to use as the texture for this button.

    callback + + +function + + + + + + <optional>
    + + + + + +

    The function to call when this button is pressed

    callbackContext + + +object + + + + + + <optional>
    + + + + + +

    The context in which the callback will be called (usually 'this')

    overFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.

    outFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.

    downFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.

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

    Members

    + +
    + +
    +

    onInputDown

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onInputDown + + +Phaser.Signal + + + +

    Description.

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

    onInputOut

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onInputOut + + +Phaser.Signal + + + +

    Description.

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

    onInputOver

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onInputOver + + +Phaser.Signal + + + +

    Description.

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

    onInputUp

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onInputUp + + +Phaser.Signal + + + +

    Description.

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

    type

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +Description + + + +

    Description.

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

    Methods

    + +
    + +
    +

    onInputDownHandler(pointer)

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pointer + + +Description + + + +

    Description.

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

    onInputOutHandler(pointer)

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pointer + + +Description + + + +

    Description.

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

    onInputOverHandler(pointer)

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pointer + + +Description + + + +

    Description.

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

    onInputUpHandler(pointer)

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pointer + + +Description + + + +

    Description.

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

    setFrames(overFrame, outFrame, downFrame)

    + + +
    +
    + + +
    +

    Used to manually set the frames that will be used for the different states of the button +exactly like setting them in the constructor.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    overFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.

    outFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.

    downFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Cache.html b/docs/Phaser.Cache.html index 475edfe1..f2c1d276 100644 --- a/docs/Phaser.Cache.html +++ b/docs/Phaser.Cache.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1590,7 +1710,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -2889,7 +3009,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -3053,7 +3173,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -3122,7 +3242,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -3240,7 +3360,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -3381,7 +3501,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -3522,7 +3642,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -3663,7 +3783,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -3804,7 +3924,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -3945,7 +4065,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -4037,7 +4157,7 @@ as images, sounds and data files as a result of Loader calls. Cache items use st
    Source:
    @@ -4179,7 +4299,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -4320,7 +4440,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -4461,7 +4581,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -4553,7 +4673,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -4694,7 +4814,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -4786,7 +4906,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -4837,7 +4957,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    -

    getTexture(key) → {Phaser.RenderTexture}

    +

    getTexture(key) → {Phaser.RenderTexture}

    @@ -4927,7 +5047,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -4963,7 +5083,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    -Phaser.RenderTexture +Phaser.RenderTexture
    @@ -5068,7 +5188,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -5209,7 +5329,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -5350,7 +5470,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -5491,7 +5611,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -5632,7 +5752,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -5773,7 +5893,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -5914,7 +6034,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -6055,7 +6175,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -6173,7 +6293,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -6291,7 +6411,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -6409,7 +6529,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -6527,7 +6647,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -6645,7 +6765,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -6763,7 +6883,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    Source:
    @@ -6813,8 +6933,8 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Camera.html b/docs/Phaser.Camera.html index af7ae150..95529a37 100644 --- a/docs/Phaser.Camera.html +++ b/docs/Phaser.Camera.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1600,7 +1720,7 @@ at all then set this to null. The values can be anything and are in World coordi -Phaser.Sprite +Phaser.Sprite @@ -2678,7 +2798,7 @@ Objects outside of this view are not rendered (unless set to ignore the Camera, -Phaser.Sprite +Phaser.Sprite @@ -3163,8 +3283,8 @@ without having to use game.camera.x and game.camera.y.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Canvas.html b/docs/Phaser.Canvas.html index 14daba08..5647d0c4 100644 --- a/docs/Phaser.Canvas.html +++ b/docs/Phaser.Canvas.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2407,8 +2527,8 @@ patchy on earlier browsers, especially on mobile.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Circle.html b/docs/Phaser.Circle.html index 46e4a9eb..148f1751 100644 --- a/docs/Phaser.Circle.html +++ b/docs/Phaser.Circle.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -4187,8 +4307,8 @@ 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 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Color.html b/docs/Phaser.Color.html index 484476f6..203cf9cb 100644 --- a/docs/Phaser.Color.html +++ b/docs/Phaser.Color.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -3516,8 +3636,8 @@ RGB format information and HSL information. Each section starts on a newline, 3
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Device.html b/docs/Phaser.Device.html index f3bf6fd1..a4b79bfc 100644 --- a/docs/Phaser.Device.html +++ b/docs/Phaser.Device.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -4727,7 +4847,7 @@
    Source:
    @@ -4819,7 +4939,7 @@
    Source:
    @@ -4892,8 +5012,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Back.html b/docs/Phaser.Easing.Back.html index aea252ef..68cad7cf 100644 --- a/docs/Phaser.Easing.Back.html +++ b/docs/Phaser.Easing.Back.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Bounce.html b/docs/Phaser.Easing.Bounce.html index 23715df7..cc641978 100644 --- a/docs/Phaser.Easing.Bounce.html +++ b/docs/Phaser.Easing.Bounce.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Circular.html b/docs/Phaser.Easing.Circular.html index 58fba0c0..0166f173 100644 --- a/docs/Phaser.Easing.Circular.html +++ b/docs/Phaser.Easing.Circular.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Cubic.html b/docs/Phaser.Easing.Cubic.html index 892d2a19..290b4929 100644 --- a/docs/Phaser.Easing.Cubic.html +++ b/docs/Phaser.Easing.Cubic.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Elastic.html b/docs/Phaser.Easing.Elastic.html index a346c298..0314eacd 100644 --- a/docs/Phaser.Easing.Elastic.html +++ b/docs/Phaser.Easing.Elastic.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Exponential.html b/docs/Phaser.Easing.Exponential.html index 6c07b7bf..70449298 100644 --- a/docs/Phaser.Easing.Exponential.html +++ b/docs/Phaser.Easing.Exponential.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Linear.html b/docs/Phaser.Easing.Linear.html index d9790bea..d1c707e3 100644 --- a/docs/Phaser.Easing.Linear.html +++ b/docs/Phaser.Easing.Linear.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -586,8 +706,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quadratic.html b/docs/Phaser.Easing.Quadratic.html index b1e44d6f..23cf5558 100644 --- a/docs/Phaser.Easing.Quadratic.html +++ b/docs/Phaser.Easing.Quadratic.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quartic.html b/docs/Phaser.Easing.Quartic.html index 491b3306..3084d6d8 100644 --- a/docs/Phaser.Easing.Quartic.html +++ b/docs/Phaser.Easing.Quartic.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quintic.html b/docs/Phaser.Easing.Quintic.html index 64fa5f1f..0d031701 100644 --- a/docs/Phaser.Easing.Quintic.html +++ b/docs/Phaser.Easing.Quintic.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.Sinusoidal.html b/docs/Phaser.Easing.Sinusoidal.html index 61b78478..354db64a 100644 --- a/docs/Phaser.Easing.Sinusoidal.html +++ b/docs/Phaser.Easing.Sinusoidal.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -868,8 +988,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Easing.html b/docs/Phaser.Easing.html index 9ba392f2..2143a4b9 100644 --- a/docs/Phaser.Easing.html +++ b/docs/Phaser.Easing.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -478,8 +598,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:59 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Events.html b/docs/Phaser.Events.html new file mode 100644 index 00000000..ec03461e --- /dev/null +++ b/docs/Phaser.Events.html @@ -0,0 +1,660 @@ + + + + + + Phaser Class: Events + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Events

    +
    + +
    +

    + Phaser. + + Events +

    + +

    Phaser.Events

    + +
    + +
    +
    + + + + +
    +

    new Events(sprite)

    + + +
    +
    + + +
    +

    The Events component is a collection of events fired by the parent game object and its components.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    sprite + + +Phaser.Sprite + + + +

    A reference to Description.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Frame.html b/docs/Phaser.Frame.html index 9f0ca9aa..f2cdf532 100644 --- a/docs/Phaser.Frame.html +++ b/docs/Phaser.Frame.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2853,8 +2973,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.FrameData.html b/docs/Phaser.FrameData.html index b64379a2..4da183af 100644 --- a/docs/Phaser.FrameData.html +++ b/docs/Phaser.FrameData.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1800,8 +1920,8 @@ 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 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:45 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Game.html b/docs/Phaser.Game.html index 704bea9a..b752b0b1 100644 --- a/docs/Phaser.Game.html +++ b/docs/Phaser.Game.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -659,7 +779,7 @@ providing quick access to common functions and handling the boot process.

    -Phaser.GameObjectFactory +Phaser.GameObjectFactory @@ -2581,7 +2701,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4068,7 +4188,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4137,7 +4257,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4206,7 +4326,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4324,7 +4444,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4374,8 +4494,8 @@ 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 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.GameObjectFactory.html b/docs/Phaser.GameObjectFactory.html new file mode 100644 index 00000000..b1fe49a3 --- /dev/null +++ b/docs/Phaser.GameObjectFactory.html @@ -0,0 +1,1078 @@ + + + + + + Phaser Class: GameObjectFactory + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: GameObjectFactory

    +
    + +
    +

    + Phaser. + + GameObjectFactory +

    + +

    Phaser.GameObjectFactory

    + +
    + +
    +
    + + + + +
    +

    new GameObjectFactory(game)

    + + +
    +
    + + +
    +

    Description.

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

    A reference to the currently running game.

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

    Members

    + +
    + +
    +

    game

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

    A reference to the currently running Game.

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

    game

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

    A reference to the currently running Game.

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

    world

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    world + + +Phaser.World + + + +

    A reference to the game world.

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

    world

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    world + + +Phaser.World + + + +

    A reference to the game world.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • null
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Graphics.html b/docs/Phaser.Graphics.html new file mode 100644 index 00000000..f7df7666 --- /dev/null +++ b/docs/Phaser.Graphics.html @@ -0,0 +1,812 @@ + + + + + + Phaser Class: Graphics + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Graphics

    +
    + +
    +

    + Phaser. + + Graphics +

    + +

    Phaser.Graphics

    + +
    + +
    +
    + + + + +
    +

    new Graphics(game, x, y)

    + + +
    +
    + + +
    +

    Creates a new <code>Graphics</code> object.

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

    Current game instance.

    x + + +number + + + +

    X position of the new graphics object.

    y + + +number + + + +

    Y position of the new graphics object.

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

    Members

    + +
    + +
    +

    type

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +Description + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Group.html b/docs/Phaser.Group.html index 2c75ea5e..e4350c52 100644 --- a/docs/Phaser.Group.html +++ b/docs/Phaser.Group.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -685,7 +805,7 @@
    Source:
    @@ -792,7 +912,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -897,7 +1017,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1101,7 +1221,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1310,7 +1430,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1412,7 +1532,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1514,7 +1634,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1616,7 +1736,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1718,7 +1838,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1825,7 +1945,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -1932,7 +2052,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -2048,7 +2168,7 @@ that then see the addAt method.

    Source:
    @@ -2268,7 +2388,7 @@ Group.addAll('x', 10) will add 10 to the child.x value.

    Source:
    @@ -2410,7 +2530,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -2551,7 +2671,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -2736,7 +2856,7 @@ After the callback parameter you can add as many extra parameters as you like, w
    Source:
    @@ -2929,7 +3049,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -2998,7 +3118,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -3090,7 +3210,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -3141,7 +3261,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    -

    create(x, y, key, frame, exists) → {Phaser.Sprite}

    +

    create(x, y, key, frame, exists) → {Phaser.Sprite}

    @@ -3397,7 +3517,7 @@ Useful if you don't need to create the Sprite instances before-hand.

    Source:
    @@ -3433,7 +3553,7 @@ Useful if you don't need to create the Sprite instances before-hand.

    -Phaser.Sprite +Phaser.Sprite
    @@ -3670,7 +3790,7 @@ and will be positioned at 0, 0 (relative to the Group.x/y)

    Source:
    @@ -3739,7 +3859,7 @@ and will be positioned at 0, 0 (relative to the Group.x/y)

    Source:
    @@ -3927,7 +4047,7 @@ Group.divideAll('x', 2) will half the child.x value.

    Source:
    @@ -4065,7 +4185,7 @@ Group.divideAll('x', 2) will half the child.x value.

    Source:
    @@ -4231,7 +4351,7 @@ For example: Group.forEach(awardBonusGold, this, true, 100, 500)

    Source:
    @@ -4374,7 +4494,7 @@ For example: Group.forEachAlive(causeDamage, this, 500)

    Source:
    @@ -4517,7 +4637,7 @@ For example: Group.forEachDead(bringToLife, this)

    Source:
    @@ -4635,7 +4755,7 @@ For example: Group.forEachDead(bringToLife, this)

    Source:
    @@ -4728,7 +4848,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -4821,7 +4941,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -4962,7 +5082,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -5103,7 +5223,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -5267,7 +5387,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -5478,7 +5598,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.

    Source:
    @@ -5596,7 +5716,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.

    Source:
    @@ -5666,7 +5786,7 @@ The Group container remains on the display list.

    Source:
    @@ -5807,7 +5927,7 @@ The Group container remains on the display list.

    Source:
    @@ -5948,7 +6068,7 @@ The Group container remains on the display list.

    Source:
    @@ -6235,7 +6355,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -6478,7 +6598,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -6666,7 +6786,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -6807,7 +6927,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -6880,8 +7000,8 @@ Group.subAll('x', 10) will minus 10 from the child.x value.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:00 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Input.html b/docs/Phaser.Input.html index 8b99dbb3..94af83fb 100644 --- a/docs/Phaser.Input.html +++ b/docs/Phaser.Input.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -4280,7 +4400,7 @@ For lots of games it's useful to set this to 1.

    Source:
    @@ -5264,7 +5384,7 @@ otherwise see the Pointer objects directly.

    Source:
    @@ -5370,7 +5490,7 @@ otherwise see the Pointer objects directly.

    Source:
    @@ -5585,7 +5705,7 @@ otherwise see the Pointer objects directly.

    Source:
    @@ -5691,7 +5811,7 @@ otherwise see the Pointer objects directly.

    Source:
    @@ -5797,7 +5917,7 @@ otherwise see the Pointer objects directly.

    Source:
    @@ -5903,7 +6023,7 @@ otherwise see the Pointer objects directly.

    Source:
    @@ -5969,7 +6089,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -6089,7 +6209,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    -

    getAngle(pointer1, pointer2) → {Description}

    +

    destroy()

    @@ -6097,7 +6217,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    -

    Get the angle between two Pointer objects.

    +

    Stops all of the Input Managers from running.

    @@ -6106,78 +6226,6 @@ If you need more then use this to create a new one, up to a maximum of 10.

    -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    pointer1 - - -Pointer - - - -
    pointer2 - - -Pointer - - - -
    - -
    @@ -6202,7 +6250,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -6223,193 +6271,6 @@ If you need more then use this to create a new one, up to a maximum of 10.

    -
    Returns:
    - - -
    -

    Description.

    -
    - - - -
    -
    - Type -
    -
    - -Description - - -
    -
    - - - - - - - - - -
    -

    getDistance(pointer1, pointer2) → {Description}

    - - -
    -
    - - -
    -

    Get the distance between two Pointer objects.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    pointer1 - - -Pointer - - - -
    pointer2 - - -Pointer - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    Description.

    -
    - - - -
    -
    - Type -
    -
    - -Description - - -
    -
    - - -
    @@ -6507,7 +6368,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -6648,7 +6509,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -6789,7 +6650,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -6930,7 +6791,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -7048,7 +6909,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -7189,7 +7050,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -7281,7 +7142,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -7399,7 +7260,7 @@ If you need more then use this to create a new one, up to a maximum of 10.

    Source:
    @@ -7472,8 +7333,8 @@ 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 23 2013 13:52:01 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.InputHandler.html b/docs/Phaser.InputHandler.html index d69deb50..d5b0ccdd 100644 --- a/docs/Phaser.InputHandler.html +++ b/docs/Phaser.InputHandler.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -386,7 +506,7 @@ -Phaser.Sprite +Phaser.Sprite @@ -2928,7 +3048,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c -Phaser.Sprite +Phaser.Sprite @@ -3137,7 +3257,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c
    Source:
    @@ -3206,7 +3326,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c
    Source:
    @@ -3347,7 +3467,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c
    Source:
    @@ -3484,7 +3604,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c
    Source:
    @@ -3641,7 +3761,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c
    Source:
    @@ -3710,7 +3830,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c
    Source:
    @@ -3828,7 +3948,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c
    Source:
    @@ -4054,7 +4174,7 @@ For example if you had a stack of 6 sprites with the same priority IDs and one c
    Source:
    @@ -4222,7 +4342,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -4363,7 +4483,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -4523,7 +4643,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -4683,7 +4803,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -4843,7 +4963,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -4980,7 +5100,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -5121,7 +5241,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -5258,7 +5378,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -5395,7 +5515,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -5524,7 +5644,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -5661,7 +5781,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -5798,7 +5918,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -5935,7 +6055,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -6072,7 +6192,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -6209,7 +6329,7 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16
    Source:
    @@ -6347,7 +6467,7 @@ This value is only set when the pointer is over this Sprite.

    Source:
    @@ -6489,7 +6609,7 @@ This value is only set when the pointer is over this Sprite.

    Source:
    @@ -6712,7 +6832,7 @@ This value is only set when the pointer is over this Sprite.

    Source:
    @@ -6740,7 +6860,7 @@ This value is only set when the pointer is over this Sprite.

    -

    start(priority, useHandCursor) → {Phaser.Sprite}

    +

    start(priority, useHandCursor) → {Phaser.Sprite}

    @@ -6889,7 +7009,7 @@ This value is only set when the pointer is over this Sprite.

    -Phaser.Sprite +Phaser.Sprite
    @@ -6945,7 +7065,7 @@ This value is only set when the pointer is over this Sprite.

    Source:
    @@ -7083,7 +7203,7 @@ This value is only set when the pointer is over this Sprite.

    Source:
    @@ -7201,7 +7321,7 @@ This value is only set when the pointer is over this Sprite.

    Source:
    @@ -7319,7 +7439,7 @@ This value is only set when the pointer is over this Sprite.

    Source:
    @@ -7388,8 +7508,8 @@ This value is only set when the pointer is over this Sprite.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:01 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Key.html b/docs/Phaser.Key.html index 564ecb42..9535d426 100644 --- a/docs/Phaser.Key.html +++ b/docs/Phaser.Key.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2435,8 +2555,8 @@ 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 23 2013 13:52:01 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Keyboard.html b/docs/Phaser.Keyboard.html index ab37d5cd..52fba980 100644 --- a/docs/Phaser.Keyboard.html +++ b/docs/Phaser.Keyboard.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2862,8 +2982,8 @@ This is called automatically by Phaser.Input and should not normally be invoked
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:01 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.LinkedList.html b/docs/Phaser.LinkedList.html index c67232b5..81eb6ad1 100644 --- a/docs/Phaser.LinkedList.html +++ b/docs/Phaser.LinkedList.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1354,8 +1474,8 @@ The function must exist on the member.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:01 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:46 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Loader.html b/docs/Phaser.Loader.html index 000cf34b..eec2d3f3 100644 --- a/docs/Phaser.Loader.html +++ b/docs/Phaser.Loader.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2066,7 +2186,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -2324,7 +2444,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -2488,7 +2608,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -2652,7 +2772,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -2816,7 +2936,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -2980,7 +3100,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -3205,7 +3325,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -3323,7 +3443,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -3464,7 +3584,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -3582,7 +3702,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -3700,7 +3820,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -3818,7 +3938,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -3982,7 +4102,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -4100,7 +4220,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -4169,7 +4289,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -4287,7 +4407,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -4356,7 +4476,7 @@ If you do so the Sprite's width or height will be cropped based on the percentag
    Source:
    @@ -4438,7 +4558,7 @@ This allows you to easily make loading bars for games.

    -Phaser.Sprite +Phaser.Sprite @@ -4809,7 +4929,7 @@ This allows you to easily make loading bars for games.

    Source:
    @@ -4878,7 +4998,7 @@ This allows you to easily make loading bars for games.

    Source:
    @@ -5042,7 +5162,7 @@ This allows you to easily make loading bars for games.

    Source:
    @@ -5300,7 +5420,7 @@ This allows you to easily make loading bars for games.

    Source:
    @@ -5656,7 +5776,7 @@ This allows you to easily make loading bars for games.

    Source:
    @@ -5774,7 +5894,7 @@ This allows you to easily make loading bars for games.

    Source:
    @@ -5824,8 +5944,8 @@ This allows you to easily make loading bars for games.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:01 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.LoaderParser.html b/docs/Phaser.LoaderParser.html index ec747435..5ca3d17b 100644 --- a/docs/Phaser.LoaderParser.html +++ b/docs/Phaser.LoaderParser.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -586,8 +706,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:01 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.MSPointer.html b/docs/Phaser.MSPointer.html index d3a56e77..f928d333 100644 --- a/docs/Phaser.MSPointer.html +++ b/docs/Phaser.MSPointer.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1619,8 +1739,8 @@ 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 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Math.html b/docs/Phaser.Math.html index 499a808e..afd434de 100644 --- a/docs/Phaser.Math.html +++ b/docs/Phaser.Math.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -10085,8 +10205,8 @@ 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 23 2013 13:52:01 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Mouse.html b/docs/Phaser.Mouse.html index 1527a2b5..bb7eac36 100644 --- a/docs/Phaser.Mouse.html +++ b/docs/Phaser.Mouse.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2165,8 +2285,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Net.html b/docs/Phaser.Net.html index 368ad77b..065fe463 100644 --- a/docs/Phaser.Net.html +++ b/docs/Phaser.Net.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1244,8 +1364,8 @@ 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 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Particles.Arcade.Emitter.html b/docs/Phaser.Particles.Arcade.Emitter.html index 4851dc76..f024f524 100644 --- a/docs/Phaser.Particles.Arcade.Emitter.html +++ b/docs/Phaser.Particles.Arcade.Emitter.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -811,7 +931,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2092,7 +2212,7 @@ Emitter.emitX and Emitter.emitY control the emission location relative to the x/
    Source:
    @@ -3598,7 +3718,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3705,7 +3825,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3914,7 +4034,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -4762,7 +4882,7 @@ that then see the addAt method.

    Source:
    @@ -4987,7 +5107,7 @@ Group.addAll('x', 10) will add 10 to the child.x value.

    Source:
    @@ -5134,7 +5254,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -5398,7 +5518,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -5588,7 +5708,7 @@ After the callback parameter you can add as many extra parameters as you like, w
    Source:
    @@ -5786,7 +5906,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -5860,7 +5980,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -5957,7 +6077,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -6008,7 +6128,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    -

    create(x, y, key, frame, exists) → {Phaser.Sprite}

    +

    create(x, y, key, frame, exists) → {Phaser.Sprite}

    @@ -6269,7 +6389,7 @@ Useful if you don't need to create the Sprite instances before-hand.

    Source:
    @@ -6305,7 +6425,7 @@ Useful if you don't need to create the Sprite instances before-hand.

    -Phaser.Sprite +Phaser.Sprite
    @@ -6547,7 +6667,7 @@ and will be positioned at 0, 0 (relative to the Group.x/y)

    Source:
    @@ -6621,7 +6741,7 @@ and will be positioned at 0, 0 (relative to the Group.x/y)

    Source:
    @@ -6814,7 +6934,7 @@ Group.divideAll('x', 2) will half the child.x value.

    Source:
    @@ -6957,7 +7077,7 @@ Group.divideAll('x', 2) will half the child.x value.

    Source:
    @@ -7197,7 +7317,7 @@ For example: Group.forEach(awardBonusGold, this, true, 100, 500)

    Source:
    @@ -7345,7 +7465,7 @@ For example: Group.forEachAlive(causeDamage, this, 500)

    Source:
    @@ -7493,7 +7613,7 @@ For example: Group.forEachDead(bringToLife, this)

    Source:
    @@ -7616,7 +7736,7 @@ For example: Group.forEachDead(bringToLife, this)

    Source:
    @@ -7714,7 +7834,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -7812,7 +7932,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -7958,7 +8078,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -8104,7 +8224,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -8273,7 +8393,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -8779,7 +8899,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.

    Source:
    @@ -8902,7 +9022,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.

    Source:
    @@ -8977,7 +9097,7 @@ The Group container remains on the display list.

    Source:
    @@ -9123,7 +9243,7 @@ The Group container remains on the display list.

    Source:
    @@ -9269,7 +9389,7 @@ The Group container remains on the display list.

    Source:
    @@ -9631,7 +9751,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9879,7 +9999,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -10823,7 +10943,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -10969,7 +11089,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -11111,8 +11231,8 @@ Group.subAll('x', 10) will minus 10 from the child.x value.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Particles.html b/docs/Phaser.Particles.html index bbe241c6..b84e1ee9 100644 --- a/docs/Phaser.Particles.html +++ b/docs/Phaser.Particles.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1035,8 +1155,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Physics.Arcade.html b/docs/Phaser.Physics.Arcade.html new file mode 100644 index 00000000..63aeeb4c --- /dev/null +++ b/docs/Phaser.Physics.Arcade.html @@ -0,0 +1,6408 @@ + + + + + + Phaser Class: Arcade + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Arcade

    +
    + +
    +

    + Phaser.Physics. + + Arcade +

    + +

    Arcade Physics Constructor

    + +
    + +
    +
    + + + + +
    +

    new Arcade(game)

    + + +
    +
    + + +
    +

    Arcade Physics constructor.

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

    reference to the current game instance.

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

    Members

    + +
    + +
    +

    maxLevels :number

    + + +
    +
    + +
    +

    Used by the QuadTree to set the maximum number of levels

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

    maxObjects :number

    + + +
    +
    + +
    +

    Used by the QuadTree to set the maximum number of objects

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

    Methods

    + +
    + +
    +

    accelerateToObject(displayObject, destination, speed, xSpeedMax, ySpeedMax) → {number}

    + + +
    +
    + + +
    +

    Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.) +You must give a maximum speed value, beyond which the display object won't go any faster. +Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. +Note: The display object doesn't stop moving once it reaches the destination coordinates.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    displayObject + + +any + + + + + + + + + + + +

    The display object to move.

    destination + + +any + + + + + + + + + + + +

    The display object to move towards. Can be any object but must have visible x/y properties.

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will accelerate in pixels per second.

    xSpeedMax + + +number + + + + + + <optional>
    + + + + + +
    + + 500 + +

    The maximum x velocity the display object can reach.

    ySpeedMax + + +number + + + + + + <optional>
    + + + + + +
    + + 500 + +

    The maximum y velocity the display object can reach.

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

    The angle (in radians) that the object should be visually set to in order to match its new trajectory.

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

    accelerateToPointer(displayObject, pointer, speed, xSpeedMax, ySpeedMax) → {number}

    + + +
    +
    + + +
    +

    Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.) +You must give a maximum speed value, beyond which the display object won't go any faster. +Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. +Note: The display object doesn't stop moving once it reaches the destination coordinates.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    displayObject + + +any + + + + + + + + + + + +

    The display object to move.

    pointer + + +Phaser.Pointer + + + + + + <optional>
    + + + + + +
    + +

    The pointer to move towards. Defaults to Phaser.Input.activePointer.

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will accelerate in pixels per second.

    xSpeedMax + + +number + + + + + + <optional>
    + + + + + +
    + + 500 + +

    The maximum x velocity the display object can reach.

    ySpeedMax + + +number + + + + + + <optional>
    + + + + + +
    + + 500 + +

    The maximum y velocity the display object can reach.

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

    The angle (in radians) that the object should be visually set to in order to match its new trajectory.

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

    accelerateToXY(displayObject, x, y, speed, xSpeedMax, ySpeedMax) → {number}

    + + +
    +
    + + +
    +

    Sets the acceleration.x/y property on the display object so it will move towards the x/y coordinates at the given speed (in pixels per second sq.) +You must give a maximum speed value, beyond which the display object won't go any faster. +Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. +Note: The display object doesn't stop moving once it reaches the destination coordinates.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    displayObject + + +any + + + + + + + + + + + +

    The display object to move.

    x + + +number + + + + + + + + + + + +

    The x coordinate to accelerate towards.

    y + + +number + + + + + + + + + + + +

    The y coordinate to accelerate towards.

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will accelerate in pixels per second.

    xSpeedMax + + +number + + + + + + <optional>
    + + + + + +
    + + 500 + +

    The maximum x velocity the display object can reach.

    ySpeedMax + + +number + + + + + + <optional>
    + + + + + +
    + + 500 + +

    The maximum y velocity the display object can reach.

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

    The angle (in radians) that the object should be visually set to in order to match its new trajectory.

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

    accelerationFromRotation(rotation, speed, point) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object. +One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    rotation + + +number + + + + + + + + + + + +

    The angle in radians.

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will move, in pixels per second sq.

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

    The Point object in which the x and y properties will be set to the calculated acceleration.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +
      +
    • A Point where point.x contains the acceleration x value and point.y contains the acceleration y value.
    • +
    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Point + + +
    +
    + + + + + +
    + + + +
    +

    angleBetween(source, target) → {number}

    + + +
    +
    + + +
    +

    Find the angle in radians between two display objects (like Sprites).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    source + + +any + + + +

    The Display Object to test from.

    target + + +any + + + +

    The Display Object to test to.

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

    The angle in radians between the source and target display objects.

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

    angleToPointer(displayObject, pointer) → {number}

    + + +
    +
    + + +
    +

    Find the angle in radians between a display object (like a Sprite) and a Pointer, taking their x/y and center into account.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    displayObject + + +any + + + + + + + + + +

    The Display Object to test from.

    pointer + + +Phaser.Pointer + + + + + + <optional>
    + + + + + +

    The Phaser.Pointer to test to. If none is given then Input.activePointer is used.

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

    The angle in radians between displayObject.x/y to Pointer.x/y

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

    angleToXY(displayObject, x, y) → {number}

    + + +
    +
    + + +
    +

    Find the angle in radians between a display object (like a Sprite) and the given x/y coordinate.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    displayObject + + +any + + + +

    The Display Object to test from.

    x + + +number + + + +

    The x coordinate to get the angle to.

    y + + +number + + + +

    The y coordinate to get the angle to.

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

    The angle in radians between displayObject.x/y to Pointer.x/y

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

    collide(object1, object2, collideCallback, processCallback, callbackContext) → {number}

    + + +
    +
    + + +
    +

    Checks for collision between two game objects. The objects can be Sprites, Groups, Emitters or Tilemaps. +You can perform Sprite vs. Sprite, Sprite vs. Group, Group vs. Group, Sprite vs. Tilemap or Group vs. Tilemap collisions. +The objects are also automatically separated.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    object1 + + +Phaser.Sprite +| + +Phaser.Group +| + +Phaser.Particles.Emitter +| + +Phaser.Tilemap + + + + + + + + + + + +

    The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.Tilemap

    object2 + + +Phaser.Sprite +| + +Phaser.Group +| + +Phaser.Particles.Emitter +| + +Phaser.Tilemap + + + + + + + + + + + +

    The second object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.Tilemap

    collideCallback + + +function + + + + + + <optional>
    + + + + + +
    + + null + +

    An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you passed them to Collision.overlap.

    processCallback + + +function + + + + + + <optional>
    + + + + + +
    + + null + +

    A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collideCallback will only be called if processCallback returns true.

    callbackContext + + +object + + + + + + <optional>
    + + + + + +
    + +

    The context in which to run the callbacks.

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

    The number of collisions that were processed.

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

    computeVelocity(axis, body, velocity, acceleration, drag, mMax) → {number}

    + + +
    +
    + + +
    +

    A tween-like function that takes a starting velocity and some other factors and returns an altered velocity.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    axis + + +number + + + +

    1 for horizontal, 2 for vertical.

    body + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to be updated.

    velocity + + +number + + + +

    Any component of velocity (e.g. 20).

    acceleration + + +number + + + +

    Rate at which the velocity is changing.

    drag + + +number + + + +

    Really kind of a deceleration, this is how much the velocity changes if Acceleration is not set.

    mMax + + +number + + + +

    An absolute value cap for the velocity.

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

    The altered Velocity value.

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

    distanceBetween(source, target) → {number}

    + + +
    +
    + + +
    +

    Find the distance between two display objects (like Sprites).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    source + + +any + + + +

    The Display Object to test from.

    target + + +any + + + +

    The Display Object to test to.

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

    The distance between the source and target objects.

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

    distanceToPointer(displayObject, pointer) → {number}

    + + +
    +
    + + +
    +

    Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used. +The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. +If you need to calculate from the center of a display object instead use the method distanceBetweenCenters()

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    displayObject + + +any + + + + + + + + + +

    The Display Object to test from.

    pointer + + +Phaser.Pointer + + + + + + <optional>
    + + + + + +

    The Phaser.Pointer to test to. If none is given then Input.activePointer is used.

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

    The distance between the object and the Pointer.

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

    distanceToXY(displayObject, x, y) → {number}

    + + +
    +
    + + +
    +

    Find the distance between a display object (like a Sprite) and the given x/y coordinates. +The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. +If you need to calculate from the center of a display object instead use the method distanceBetweenCenters()

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    displayObject + + +any + + + +

    The Display Object to test from.

    x + + +number + + + +

    The x coordinate to move towards.

    y + + +number + + + +

    The y coordinate to move towards.

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

    The distance between the object and the x/y coordinates.

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

    moveToObject(displayObject, destination, speed, maxTime) → {number}

    + + +
    +
    + + +
    +

    Move the given display object towards the destination object at a steady velocity. +If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. +Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. +Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. +Note: The display object doesn't stop moving once it reaches the destination coordinates. +Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    displayObject + + +any + + + + + + + + + + + +

    The display object to move.

    destination + + +any + + + + + + + + + + + +

    The display object to move towards. Can be any object but must have visible x/y properties.

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will move, in pixels per second (default is 60 pixels/sec)

    maxTime + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.

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

    The angle (in radians) that the object should be visually set to in order to match its new velocity.

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

    moveToPointer(displayObject, speed, pointer, maxTime) → {number}

    + + +
    +
    + + +
    +

    Move the given display object towards the pointer at a steady velocity. If no pointer is given it will use Phaser.Input.activePointer. +If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. +Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. +Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. +Note: The display object doesn't stop moving once it reaches the destination coordinates.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    displayObject + + +any + + + + + + + + + + + +

    The display object to move.

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will move, in pixels per second (default is 60 pixels/sec)

    pointer + + +Phaser.Pointer + + + + + + <optional>
    + + + + + +
    + +

    The pointer to move towards. Defaults to Phaser.Input.activePointer.

    maxTime + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.

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

    The angle (in radians) that the object should be visually set to in order to match its new velocity.

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

    moveToXY(displayObject, x, y, speed, maxTime) → {number}

    + + +
    +
    + + +
    +

    Move the given display object towards the x/y coordinates at a steady velocity. +If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. +Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. +Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. +Note: The display object doesn't stop moving once it reaches the destination coordinates. +Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all)

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    displayObject + + +any + + + + + + + + + + + +

    The display object to move.

    x + + +number + + + + + + + + + + + +

    The x coordinate to move towards.

    y + + +number + + + + + + + + + + + +

    The y coordinate to move towards.

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will move, in pixels per second (default is 60 pixels/sec)

    maxTime + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms.

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

    The angle (in radians) that the object should be visually set to in order to match its new velocity.

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

    overlap(object1, object2) → {boolean}

    + + +
    +
    + + +
    +

    Checks if two Sprite objects overlap.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    object1 + + +Phaser.Sprite + + + +

    The first object to check. Can be an instance of Phaser.Sprite or anything that extends it.

    object2 + + +Phaser.Sprite + + + +

    The second object to check. Can be an instance of Phaser.Sprite or anything that extends it.

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

    true if the two objects overlap.

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

    <protected> postUpdate()

    + + +
    +
    + + +
    +

    Called automatically by the core game loop.

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

    <protected> preUpdate()

    + + +
    +
    + + +
    +

    Called automatically by the core game loop.

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

    separate(body1, body2) → {boolean}

    + + +
    +
    + + +
    +

    The core separation function to separate two physics bodies.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body1 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

    body2 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

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

    Returns true if the bodies were separated, otherwise false.

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

    separateTile(body1, tile) → {boolean}

    + + +
    +
    + + +
    +

    The core separation function to separate a physics body and a tile.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body1 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

    tile + + +Phaser.Tile + + + +

    The tile to collide against.

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

    Returns true if the bodies were separated, otherwise false.

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

    separateTileX(body1, tile) → {boolean}

    + + +
    +
    + + +
    +

    The core separation function to separate a physics body and a tile on the x axis.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body1 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

    tile + + +Phaser.Tile + + + +

    The tile to collide against.

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

    Returns true if the bodies were separated, otherwise false.

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

    separateTileY(body1, tile) → {boolean}

    + + +
    +
    + + +
    +

    The core separation function to separate a physics body and a tile on the x axis.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body1 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

    tile + + +Phaser.Tile + + + +

    The tile to collide against.

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

    Returns true if the bodies were separated, otherwise false.

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

    separateX(body1, body2) → {boolean}

    + + +
    +
    + + +
    +

    The core separation function to separate two physics bodies on the x axis.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body1 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

    body2 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

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

    Returns true if the bodies were separated, otherwise false.

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

    separateY(body1, body2) → {boolean}

    + + +
    +
    + + +
    +

    The core separation function to separate two physics bodies on the y axis.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body1 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

    body2 + + +Phaser.Physics.Arcade.Body + + + +

    The Body object to separate.

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

    Returns true if the bodies were separated, otherwise false.

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

    updateMotion(The)

    + + +
    +
    + + +
    +

    Called automatically by a Physics body, it updates all motion related values on the Body.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    The + + +Phaser.Physics.Arcade.Body + + + +

    Body object to be updated.

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

    velocityFromAngle(angle, speed, point) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object. +One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    angle + + +number + + + + + + + + + + + +

    The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative)

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will move, in pixels per second sq.

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

    The Point object in which the x and y properties will be set to the calculated velocity.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +
      +
    • A Point where point.x contains the velocity x value and point.y contains the velocity y value.
    • +
    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Point + + +
    +
    + + + + + +
    + + + +
    +

    velocityFromRotation(rotation, speed, point) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object. +One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    rotation + + +number + + + + + + + + + + + +

    The angle in radians.

    speed + + +number + + + + + + <optional>
    + + + + + +
    + + 60 + +

    The speed it will move, in pixels per second sq.

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

    The Point object in which the x and y properties will be set to the calculated velocity.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +
      +
    • A Point where point.x contains the velocity x value and point.y contains the velocity y value.
    • +
    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Point + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.html b/docs/Phaser.Physics.html new file mode 100644 index 00000000..339633ee --- /dev/null +++ b/docs/Phaser.Physics.html @@ -0,0 +1,612 @@ + + + + + + Phaser Class: Physics + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Physics

    +
    + +
    +

    + Phaser. + + Physics +

    + +
    + +
    +
    + + + + +
    +

    new Physics()

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

    Classes

    + +
    +
    Arcade
    +
    +
    + + + + + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Plugin.html b/docs/Phaser.Plugin.html index 2366b40d..f5257f37 100644 --- a/docs/Phaser.Plugin.html +++ b/docs/Phaser.Plugin.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1706,8 +1826,8 @@ It is only called if active is set to true.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.PluginManager.html b/docs/Phaser.PluginManager.html index f6c39dea..a4886e8d 100644 --- a/docs/Phaser.PluginManager.html +++ b/docs/Phaser.PluginManager.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1336,8 +1456,8 @@ It only calls plugins who have active=true.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Point.html b/docs/Phaser.Point.html index 12cb2824..4ef47585 100644 --- a/docs/Phaser.Point.html +++ b/docs/Phaser.Point.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -4896,8 +5016,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Pointer.html b/docs/Phaser.Pointer.html index 7a88f5b7..15d132e6 100644 --- a/docs/Phaser.Pointer.html +++ b/docs/Phaser.Pointer.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -4739,8 +4859,8 @@ Default size of 44px (Apple's recommended "finger tip" size).


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.QuadTree.html b/docs/Phaser.QuadTree.html index 524130d1..9947a438 100644 --- a/docs/Phaser.QuadTree.html +++ b/docs/Phaser.QuadTree.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1205,8 +1325,8 @@ Split the node into 4 subnodes


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:02 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.RandomDataGenerator.html b/docs/Phaser.RandomDataGenerator.html index ff2e4bdc..c893b200 100644 --- a/docs/Phaser.RandomDataGenerator.html +++ b/docs/Phaser.RandomDataGenerator.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1898,8 +2018,8 @@ Random number generator from - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Rectangle.html b/docs/Phaser.Rectangle.html index 7f14f162..f7c069a4 100644 --- a/docs/Phaser.Rectangle.html +++ b/docs/Phaser.Rectangle.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -652,7 +772,7 @@
    Source:
    @@ -758,7 +878,7 @@
    Source:
    @@ -864,7 +984,7 @@
    Source:
    @@ -970,7 +1090,7 @@
    Source:
    @@ -1077,7 +1197,7 @@ If set to true then all of the Rectangle properties are set to 0.

    Source:
    @@ -1179,7 +1299,7 @@ If set to true then all of the Rectangle properties are set to 0.

    Source:
    @@ -1281,7 +1401,7 @@ If set to true then all of the Rectangle properties are set to 0.

    Source:
    @@ -1489,7 +1609,7 @@ If set to true then all of the Rectangle properties are set to 0.

    Source:
    @@ -1595,7 +1715,7 @@ If set to true then all of the Rectangle properties are set to 0.

    Source:
    @@ -1701,7 +1821,7 @@ If set to true then all of the Rectangle properties are set to 0.

    Source:
    @@ -1808,7 +1928,7 @@ However it does affect the height property, whereas changing the y value does no
    Source:
    @@ -1914,7 +2034,7 @@ However it does affect the height property, whereas changing the y value does no
    Source:
    @@ -2020,7 +2140,7 @@ However it does affect the height property, whereas changing the y value does no
    Source:
    @@ -2483,7 +2603,7 @@ However it does affect the height property, whereas changing the y value does no
    Source:
    @@ -2666,7 +2786,7 @@ However it does affect the height property, whereas changing the y value does no
    Source:
    @@ -2830,7 +2950,7 @@ However it does affect the height property, whereas changing the y value does no
    Source:
    @@ -2995,7 +3115,7 @@ A Rectangle object is said to contain another if the second Rectangle object fal
    Source:
    @@ -3160,7 +3280,7 @@ This method compares the x, y, width and height properties of each Rectangle.

    Source:
    @@ -3347,7 +3467,7 @@ This method compares the x, y, width and height properties of each Rectangle.

    Source:
    @@ -3511,7 +3631,7 @@ This method compares the x, y, width and height properties of each Rectangle.

    Source:
    @@ -3726,7 +3846,7 @@ This method compares the x, y, width and height properties of each Rectangle.

    Source:
    @@ -3891,7 +4011,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -4124,7 +4244,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -4308,7 +4428,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -4523,7 +4643,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -4676,7 +4796,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -4836,7 +4956,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -4978,7 +5098,7 @@ A Rectangle object is said to contain another if the second Rectangle object fal
    Source:
    @@ -5119,7 +5239,7 @@ A Rectangle object is said to contain another if the second Rectangle object fal
    Source:
    @@ -5260,7 +5380,7 @@ A Rectangle object is said to contain another if the second Rectangle object fal
    Source:
    @@ -5402,7 +5522,7 @@ This method compares the x, y, width and height properties of each Rectangle.

    Source:
    @@ -5517,6 +5637,75 @@ This method compares the x, y, width and height properties of each Rectangle.

    + + + +
    +

    floorAll()

    + + +
    +
    + + +
    +

    Runs Math.floor() on the x, y, width and height values of this Rectangle.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + +
    @@ -5635,7 +5824,7 @@ This method compares the x, y, width and height properties of each Rectangle.

    Source:
    @@ -5799,7 +5988,7 @@ This method compares the x, y, width and height properties of each Rectangle.

    Source:
    @@ -5964,7 +6153,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -6197,7 +6386,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -6865,7 +7054,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -6957,7 +7146,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -7141,7 +7330,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Source:
    @@ -7214,8 +7403,8 @@ This method checks the x, y, width, and height properties of the Rectangles.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.RenderTexture.html b/docs/Phaser.RenderTexture.html new file mode 100644 index 00000000..4d406da5 --- /dev/null +++ b/docs/Phaser.RenderTexture.html @@ -0,0 +1,1452 @@ + + + + + + Phaser Class: RenderTexture + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: RenderTexture

    +
    + +
    +

    + Phaser. + + RenderTexture +

    + +

    Phaser.RenderTexture

    + +
    + +
    +
    + + + + +
    +

    new RenderTexture(game, key, width, height)

    + + +
    +
    + + +
    +

    A dynamic initially blank canvas to which images can be drawn

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

    Current game instance.

    key + + +string + + + +

    Asset key for the render texture.

    width + + +number + + + +

    the width of the render texture.

    height + + +number + + + +

    the height of the render texture.

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

    Members

    + +
    + +
    +

    frame

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    frame + + +Description + + + +

    Description.

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

    game

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

    A reference to the currently running game.

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

    height

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

    the height.

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

    indetityMatrix

    + + +
    +
    + +
    +

    I know this has a typo in it, but it's because the PIXI.RenderTexture does and we need to pair-up with it +once they update pixi to fix the typo, we'll fix it here too :)

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    indetityMatrix + + +Description + + + +

    Description.

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

    name

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + +

    the name of the object.

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

    type

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +Description + + + +

    Description.

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

    width

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

    the width.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.RequestAnimationFrame.html b/docs/Phaser.RequestAnimationFrame.html index 1dc5fb53..f2ef9d0d 100644 --- a/docs/Phaser.RequestAnimationFrame.html +++ b/docs/Phaser.RequestAnimationFrame.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1208,8 +1328,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Signal.html b/docs/Phaser.Signal.html index e1014a0b..f3235e32 100644 --- a/docs/Phaser.Signal.html +++ b/docs/Phaser.Signal.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1696,7 +1816,7 @@ already dispatched before.

    -Function +function @@ -2193,8 +2313,8 @@ already dispatched before.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Sound.html b/docs/Phaser.Sound.html index 0b3a284a..a9813371 100644 --- a/docs/Phaser.Sound.html +++ b/docs/Phaser.Sound.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -798,7 +918,7 @@
    Source:
    @@ -1224,7 +1344,7 @@
    Source:
    @@ -1326,7 +1446,7 @@
    Source:
    @@ -1435,7 +1555,7 @@
    Source:
    @@ -1855,7 +1975,7 @@
    Source:
    @@ -2070,7 +2190,7 @@
    Source:
    @@ -2176,7 +2296,7 @@
    Source:
    @@ -2282,7 +2402,7 @@
    Source:
    @@ -2388,7 +2508,7 @@
    Source:
    @@ -2494,7 +2614,7 @@
    Source:
    @@ -2600,7 +2720,7 @@
    Source:
    @@ -2706,7 +2826,7 @@
    Source:
    @@ -2812,7 +2932,7 @@
    Source:
    @@ -2921,7 +3041,7 @@
    Source:
    @@ -3030,7 +3150,219 @@
    Source:
    + + + + + + + +
    + + + + + + + +
    +

    pausedPosition

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pausedPosition + + +number + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    pausedTime

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pausedTime + + +number + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -3139,7 +3471,7 @@
    Source:
    @@ -3309,7 +3641,7 @@ - autoplay + stopTime @@ -3350,14 +3682,11 @@ -
    Default Value:
    -
    • 0
    -
    Source:
    @@ -3572,7 +3901,7 @@
    Source:
    @@ -3678,7 +4007,7 @@
    Source:
    @@ -3780,7 +4109,7 @@
    Source:
    @@ -4000,7 +4329,7 @@
    Source:
    @@ -4283,7 +4612,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -4352,7 +4681,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -4646,7 +4975,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -4787,7 +5116,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -5042,7 +5371,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -5111,7 +5440,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -5229,7 +5558,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -5298,7 +5627,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -5367,7 +5696,7 @@ This allows you to bundle multiple sounds together into a single audio file and
    Source:
    @@ -5417,8 +5746,8 @@ This allows you to bundle multiple sounds together into a single audio file and
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.SoundManager.html b/docs/Phaser.SoundManager.html index 475e87b7..dedced84 100644 --- a/docs/Phaser.SoundManager.html +++ b/docs/Phaser.SoundManager.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2325,8 +2445,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Sprite.html b/docs/Phaser.Sprite.html new file mode 100644 index 00000000..2c251b46 --- /dev/null +++ b/docs/Phaser.Sprite.html @@ -0,0 +1,7799 @@ + + + + + + Phaser Class: Sprite + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Sprite

    +
    + +
    +

    + Phaser. + + Sprite +

    + +

    Phaser.Sprite

    + +
    + +
    +
    + + + + +
    +

    new Sprite(game, x, y, key, frame)

    + + +
    +
    + + +
    +

    Create a new Sprite object. Sprites are the lifeblood of your game, used for nearly everything visual. +At its most basic a Sprite consists of a set of coordinates and a texture that is rendered to the canvas. +They also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input), +events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases.

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

    A reference to the currently running game.

    x + + +number + + + +

    The x coordinate (in world space) to position the Sprite at.

    y + + +number + + + +

    The y coordinate (in world space) to position the Sprite at.

    key + + +string +| + +Phaser.RenderTexture +| + +PIXI.Texture + + + +

    This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.

    frame + + +string +| + +number + + + +

    If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.

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

    Members

    + +
    + +
    +

    alive

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    alive + + +boolean + + + +

    This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering.

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

    anchor

    + + +
    +
    + +
    +

    The anchor sets the origin point of the texture. +The default is 0,0 this means the textures origin is the top left +Setting than anchor to 0.5,0.5 means the textures origin is centered +Setting the anchor to 1,1 would mean the textures origin points will be the bottom right

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    anchor + + +Phaser.Point + + + +

    The anchor around with Sprite rotation and scaling takes place.

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

    angle

    + + +
    +
    + +
    +

    Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. +Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. +If you wish to work in radians instead of degrees use the property Sprite.rotation instead.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    angle + + +number + + + +

    Gets or sets the Sprites angle of rotation in degrees.

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

    animations

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    animations + + +Phaser.AnimationManager + + + +

    This manages animations of the sprite. You can modify animations through it (see Phaser.AnimationManager)

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

    autoCull

    + + +
    +
    + +
    +

    Should this Sprite be automatically culled if out of range of the camera? +A culled sprite has its renderable property set to 'false'.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    autoCull + + +boolean + + + +

    A flag indicating if the Sprite should be automatically camera culled or not.

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

    body

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body + + +Phaser.Physics.Arcade.Body + + + +

    By default Sprites have a Phaser.Physics Body attached to them. You can operate physics actions via this property, or null it to skip all physics updates.

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

    bottomLeft

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bottomLeft + + +Phaser.Point + + + +

    A Point containing the bottom left coordinate of the Sprite. Takes rotation and scale into account.

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

    bottomRight

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bottomRight + + +Phaser.Point + + + +

    A Point containing the bottom right coordinate of the Sprite. Takes rotation and scale into account.

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

    bounds

    + + +
    +
    + +
    +

    This Rectangle object fully encompasses the Sprite and is updated in real-time. +The bounds is the full bounding area after rotation and scale have been taken into account. It should not be modified directly. +It's used for Camera culling and physics body alignment.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bounds + + +Phaser.Rectangle + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    center

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    center + + +Phaser.Point + + + +

    A Point containing the center coordinate of the Sprite. Takes rotation and scale into account.

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

    crop

    + + +
    +
    + +
    +

    You can crop the Sprites texture by modifying the crop properties. For example crop.width = 50 would set the Sprite to only render 50px wide. +The crop is only applied if you have set Sprite.cropEnabled to true.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    crop + + +Phaser.Rectangle + + + +

    The crop Rectangle applied to the Sprite texture before rendering.

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

    cropEnabled

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    cropEnabled + + +boolean + + + +

    If true the Sprite.crop property is used to crop the texture before render. Set to false to disable.

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

    currentFrame

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    currentFrame + + +Phaser.Frame + + + +

    A reference to the currently displayed frame.

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

    events

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    events + + +Events + + + +

    The Events you can subscribe to that are dispatched when certain things happen on this Sprite or its components.

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

    exists

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    exists + + +boolean + + + +

    If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all.

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

    fixedToCamera

    + + +
    +
    + +
    +

    A Sprite that is fixed to the camera ignores the position of any ancestors in the display list and uses its x/y coordinates as offsets from the top left of the camera.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    fixedToCamera + + +boolean + + + +

    Fixes this Sprite to the Camera.

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

    frame

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    frame + + +number + + + +

    Gets or sets the current frame index and updates the Texture Cache for display.

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

    frameName

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    frameName + + +string + + + +

    Gets or sets the current frame name and updates the Texture Cache for display.

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

    game

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

    A reference to the currently running Game.

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

    group

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    group + + +Phaser.Group + + + +

    The parent Group of this Sprite. This is usually set after Sprite instantiation by the parent.

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

    health

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    health + + +number + + + +

    Health value. Used in combination with damage() to allow for quick killing of Sprites.

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

    height

    + + +
    +
    + +
    +

    The height of the sprite in pixels, setting this will actually modify the scale to acheive the value desired. +If you wish to crop the Sprite instead see the Sprite.crop value.

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

    The height of the Sprite in pixels.

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

    <readonly> inCamera

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    inCamera + + +boolean + + + +

    Is this sprite visible to the camera or not?

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

    input

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    input + + +InputHandler + + + +

    The Input Handler Component.

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

    inputEnabled

    + + +
    +
    + +
    +

    By default a Sprite won't process any input events at all. By setting inputEnabled to true the Phaser.InputHandler is +activated for this Sprite instance and it will then start to process click/touch events and more.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    inputEnabled + + +boolean + + + +

    Set to true to allow this Sprite to receive input events, otherwise false.

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

    inWorld

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    inWorld + + +boolean + + + +

    This value is set to true if the Sprite is positioned within the World, otherwise false.

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

    inWorldThreshold

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    inWorldThreshold + + +number + + + +

    A threshold value applied to the inWorld check. If you don't want a Sprite to be considered "out of the world" until at least 100px away for example then set it to 100.

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

    key

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    key + + +string +| + +Phaser.RenderTexture +| + +PIXI.Texture + + + +

    This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.

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

    lifespan

    + + +
    +
    + +
    +

    If you would like the Sprite to have a lifespan once 'born' you can set this to a positive value. Handy for particles, bullets, etc. +The lifespan is decremented by game.time.elapsed each update, once it reaches zero the kill() function is called.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    lifespan + + +number + + + +

    The lifespan of the Sprite (in ms) before it will be killed.

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

    name

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + +

    The user defined name given to this Sprite.

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

    offset

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    offset + + +Phaser.Point + + + +

    Corner point defaults. Should not typically be modified.

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

    outOfBoundsKill

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    outOfBoundsKill + + +boolean + + + +

    If true the Sprite is killed as soon as Sprite.inWorld is false.

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

    renderOrderID

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    renderOrderID + + +number + + + +

    Used by the Renderer and Input Manager to control picking order.

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

    scale

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    scale + + +Phaser.Point + + + +

    The scale of the Sprite when rendered. By default it's set to 1 (no scale). You can modify it via scale.x or scale.y or scale.setTo(x, y). A value of 1 means no change to the scale, 0.5 means "half the size", 2 means "twice the size", etc.

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

    topLeft

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    topLeft + + +Phaser.Point + + + +

    A Point containing the top left coordinate of the Sprite. Takes rotation and scale into account.

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

    topRight

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    topRight + + +Phaser.Point + + + +

    A Point containing the top right coordinate of the Sprite. Takes rotation and scale into account.

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

    type

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +number + + + +

    The const type of this object.

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

    width

    + + +
    +
    + +
    +

    The width of the sprite in pixels, setting this will actually modify the scale to acheive the value desired. +If you wish to crop the Sprite instead see the Sprite.crop value.

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

    The width of the Sprite in pixels.

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

    x

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    The x coordinate (in world space) of this Sprite.

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

    y

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    y + + +number + + + +

    The y coordinate (in world space) of this Sprite.

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

    Methods

    + +
    + +
    +

    bringToTop()

    + + +
    +
    + + +
    +

    Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only +bought to the top of that Group, not the entire display list.

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

    (Phaser.Sprite) This instance.

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

    centerOn(x, y)

    + + +
    +
    + + +
    +

    Moves the sprite so its center is located on the given x and y coordinates. +Doesn't change the anchor point of the sprite.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    The x coordinate (in world space) to position the Sprite at.

    y + + +number + + + +

    The y coordinate (in world space) to position the Sprite at.

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

    (Phaser.Sprite) This instance.

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

    damage(amount)

    + + +
    +
    + + +
    +

    Damages the Sprite, this removes the given amount from the Sprites health property. +If health is then taken below zero Sprite.kill is called.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    amount + + +number + + + +

    The amount to subtract from the Sprite.health value.

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

    (Phaser.Sprite) This instance.

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

    deltaAbsX() → {number}

    + + +
    +
    + + +
    +

    Returns the absolute delta x value.

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

    The absolute delta value.

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

    deltaAbsY() → {number}

    + + +
    +
    + + +
    +

    Returns the absolute delta y value.

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

    The absolute delta value.

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

    deltaX() → {number}

    + + +
    +
    + + +
    +

    Returns the delta x value.

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

    The delta value.

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

    deltaY() → {number}

    + + +
    +
    + + +
    +

    Returns the delta y value.

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

    The delta value.

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

    destroy()

    + + +
    +
    + + +
    +

    Description.

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

    destroy()

    + + +
    +
    + + +
    +

    Destroys the Sprite. This removes it from its parent group, destroys the input, event and animation handlers if present +and nulls its reference to game, freeing it up for garbage collection.

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

    getLocalPosition(p, x, y, sx, sy) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Gets the local position of a coordinate relative to the Sprite, factoring in rotation and scale. +Mostly only used internally.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    p + + +Phaser.Point + + + +

    The Point object to store the results in.

    x + + +number + + + +

    x coordinate within the Sprite to translate.

    y + + +number + + + +

    x coordinate within the Sprite to translate.

    sx + + +number + + + +

    Scale factor to be applied.

    sy + + +number + + + +

    Scale factor to be applied.

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

    The translated point.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Point + + +
    +
    + + + + + +
    + + + +
    +

    getLocalUnmodifiedPosition(p, x, y) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Gets the local unmodified position of a coordinate relative to the Sprite, factoring in rotation and scale. +Mostly only used internally by the Input Manager, but also useful for custom hit detection.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    p + + +Phaser.Point + + + +

    The Point object to store the results in.

    x + + +number + + + +

    x coordinate within the Sprite to translate.

    y + + +number + + + +

    x coordinate within the Sprite to translate.

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

    The translated point.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Point + + +
    +
    + + + + + +
    + + + +
    +

    kill()

    + + +
    +
    + + +
    +

    Kills a Sprite. A killed Sprite has its alive, exists and visible properties all set to false. +It will dispatch the onKilled event, you can listen to Sprite.events.onKilled for the signal. +Note that killing a Sprite is a way for you to quickly recycle it in a Sprite pool, it doesn't free it up from memory. +If you don't need this Sprite any more you should call Sprite.destroy instead.

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

    (Phaser.Sprite) This instance.

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

    loadTexture(key, frame)

    + + +
    +
    + + +
    +

    Changes the Texture the Sprite is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. +This causes a WebGL texture update, so use sparingly or in low-intensity portions of your game.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    key + + +string +| + +Phaser.RenderTexture +| + +PIXI.Texture + + + +

    This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.

    frame + + +string +| + +number + + + +

    If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.

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

    play(name, frameRate, loop, killOnComplete) → {Phaser.Animation}

    + + +
    +
    + + +
    +

    Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() +If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    name + + +string + + + + + + + + + + + +

    The name of the animation to be played, e.g. "fire", "walk", "jump".

    frameRate + + +number + + + + + + <optional>
    + + + + + +
    + + null + +

    The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.

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

    Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.

    killOnComplete + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    If set to true when the animation completes (only happens if loop=false) the parent Sprite will be killed.

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

    A reference to playing Animation instance.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Animation + + +
    +
    + + + + + +
    + + + +
    +

    postUpdate()

    + + +
    +
    + + +
    +

    Internal function called by the World postUpdate cycle.

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

    preUpdate()

    + + +
    +
    + + +
    +

    Automatically called by World.preUpdate. You can create your own update in Objects that extend Phaser.Sprite.

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

    preUpdate()

    + + +
    +
    + + +
    +

    Automatically called by World.preUpdate. Handles cache updates, lifespan checks, animation updates and physics updates.

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

    reset()

    + + +
    +
    + + +
    +

    Description.

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

    reset(x, y, health)

    + + +
    +
    + + +
    +

    Resets the Sprite. This places the Sprite at the given x/y world coordinates and then +sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values. +If the Sprite has a physics body that too is reset.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    x + + +number + + + + + + + + + + + +

    The x coordinate (in world space) to position the Sprite at.

    y + + +number + + + + + + + + + + + +

    The y coordinate (in world space) to position the Sprite at.

    health + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    The health to give the Sprite.

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

    (Phaser.Sprite) This instance.

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

    resetCrop()

    + + +
    +
    + + +
    +

    Resets the Sprite.crop value back to the frame dimensions.

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

    revive(health)

    + + +
    +
    + + +
    +

    Brings a 'dead' Sprite back to life, optionally giving it the health value specified. +A resurrected Sprite has its alive, exists and visible properties all set to true. +It will dispatch the onRevived event, you can listen to Sprite.events.onRevived for the signal.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    health + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    The health to give the Sprite.

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

    (Phaser.Sprite) This instance.

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

    updateAnimation()

    + + +
    +
    + + +
    +

    Internal function called by preUpdate.

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

    updateBounds()

    + + +
    +
    + + +
    +

    Description.

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

    updateBounds()

    + + +
    +
    + + +
    +

    Internal function called by preUpdate.

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

    updateCache()

    + + +
    +
    + + +
    +

    Internal function called by preUpdate.

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

    updateCrop()

    + + +
    +
    + + +
    +

    Internal function called by preUpdate.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Stage.html b/docs/Phaser.Stage.html index 5adc7e26..e72d9ee0 100644 --- a/docs/Phaser.Stage.html +++ b/docs/Phaser.Stage.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -708,7 +828,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
    Source:
    @@ -819,6 +939,114 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree +
    + + + +
    + + + +
    +

    checkOffsetInterval

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    checkOffsetInterval + + +number +| + +false + + + +

    The time (in ms) between which the stage should check to see if it has moved.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 2500
    + + + +
    Source:
    +
    + + + + + + +
    @@ -1241,6 +1469,75 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
    +
    +

    update()

    + + +
    +
    + + +
    +

    Runs Stage processes that need periodic updates, such as the offset checks.

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

    visibilityChange(event)

    @@ -1332,7 +1629,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
    Source:
    @@ -1382,8 +1679,8 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.StageScaleMode.html b/docs/Phaser.StageScaleMode.html index afb56453..12f9e211 100644 --- a/docs/Phaser.StageScaleMode.html +++ b/docs/Phaser.StageScaleMode.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -3719,8 +3839,8 @@ Please note that this needs to be supported by the web browser and isn't the sam
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.State.html b/docs/Phaser.State.html index 44b1f3a4..40cf1e4c 100644 --- a/docs/Phaser.State.html +++ b/docs/Phaser.State.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -469,7 +589,7 @@ It provides quick access to common functions such as the camera, cache, input, m -Phaser.GameObjectFactory +Phaser.GameObjectFactory @@ -2473,8 +2593,8 @@ 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 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.StateManager.html b/docs/Phaser.StateManager.html index 95db2d55..c85cda32 100644 --- a/docs/Phaser.StateManager.html +++ b/docs/Phaser.StateManager.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -3330,8 +3450,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:03 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Text.html b/docs/Phaser.Text.html new file mode 100644 index 00000000..0bedbd55 --- /dev/null +++ b/docs/Phaser.Text.html @@ -0,0 +1,1886 @@ + + + + + + Phaser Class: Text + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Text

    +
    + +
    +

    + Phaser. + + Text +

    + +

    Phaser.Text

    + +
    + +
    +
    + + + + +
    +

    new Text(game, x, y, text, style)

    + + +
    +
    + + +
    +

    Create a new <code>Text</code>.

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

    Current game instance.

    x + + +number + + + +

    X position of the new text object.

    y + + +number + + + +

    Y position of the new text object.

    text + + +string + + + +

    The actual text that will be written.

    style + + +object + + + +

    The style object containing style attributes like font, font size ,

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

    Members

    + +
    + +
    +

    alive

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    alive + + +boolean + + + +

    Description.

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

    anchor

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    anchor + + +Phaser.Point + + + +

    Description.

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

    exists

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    exists + + +boolean + + + +

    Description.

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

    game

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

    A reference to the currently running game.

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

    group

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    group + + +Description + + + +

    Description.

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

    name

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    name + + +string + + + +

    Description.

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

    renderable

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    renderable + + +boolean + + + +

    Description.

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

    scale

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    scale + + +Phaser.Point + + + +

    Description.

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

    type

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +Description + + + +

    Description.

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

    Methods

    + +
    + +
    +

    destroy()

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

    destroy()

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

    update()

    + + +
    +
    + + +
    +

    Automatically called by World.update.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.TileSprite.html b/docs/Phaser.TileSprite.html new file mode 100644 index 00000000..0fff887c --- /dev/null +++ b/docs/Phaser.TileSprite.html @@ -0,0 +1,1219 @@ + + + + + + Phaser Class: TileSprite + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: TileSprite

    +
    + +
    +

    + Phaser. + + TileSprite +

    + +

    Phaser.Tilemap

    + +
    + +
    +
    + + + + +
    +

    new TileSprite(game, x, y, width, height, key, frame)

    + + +
    +
    + + +
    +

    Create a new <code>TileSprite</code>.

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

    Current game instance.

    x + + +number + + + +

    X position of the new tileSprite.

    y + + +number + + + +

    Y position of the new tileSprite.

    width + + +number + + + +

    the width of the tilesprite.

    height + + +number + + + +

    the height of the tilesprite.

    key + + +string +| + +Phaser.RenderTexture +| + +PIXI.Texture + + + +

    This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.

    frame + + +string +| + +number + + + +

    If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.

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

    Members

    + +
    + +
    +

    texture

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    texture + + +Description + + + +

    Description.

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

    tilePosition

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    tilePosition + + +Point + + + +

    The offset position of the image that is being tiled.

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

    tileScale

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    tileScale + + +Point + + + +

    The scaling of the image that is being tiled.

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

    type

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    type + + +Description + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Time.html b/docs/Phaser.Time.html index ef62d104..6c4f3228 100644 --- a/docs/Phaser.Time.html +++ b/docs/Phaser.Time.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2305,7 +2425,7 @@
    Source:
    @@ -2446,7 +2566,7 @@
    Source:
    @@ -2538,7 +2658,7 @@
    Source:
    @@ -2794,8 +2914,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:04 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Touch.html b/docs/Phaser.Touch.html index f0030245..dd046bcb 100644 --- a/docs/Phaser.Touch.html +++ b/docs/Phaser.Touch.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -2445,8 +2565,8 @@ 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 23 2013 13:52:04 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Tween.html b/docs/Phaser.Tween.html index 43e8bc3b..2bb08d08 100644 --- a/docs/Phaser.Tween.html +++ b/docs/Phaser.Tween.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -3151,8 +3271,8 @@ Used in combination with repeat you can create endless loops.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:04 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.TweenManager.html b/docs/Phaser.TweenManager.html index 19e57da6..ee5fce9b 100644 --- a/docs/Phaser.TweenManager.html +++ b/docs/Phaser.TweenManager.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1507,8 +1627,8 @@ Please see https://github.com/sole/tw
    - Documentation generated by
    JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:04 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Utils.Debug.html b/docs/Phaser.Utils.Debug.html index efc59fd1..8ebe3b10 100644 --- a/docs/Phaser.Utils.Debug.html +++ b/docs/Phaser.Utils.Debug.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1686,7 +1806,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -1847,7 +1967,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2137,7 +2257,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2345,7 +2465,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2425,7 +2545,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Sprite +Phaser.Sprite @@ -2588,7 +2708,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2780,7 +2900,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2941,7 +3061,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3184,7 +3304,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3486,7 +3606,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3729,7 +3849,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3807,7 +3927,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Sprite +Phaser.Sprite @@ -3890,7 +4010,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3970,7 +4090,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Sprite +Phaser.Sprite @@ -4100,7 +4220,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -4180,7 +4300,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Sprite +Phaser.Sprite @@ -4343,7 +4463,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -4423,7 +4543,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Sprite +Phaser.Sprite @@ -4674,7 +4794,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Sprite +Phaser.Sprite @@ -4837,7 +4957,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -4917,7 +5037,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Sprite +Phaser.Sprite @@ -5080,7 +5200,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -5334,7 +5454,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -5414,7 +5534,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Sprite +Phaser.Sprite @@ -5577,7 +5697,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -5860,8 +5980,8 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:04 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:50 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Utils.html b/docs/Phaser.Utils.html index 29af7947..218c7314 100644 --- a/docs/Phaser.Utils.html +++ b/docs/Phaser.Utils.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1019,8 +1139,8 @@ dir = 1 (left), 2 (right), 3 (both)


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:04 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:50 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.World.html b/docs/Phaser.World.html index 51a398a0..bfe1e906 100644 --- a/docs/Phaser.World.html +++ b/docs/Phaser.World.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -1994,8 +2114,8 @@ If you need to adjust the bounds of the world


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:04 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:50 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.html b/docs/Phaser.html index 61ee9adf..e0e7fa60 100644 --- a/docs/Phaser.html +++ b/docs/Phaser.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -392,6 +512,15 @@
    AnimationParser
    +
    BitmapText
    +
    + +
    Bullet
    +
    + +
    Button
    +
    +
    Cache
    @@ -413,6 +542,9 @@
    Easing
    +
    Events
    +
    +
    Frame
    @@ -422,6 +554,12 @@
    Game
    +
    GameObjectFactory
    +
    + +
    Graphics
    +
    +
    Group
    @@ -461,6 +599,9 @@
    Particles
    +
    Physics
    +
    +
    Plugin
    @@ -482,6 +623,9 @@
    Rectangle
    +
    RenderTexture
    +
    +
    RequestAnimationFrame
    @@ -494,6 +638,9 @@
    SoundManager
    +
    Sprite
    +
    +
    Stage
    @@ -506,6 +653,12 @@
    StateManager
    +
    Text
    +
    + +
    TileSprite
    +
    +
    Time
    @@ -554,8 +707,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.js.html b/docs/Phaser.js.html index c2f516bb..62ba15c6 100644 --- a/docs/Phaser.js.html +++ b/docs/Phaser.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -330,10 +450,10 @@ /** * @namespace Phaser */ -var Phaser = Phaser || { +var Phaser = Phaser || { - VERSION: '1.1.0', - GAMES: [], + VERSION: '<%= version %>', + GAMES: [], AUTO: 0, CANVAS: 1, WEBGL: 2, @@ -362,7 +482,8 @@ var Phaser = Phaser || { PIXI.InteractionManager = function (dummy) { // We don't need this in Pixi, so we've removed it to save space // however the Stage object expects a reference to it, so here is a dummy entry. -}; +}; + @@ -382,8 +503,8 @@ PIXI.InteractionManager = function (dummy) {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Plugin.js.html b/docs/Plugin.js.html index d781cc54..5fae9c1c 100644 --- a/docs/Plugin.js.html +++ b/docs/Plugin.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -456,8 +576,8 @@ Phaser.Plugin.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/PluginManager.js.html b/docs/PluginManager.js.html index 32e281f1..3ee07220 100644 --- a/docs/PluginManager.js.html +++ b/docs/PluginManager.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -573,8 +693,8 @@ Phaser.PluginManager.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Point.js.html b/docs/Point.js.html index 6c893032..e0b13c5b 100644 --- a/docs/Point.js.html +++ b/docs/Point.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -738,8 +858,8 @@ Phaser.Point.rotate = function (a, x, y, angle, asDegrees, distance) {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Pointer.js.html b/docs/Pointer.js.html index f8a4d99f..55c1a964 100644 --- a/docs/Pointer.js.html +++ b/docs/Pointer.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -604,7 +724,7 @@ Phaser.Pointer.prototype = { this.game.input.x = this.x * this.game.input.scale.x; this.game.input.y = this.y * this.game.input.scale.y; this.game.input.position.setTo(this.x, this.y); - this.game.input.onDown.dispatch(this); + this.game.input.onDown.dispatch(this, event); this.game.input.resetSpeed(this.x, this.y); } @@ -829,7 +949,7 @@ Phaser.Pointer.prototype = { if (this.game.input.multiInputOverride == Phaser.Input.MOUSE_OVERRIDES_TOUCH || this.game.input.multiInputOverride == Phaser.Input.MOUSE_TOUCH_COMBINE || (this.game.input.multiInputOverride == Phaser.Input.TOUCH_OVERRIDES_MOUSE && this.game.input.currentPointers == 0)) { - this.game.input.onUp.dispatch(this); + this.game.input.onUp.dispatch(this, event); // Was it a tap? if (this.duration >= 0 && this.duration <= this.game.input.tapRate) @@ -1030,8 +1150,8 @@ Object.defineProperty(Phaser.Pointer.prototype, "worldY", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/QuadTree.js.html b/docs/QuadTree.js.html index 715c8d09..2bcf4b56 100644 --- a/docs/QuadTree.js.html +++ b/docs/QuadTree.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -605,8 +725,8 @@ Phaser.QuadTree.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/RandomDataGenerator.js.html b/docs/RandomDataGenerator.js.html index 75430b32..3b234790 100644 --- a/docs/RandomDataGenerator.js.html +++ b/docs/RandomDataGenerator.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -587,8 +707,8 @@ Phaser.RandomDataGenerator.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Rectangle.js.html b/docs/Rectangle.js.html index 658e1ade..5a8a1f65 100644 --- a/docs/Rectangle.js.html +++ b/docs/Rectangle.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -426,6 +546,19 @@ Phaser.Rectangle.prototype = { }, + /** + * Runs Math.floor() on the x, y, width and height values of this Rectangle. + * @method Phaser.Rectangle#floorAll + **/ + floorAll: function () { + + this.x = Math.floor(this.x); + this.y = Math.floor(this.y); + this.width = Math.floor(this.width); + this.height = Math.floor(this.height); + + }, + /** * Copies the x, y, width and height properties from any given object to this Rectangle. * @method Phaser.Rectangle#copyFrom @@ -829,7 +962,7 @@ Phaser.Rectangle.inflate = function (a, dx, dy) { * @return {Phaser.Rectangle} The Rectangle object. */ Phaser.Rectangle.inflatePoint = function (a, point) { - return Phaser.Phaser.Rectangle.inflate(a, point.x, point.y); + return Phaser.Rectangle.inflate(a, point.x, point.y); }; /** @@ -868,6 +1001,10 @@ Phaser.Rectangle.contains = function (a, x, y) { return (x >= a.x && x <= a.right && y >= a.y && y <= a.bottom); }; +Phaser.Rectangle.containsRaw = function (rx, ry, rw, rh, x, y) { + return (x >= rx && x <= (rx + rw) && y >= ry && y <= (ry + rh)); +}; + /** * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. This method is similar to the Rectangle.contains() method, except that it takes a Point object as a parameter. * @method Phaser.Rectangle.containsPoint @@ -876,7 +1013,7 @@ Phaser.Rectangle.contains = function (a, x, y) { * @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false. */ Phaser.Rectangle.containsPoint = function (a, point) { - return Phaser.Phaser.Rectangle.contains(a, point.x, point.y); + return Phaser.Rectangle.contains(a, point.x, point.y); }; /** @@ -1007,8 +1144,8 @@ Phaser.Rectangle.union = function (a, b, out) {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/RenderTexture.js.html b/docs/RenderTexture.js.html new file mode 100644 index 00000000..3880f0d0 --- /dev/null +++ b/docs/RenderTexture.js.html @@ -0,0 +1,574 @@ + + + + + + Phaser Source: gameobjects/RenderTexture.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/RenderTexture.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}
    +*/
    +
    +/**
    +* A dynamic initially blank canvas to which images can be drawn
    +* @class Phaser.RenderTexture
    +* @constructor
    +* @param {Phaser.Game} game - Current game instance.
    +* @param {string} key - Asset key for the render texture.
    +* @param {number} width - the width of the render texture.
    +* @param {number} height - the height of the render texture.
    +*/
    +Phaser.RenderTexture = function (game, key, width, height) {
    +
    +	/**
    +	* @property {Phaser.Game} game - A reference to the currently running game. 
    +	*/
    +	this.game = game;
    +
    +	/**
    +    * @property {string} name - the name of the object. 
    +	*/
    +    this.name = key;
    +
    +	PIXI.EventTarget.call( this );
    +
    +	/**
    +	* @property {number} width - the width. 
    +    */
    +	this.width = width || 100;
    +	
    +	/**
    +	* @property {number} height - the height. 
    +    */
    +	this.height = height || 100;
    +
    +	/**
    +	* I know this has a typo in it, but it's because the PIXI.RenderTexture does and we need to pair-up with it
    +	* once they update pixi to fix the typo, we'll fix it here too :)
    +    * @property {Description} indetityMatrix - Description. 
    + 	*/
    +	this.indetityMatrix = PIXI.mat3.create();
    +
    +	/**
    +	* @property {Description} frame - Description. 
    +    */
    +	this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);	
    +
    +	/**
    +	* @property {Description} type - Description. 
    +    */
    +	this.type = Phaser.RENDERTEXTURE;
    +
    +	if (PIXI.gl)
    +	{
    +		this.initWebGL();
    +	}
    +	else
    +	{
    +		this.initCanvas();
    +	}
    +	
    +};
    +
    +Phaser.RenderTexture.prototype = Phaser.Utils.extend(true, PIXI.RenderTexture.prototype);
    +Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture;
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/RequestAnimationFrame.js.html b/docs/RequestAnimationFrame.js.html index 1c29f775..55d15796 100644 --- a/docs/RequestAnimationFrame.js.html +++ b/docs/RequestAnimationFrame.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -493,8 +613,8 @@ Phaser.RequestAnimationFrame.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Signal.js.html b/docs/Signal.js.html index 9fbe233d..e53e8c5a 100644 --- a/docs/Signal.js.html +++ b/docs/Signal.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -638,8 +758,8 @@ Phaser.Signal.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/SignalBinding.html b/docs/SignalBinding.html index c8bb1cf0..2579d39e 100644 --- a/docs/SignalBinding.html +++ b/docs/SignalBinding.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -638,8 +758,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:52:04 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:50 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/SignalBinding.js.html b/docs/SignalBinding.js.html index 2f5557d3..721fddf8 100644 --- a/docs/SignalBinding.js.html +++ b/docs/SignalBinding.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -503,8 +623,8 @@ Phaser.SignalBinding.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Sound.js.html b/docs/Sound.js.html index 94c710f3..72c02c51 100644 --- a/docs/Sound.js.html +++ b/docs/Sound.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -441,8 +561,7 @@ Phaser.Sound = function (game, key, volume, loop) { /** * Description. - * @property {number} autoplay - * @default + * @property {number} stopTime */ this.stopTime = 0; @@ -453,6 +572,18 @@ Phaser.Sound = function (game, key, volume, loop) { */ this.paused = false; + /** + * Description. + * @property {number} pausedPosition + */ + this.pausedPosition = 0; + + /** + * Description. + * @property {number} pausedTime + */ + this.pausedTime = 0; + /** * Description. * @property {boolean} isPlaying @@ -950,10 +1081,13 @@ Phaser.Sound.prototype = { this.stop(); this.isPlaying = false; this.paused = true; + this.pausedPosition = this.currentTime; + this.pausedTime = this.game.time.now; this.onPause.dispatch(this); } }, + /** * Resumes the sound * @method Phaser.Sound#resume @@ -964,14 +1098,20 @@ Phaser.Sound.prototype = { { if (this.usingWebAudio) { + var p = this.position + (this.pausedPosition / 1000); + + this._sound = this.context.createBufferSource(); + this._sound.buffer = this._buffer; + this._sound.connect(this.gainNode); + if (typeof this._sound.start === 'undefined') { - this._sound.noteGrainOn(0, this.position, this.duration); + this._sound.noteGrainOn(0, p, this.duration); //this._sound.noteOn(0); // the zero is vitally important, crashes iOS6 without it } else { - this._sound.start(0, this.position, this.duration); + this._sound.start(0, p, this.duration); } } else @@ -981,6 +1121,7 @@ Phaser.Sound.prototype = { this.isPlaying = true; this.paused = false; + this.startTime += (this.game.time.now - this.pausedTime); this.onResume.dispatch(this); } @@ -1147,8 +1288,8 @@ Object.defineProperty(Phaser.Sound.prototype, "volume", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/SoundManager.js.html b/docs/SoundManager.js.html index df2a0748..eaf2cba7 100644 --- a/docs/SoundManager.js.html +++ b/docs/SoundManager.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -790,8 +910,8 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Sprite.js.html b/docs/Sprite.js.html new file mode 100644 index 00000000..c1d87190 --- /dev/null +++ b/docs/Sprite.js.html @@ -0,0 +1,1630 @@ + + + + + + Phaser Source: gameobjects/Sprite.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/Sprite.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}
    +*/
    +
    +/**
    +* Create a new `Sprite` object. Sprites are the lifeblood of your game, used for nearly everything visual.
    +* At its most basic a Sprite consists of a set of coordinates and a texture that is rendered to the canvas.
    +* They also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input),
    +* events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases.
    +*
    +* @class Phaser.Sprite
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +* @param {number} x - The x coordinate (in world space) to position the Sprite at.
    +* @param {number} y - The y coordinate (in world space) to position the Sprite at.
    +* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
    +*/
    +Phaser.Sprite = function (game, x, y, key, frame) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +    key = key || null;
    +    frame = frame || null;
    +    
    +    /**
    +	* @property {Phaser.Game} game - A reference to the currently running Game.
    +	*/
    +	this.game = game;
    + 
    +	/**
    +	* @property {boolean} exists - If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all.
    +	* @default
    +	*/
    +    this.exists = true;
    +
    +	/**
    +    * @property {boolean} alive - This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering.
    +   	* @default
    +   	*/
    +    this.alive = true;
    +
    +	/**
    +    * @property {Phaser.Group} group - The parent Group of this Sprite. This is usually set after Sprite instantiation by the parent.
    +   	*/
    +    this.group = null;
    +
    +    /**
    +     * @property {string} name - The user defined name given to this Sprite.
    +     * @default
    +     */
    +    this.name = '';
    +
    +    /**
    +	* @property {number} type - The const type of this object.
    +    * @default
    +	*/
    +    this.type = Phaser.SPRITE;
    +
    +    /**
    +	* @property {number} renderOrderID - Used by the Renderer and Input Manager to control picking order.
    +	* @default
    +	*/
    +    this.renderOrderID = -1;
    +
    +    /**
    +    * If you would like the Sprite to have a lifespan once 'born' you can set this to a positive value. Handy for particles, bullets, etc.
    +	* The lifespan is decremented by game.time.elapsed each update, once it reaches zero the kill() function is called.
    +	* @property {number} lifespan - The lifespan of the Sprite (in ms) before it will be killed.
    +	* @default
    +	*/    
    +    this.lifespan = 0;
    +
    +    /**
    +    * @property {Events} events - The Events you can subscribe to that are dispatched when certain things happen on this Sprite or its components.
    +    */
    +    this.events = new Phaser.Events(this);
    +
    +    /**
    +    * @property {Phaser.AnimationManager} animations - This manages animations of the sprite. You can modify animations through it (see Phaser.AnimationManager)
    +    */
    +    this.animations = new Phaser.AnimationManager(this);
    +
    +    /**
    +    * @property {InputHandler} input - The Input Handler Component.
    +    */
    +    this.input = new Phaser.InputHandler(this);
    +
    +    /**
    +    *  @property {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +    */
    +    this.key = key;
    +
    +    /**
    +    *  @property {Phaser.Frame} currentFrame - A reference to the currently displayed frame.
    +    */
    +    this.currentFrame = null;
    +
    +    if (key instanceof Phaser.RenderTexture)
    +    {
    +        PIXI.Sprite.call(this, key);
    +
    +        this.currentFrame = this.game.cache.getTextureFrame(key.name);
    +    }
    +    else if (key instanceof PIXI.Texture)
    +    {
    +        PIXI.Sprite.call(this, key);
    +
    +        this.currentFrame = frame;
    +    }
    +    else
    +    {
    +        if (key == null || this.game.cache.checkImageKey(key) == false)
    +        {
    +            key = '__default';
    +            this.key = key;
    +        }
    +
    +        PIXI.Sprite.call(this, PIXI.TextureCache[key]);
    +
    +        if (this.game.cache.isSpriteSheet(key))
    +        {
    +            this.animations.loadFrameData(this.game.cache.getFrameData(key));
    +
    +            if (frame !== null)
    +            {
    +                if (typeof frame === 'string')
    +                {
    +                    this.frameName = frame;
    +                }
    +                else
    +                {
    +                    this.frame = frame;
    +                }
    +            }
    +        }
    +        else
    +        {
    +            this.currentFrame = this.game.cache.getFrame(key);
    +        }
    +    }
    +
    +    /**
    +    * The anchor sets the origin point of the texture.
    +    * The default is 0,0 this means the textures origin is the top left 
    +    * Setting than anchor to 0.5,0.5 means the textures origin is centered
    +    * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    +    *
    +    * @property {Phaser.Point} anchor - The anchor around with Sprite rotation and scaling takes place.
    +    */
    +    this.anchor = new Phaser.Point();
    +
    +    /**
    +    * @property {number} x - The x coordinate (in world space) of this Sprite.
    +    */
    +    this.x = x;
    +    
    +    /**
    +    * @property {number} y - The y coordinate (in world space) of this Sprite.
    +    */
    +    this.y = y;
    +
    +	this.position.x = x;
    +	this.position.y = y;
    +
    +    /**
    +    * Should this Sprite be automatically culled if out of range of the camera?
    +    * A culled sprite has its renderable property set to 'false'.
    +    *
    +    * @property {boolean} autoCull - A flag indicating if the Sprite should be automatically camera culled or not.
    +    * @default
    +    */
    +    this.autoCull = false;
    +
    +    /**
    +    * @property {Phaser.Point} scale - The scale of the Sprite when rendered. By default it's set to 1 (no scale). You can modify it via scale.x or scale.y or scale.setTo(x, y). A value of 1 means no change to the scale, 0.5 means "half the size", 2 means "twice the size", etc.
    +    */ 
    +    this.scale = new Phaser.Point(1, 1);
    +
    +    /**
    +    * @property {Phaser.Point} _cache - A mini cache for storing all of the calculated values.
    +    * @private
    +    */
    +    this._cache = { 
    +
    +        dirty: false,
    +
    +        //  Transform cache
    +        a00: -1, a01: -1, a02: -1, a10: -1, a11: -1, a12: -1, id: -1, 
    +
    +        //  Input specific transform cache
    +        i01: -1, i10: -1, idi: -1,
    +
    +        //  Bounds check
    +        left: null, right: null, top: null, bottom: null, 
    +
    +        //  The previous calculated position
    +        x: -1, y: -1,
    +
    +        //  The actual scale values based on the worldTransform
    +        scaleX: 1, scaleY: 1,
    +
    +        //  cache scale check
    +        realScaleX: 1, realScaleY: 1,
    +
    +        //  The width/height of the image, based on the un-modified frame size multiplied by the final calculated scale size
    +        width: this.currentFrame.sourceSizeW, height: this.currentFrame.sourceSizeH,
    +
    +        //  The actual width/height of the image if from a trimmed atlas, multiplied by the final calculated scale size
    +        halfWidth: Math.floor(this.currentFrame.sourceSizeW / 2), halfHeight: Math.floor(this.currentFrame.sourceSizeH / 2),
    +
    +        //  The width/height of the image, based on the un-modified frame size multiplied by the final calculated scale size
    +        calcWidth: -1, calcHeight: -1,
    +
    +        //  The current frame details
    +        // frameID: this.currentFrame.uuid, frameWidth: this.currentFrame.width, frameHeight: this.currentFrame.height,
    +        frameID: -1, frameWidth: this.currentFrame.width, frameHeight: this.currentFrame.height,
    +
    +        boundsX: 0, boundsY: 0,
    +
    +        //  If this sprite visible to the camera (regardless of being set to visible or not)
    +        cameraVisible: true,
    +
    +        //  Crop cache
    +        cropX: 0, cropY: 0, cropWidth: this.currentFrame.sourceSizeW, cropHeight: this.currentFrame.sourceSizeH
    +
    +    };
    +  
    +    /**
    +    * @property {Phaser.Point} offset - Corner point defaults. Should not typically be modified.
    +    */    
    +    this.offset = new Phaser.Point;
    +    
    +    /**
    +    * @property {Phaser.Point} center - A Point containing the center coordinate of the Sprite. Takes rotation and scale into account.
    +    */
    +    this.center = new Phaser.Point(x + Math.floor(this._cache.width / 2), y + Math.floor(this._cache.height / 2));
    +   
    +    /**
    +    * @property {Phaser.Point} topLeft - A Point containing the top left coordinate of the Sprite. Takes rotation and scale into account.
    +    */
    +    this.topLeft = new Phaser.Point(x, y);
    +    
    +    /**
    +    * @property {Phaser.Point} topRight - A Point containing the top right coordinate of the Sprite. Takes rotation and scale into account.
    +    */
    +    this.topRight = new Phaser.Point(x + this._cache.width, y);
    +    
    +    /**
    +    * @property {Phaser.Point} bottomRight - A Point containing the bottom right coordinate of the Sprite. Takes rotation and scale into account.
    +    */
    +    this.bottomRight = new Phaser.Point(x + this._cache.width, y + this._cache.height);
    +    
    +    /**
    +    * @property {Phaser.Point} bottomLeft - A Point containing the bottom left coordinate of the Sprite. Takes rotation and scale into account.
    +    */
    +    this.bottomLeft = new Phaser.Point(x, y + this._cache.height);
    +    
    +    /**
    +    * This Rectangle object fully encompasses the Sprite and is updated in real-time.
    +    * The bounds is the full bounding area after rotation and scale have been taken into account. It should not be modified directly.
    +    * It's used for Camera culling and physics body alignment.
    +    * @property {Phaser.Rectangle} bounds
    +    */
    +    this.bounds = new Phaser.Rectangle(x, y, this._cache.width, this._cache.height);
    +    
    +    /**
    +    * @property {Phaser.Physics.Arcade.Body} body - By default Sprites have a Phaser.Physics Body attached to them. You can operate physics actions via this property, or null it to skip all physics updates.
    +    */
    +    this.body = new Phaser.Physics.Arcade.Body(this);
    +
    +    /**
    +    * @property {number} health - Health value. Used in combination with damage() to allow for quick killing of Sprites.
    +    */    
    +    this.health = 1;
    +
    +    /**
    +    * @property {boolean} inWorld - This value is set to true if the Sprite is positioned within the World, otherwise false.
    +    */
    +    this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds);
    +    
    +    /**
    +    * @property {number} inWorldThreshold - A threshold value applied to the inWorld check. If you don't want a Sprite to be considered "out of the world" until at least 100px away for example then set it to 100.
    +    * @default
    +    */
    +    this.inWorldThreshold = 0;
    +
    +    /**
    +    * @property {boolean} outOfBoundsKill - If true the Sprite is killed as soon as Sprite.inWorld is false.
    +    * @default
    +    */
    +    this.outOfBoundsKill = false;
    +    
    +    /**
    +    * @property {boolean} _outOfBoundsFired - Internal flag.
    +    * @private
    +    * @default
    +    */
    +    this._outOfBoundsFired = false;
    +
    +    /**
    +    * A Sprite that is fixed to the camera ignores the position of any ancestors in the display list and uses its x/y coordinates as offsets from the top left of the camera.
    +    * @property {boolean} fixedToCamera - Fixes this Sprite to the Camera.
    +    * @default
    +    */
    +    this.fixedToCamera = false;
    +
    +    /**
    +    * You can crop the Sprites texture by modifying the crop properties. For example crop.width = 50 would set the Sprite to only render 50px wide.
    +    * The crop is only applied if you have set Sprite.cropEnabled to true.
    +    * @property {Phaser.Rectangle} crop - The crop Rectangle applied to the Sprite texture before rendering.
    +    * @default
    +    */
    +    this.crop = new Phaser.Rectangle(0, 0, this._cache.width, this._cache.height);
    +
    +    /**
    +    * @property {boolean} cropEnabled - If true the Sprite.crop property is used to crop the texture before render. Set to false to disable.
    +    * @default
    +    */
    +    this.cropEnabled = false;
    +
    +};
    +
    +//  Needed to keep the PIXI.Sprite constructor in the prototype chain (as the core pixi renderer uses an instanceof check sadly)
    +Phaser.Sprite.prototype = Object.create(PIXI.Sprite.prototype);
    +Phaser.Sprite.prototype.constructor = Phaser.Sprite;
    +
    +/**
    +* Automatically called by World.preUpdate. Handles cache updates, lifespan checks, animation updates and physics updates.
    +*
    +* @method Phaser.Sprite#preUpdate
    +* @memberof Phaser.Sprite
    +*/
    +Phaser.Sprite.prototype.preUpdate = function() {
    +
    +    if (!this.exists)
    +    {
    +        this.renderOrderID = -1;
    +        return;
    +    }
    +
    +    if (this.lifespan > 0)
    +    {
    +        this.lifespan -= this.game.time.elapsed;
    +
    +        if (this.lifespan <= 0)
    +        {
    +            this.kill();
    +            return;
    +        }
    +    }
    +
    +    this._cache.dirty = false;
    +
    +    if (this.animations.update())
    +    {
    +        this._cache.dirty = true;
    +    }
    +
    +    if (this.visible)
    +    {
    +        this.renderOrderID = this.game.world.currentRenderOrderID++;
    +    }
    +
    +    this.prevX = this.x;
    +    this.prevY = this.y;
    +
    +    this.updateCache();
    +    this.updateAnimation();
    +
    +    if (this.cropEnabled)
    +    {
    +        this.updateCrop();
    +    }
    +
    +    //  Re-run the camera visibility check
    +    if (this._cache.dirty)
    +    {
    +        this.updateBounds();
    +
    +        this._cache.cameraVisible = Phaser.Rectangle.intersects(this.game.world.camera.screenView, this.bounds, 0);
    +
    +        if (this.autoCull == true)
    +        {
    +            //  Won't get rendered but will still get its transform updated
    +            this.renderable = this._cache.cameraVisible;
    +        }
    +
    +        //  Update our physics bounds
    +        if (this.body)
    +        {
    +            this.body.updateBounds(this.center.x, this.center.y, this._cache.scaleX, this._cache.scaleY);
    +        }
    +    }
    +
    +    if (this.body)
    +    {
    +        this.body.preUpdate();
    +    }
    +
    +}
    +
    +/**
    +* Internal function called by preUpdate.
    +*
    +* @method Phaser.Sprite#updateCache
    +* @memberof Phaser.Sprite
    +*/
    +Phaser.Sprite.prototype.updateCache = function() {
    +
    +    //  |a c tx|
    +    //  |b d ty|
    +    //  |0 0  1|
    +
    +    if (this.worldTransform[1] != this._cache.i01 || this.worldTransform[3] != this._cache.i10)
    +    {
    +        this._cache.a00 = this.worldTransform[0];  //  scaleX         a
    +        this._cache.a01 = this.worldTransform[1];  //  skewY          c
    +        this._cache.a10 = this.worldTransform[3];  //  skewX          b
    +        this._cache.a11 = this.worldTransform[4];  //  scaleY         d
    +
    +        this._cache.i01 = this.worldTransform[1];  //  skewY          c (remains non-modified for input checks)
    +        this._cache.i10 = this.worldTransform[3];  //  skewX          b (remains non-modified for input checks)
    +
    +        this._cache.scaleX = Math.sqrt((this._cache.a00 * this._cache.a00) + (this._cache.a01 * this._cache.a01)); // round this off a bit?
    +        this._cache.scaleY = Math.sqrt((this._cache.a10 * this._cache.a10) + (this._cache.a11 * this._cache.a11)); // round this off a bit?
    +
    +        this._cache.a01 *= -1;
    +        this._cache.a10 *= -1;
    +
    +        this._cache.dirty = true;
    +    }
    +
    +    if (this.worldTransform[2] != this._cache.a02 || this.worldTransform[5] != this._cache.a12)
    +    {
    +        this._cache.a02 = this.worldTransform[2];  //  translateX     tx
    +        this._cache.a12 = this.worldTransform[5];  //  translateY     ty
    +        this._cache.dirty = true;
    +    }
    +
    +}
    +
    +/**
    +* Internal function called by preUpdate.
    +*
    +* @method Phaser.Sprite#updateAnimation
    +* @memberof Phaser.Sprite
    +*/
    +Phaser.Sprite.prototype.updateAnimation = function() {
    +
    +    if (this.currentFrame && this.currentFrame.uuid != this._cache.frameID)
    +    {
    +        this._cache.frameWidth = this.texture.frame.width;
    +        this._cache.frameHeight = this.texture.frame.height;
    +        this._cache.frameID = this.currentFrame.uuid;
    +        this._cache.dirty = true;
    +    }
    +
    +    if (this._cache.dirty && this.currentFrame)
    +    {
    +        this._cache.width = this.currentFrame.width;
    +        this._cache.height = this.currentFrame.height;
    +        this._cache.halfWidth = Math.floor(this._cache.width / 2);
    +        this._cache.halfHeight = Math.floor(this._cache.height / 2);
    +
    +        this._cache.id = 1 / (this._cache.a00 * this._cache.a11 + this._cache.a01 * -this._cache.a10);
    +        this._cache.idi = 1 / (this._cache.a00 * this._cache.a11 + this._cache.i01 * -this._cache.i10);
    +    }
    +
    +}
    +
    +/**
    +* Internal function called by preUpdate.
    +*
    +* @method Phaser.Sprite#updateBounds
    +* @memberof Phaser.Sprite
    +*/
    +Phaser.Sprite.prototype.updateBounds = function() {
    +
    +    var sx = 1;
    +    var sy = 1;
    +
    +    if (this.worldTransform[3] !== 0 || this.worldTransform[1] !== 0)
    +    {
    +        sx = this.scale.x;
    +        sy = this.scale.y;
    +    }
    +
    +    this.offset.setTo(this._cache.a02 - (this.anchor.x * this.width), this._cache.a12 - (this.anchor.y * this.height));
    +
    +    this.getLocalPosition(this.center, this.offset.x + (this.width / 2), this.offset.y + (this.height / 2), sx, sy);
    +    this.getLocalPosition(this.topLeft, this.offset.x, this.offset.y, sx, sy);
    +    this.getLocalPosition(this.topRight, this.offset.x + this.width, this.offset.y, sx, sy);
    +    this.getLocalPosition(this.bottomLeft, this.offset.x, this.offset.y + this.height, sx, sy);
    +    this.getLocalPosition(this.bottomRight, this.offset.x + this.width, this.offset.y + this.height, sx, sy);
    +
    +    this._cache.left = Phaser.Math.min(this.topLeft.x, this.topRight.x, this.bottomLeft.x, this.bottomRight.x);
    +    this._cache.right = Phaser.Math.max(this.topLeft.x, this.topRight.x, this.bottomLeft.x, this.bottomRight.x);
    +    this._cache.top = Phaser.Math.min(this.topLeft.y, this.topRight.y, this.bottomLeft.y, this.bottomRight.y);
    +    this._cache.bottom = Phaser.Math.max(this.topLeft.y, this.topRight.y, this.bottomLeft.y, this.bottomRight.y);
    +
    +    this.bounds.setTo(this._cache.left, this._cache.top, this._cache.right - this._cache.left, this._cache.bottom - this._cache.top);
    +
    +    //  This is the coordinate the Sprite was at when the last bounds was created
    +    this._cache.boundsX = this._cache.x;
    +    this._cache.boundsY = this._cache.y;
    +        
    +    this.updateFrame = true;
    +
    +    if (this.inWorld == false)
    +    {
    +        //  Sprite WAS out of the screen, is it still?
    +        this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds, this.inWorldThreshold);
    +
    +        if (this.inWorld)
    +        {
    +            //  It's back again, reset the OOB check
    +            this._outOfBoundsFired = false;
    +        }
    +    }
    +    else
    +    {
    +        //   Sprite WAS in the screen, has it now left?
    +        this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds, this.inWorldThreshold);
    +
    +        if (this.inWorld == false)
    +        {
    +            this.events.onOutOfBounds.dispatch(this);
    +            this._outOfBoundsFired = true;
    +
    +            if (this.outOfBoundsKill)
    +            {
    +                this.kill();
    +            }
    +        }
    +    }
    +
    +}
    +
    +/**
    +* Gets the local position of a coordinate relative to the Sprite, factoring in rotation and scale.
    +* Mostly only used internally.
    +* 
    +* @method Phaser.Sprite#getLocalPosition
    +* @memberof Phaser.Sprite
    +* @param {Phaser.Point} p - The Point object to store the results in.
    +* @param {number} x - x coordinate within the Sprite to translate.
    +* @param {number} y - x coordinate within the Sprite to translate.
    +* @param {number} sx - Scale factor to be applied.
    +* @param {number} sy - Scale factor to be applied.
    +* @return {Phaser.Point} The translated point.
    +*/
    +Phaser.Sprite.prototype.getLocalPosition = function(p, x, y, sx, sy) {
    +
    +    p.x = ((this._cache.a11 * this._cache.id * x + -this._cache.a01 * this._cache.id * y + (this._cache.a12 * this._cache.a01 - this._cache.a02 * this._cache.a11) * this._cache.id) * sx) + this._cache.a02;
    +    p.y = ((this._cache.a00 * this._cache.id * y + -this._cache.a10 * this._cache.id * x + (-this._cache.a12 * this._cache.a00 + this._cache.a02 * this._cache.a10) * this._cache.id) * sy) + this._cache.a12;
    +
    +    return p;
    +
    +}
    +
    +/**
    +* Gets the local unmodified position of a coordinate relative to the Sprite, factoring in rotation and scale.
    +* Mostly only used internally by the Input Manager, but also useful for custom hit detection.
    +* 
    +* @method Phaser.Sprite#getLocalUnmodifiedPosition
    +* @memberof Phaser.Sprite
    +* @param {Phaser.Point} p - The Point object to store the results in.
    +* @param {number} x - x coordinate within the Sprite to translate.
    +* @param {number} y - x coordinate within the Sprite to translate.
    +* @return {Phaser.Point} The translated point.
    +*/
    +Phaser.Sprite.prototype.getLocalUnmodifiedPosition = function(p, gx, gy) {
    +
    +    var a00 = this.worldTransform[0], a01 = this.worldTransform[1], a02 = this.worldTransform[2],
    +        a10 = this.worldTransform[3], a11 = this.worldTransform[4], a12 = this.worldTransform[5],
    +        id = 1 / (a00 * a11 + a01 * -a10),
    +        x = a11 * id * gx + -a01 * id * gy + (a12 * a01 - a02 * a11) * id,
    +        y = a00 * id * gy + -a10 * id * gx + (-a12 * a00 + a02 * a10) * id;
    +
    +    p.x = x + (this.anchor.x * this._cache.width);
    +    p.y = y + (this.anchor.y * this._cache.height);
    +
    +    return p;
    +
    +}
    +
    +/**
    +* Internal function called by preUpdate.
    +*
    +* @method Phaser.Sprite#updateCrop
    +* @memberof Phaser.Sprite
    +*/
    +Phaser.Sprite.prototype.updateCrop = function() {
    +
    +    //  This only runs if crop is enabled
    +    if (this.crop.width != this._cache.cropWidth || this.crop.height != this._cache.cropHeight || this.crop.x != this._cache.cropX || this.crop.y != this._cache.cropY)
    +    {
    +        this.crop.floorAll();
    +
    +        this._cache.cropX = this.crop.x;
    +        this._cache.cropY = this.crop.y;
    +        this._cache.cropWidth = this.crop.width;
    +        this._cache.cropHeight = this.crop.height;
    +
    +        this.texture.frame = this.crop;
    +        this.texture.width = this.crop.width;
    +        this.texture.height = this.crop.height;
    +
    +        this.texture.updateFrame = true;
    +
    +        PIXI.Texture.frameUpdates.push(this.texture);
    +    }
    +
    +}
    +
    +/**
    +* Resets the Sprite.crop value back to the frame dimensions.
    +*
    +* @method Phaser.Sprite#resetCrop
    +* @memberof Phaser.Sprite
    +*/
    +Phaser.Sprite.prototype.resetCrop = function() {
    +
    +    this.crop = new Phaser.Rectangle(0, 0, this._cache.width, this._cache.height);
    +    this.texture.setFrame(this.crop);
    +    this.cropEnabled = false;
    +
    +}
    +
    +/**
    +* Internal function called by the World postUpdate cycle.
    +*
    +* @method Phaser.Sprite#postUpdate
    +* @memberof Phaser.Sprite
    +*/
    +Phaser.Sprite.prototype.postUpdate = function() {
    +
    +    if (this.exists)
    +    {
    +        //  The sprite is positioned in this call, after taking into consideration motion updates and collision
    +        if (this.body)
    +        {
    +            this.body.postUpdate();
    +        }
    +
    +        if (this.fixedToCamera)
    +        {
    +            this._cache.x = this.game.camera.view.x + this.x;
    +            this._cache.y = this.game.camera.view.y + this.y;
    +        }
    +        else
    +        {
    +            this._cache.x = this.x;
    +            this._cache.y = this.y;
    +        }
    +
    +        if (this.position.x != this._cache.x || this.position.y != this._cache.y)
    +        {
    +            this.position.x = this._cache.x;
    +            this.position.y = this._cache.y;
    +        }
    +    }
    +
    +}
    +
    +/**
    +* Changes the Texture the Sprite is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache.
    +* This causes a WebGL texture update, so use sparingly or in low-intensity portions of your game.
    +*
    +* @method Phaser.Sprite#loadTexture
    +* @memberof Phaser.Sprite
    +* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
    +*/
    +Phaser.Sprite.prototype.loadTexture = function (key, frame) {
    +
    +    this.key = key;
    +
    +    if (key instanceof Phaser.RenderTexture)
    +    {
    +        this.currentFrame = this.game.cache.getTextureFrame(key.name);
    +    }
    +    else if (key instanceof PIXI.Texture)
    +    {
    +        this.currentFrame = frame;
    +    }
    +    else
    +    {
    +        if (typeof key === 'undefined' || this.game.cache.checkImageKey(key) === false)
    +        {
    +            key = '__default';
    +            this.key = key;
    +        }
    +
    +        if (this.game.cache.isSpriteSheet(key))
    +        {
    +            this.animations.loadFrameData(this.game.cache.getFrameData(key));
    +
    +            if (typeof frame !== 'undefined')
    +            {
    +                if (typeof frame === 'string')
    +                {
    +                    this.frameName = frame;
    +                }
    +                else
    +                {
    +                    this.frame = frame;
    +                }
    +            }
    +        }
    +        else
    +        {
    +            this.currentFrame = this.game.cache.getFrame(key);
    +            this.setTexture(PIXI.TextureCache[key]);
    +        }
    +    }
    +
    +}
    +
    +/**
    +* Returns the absolute delta x value.
    +*
    +* @method Phaser.Sprite#deltaAbsX
    +* @memberof Phaser.Sprite
    +* @return {number} The absolute delta value.
    +*/
    +Phaser.Sprite.prototype.deltaAbsX = function () {
    +    return (this.deltaX() > 0 ? this.deltaX() : -this.deltaX());
    +}
    +
    +/**
    +* Returns the absolute delta y value.
    +*
    +* @method Phaser.Sprite#deltaAbsY
    +* @memberof Phaser.Sprite
    +* @return {number} The absolute delta value.
    +*/
    +Phaser.Sprite.prototype.deltaAbsY = function () {
    +    return (this.deltaY() > 0 ? this.deltaY() : -this.deltaY());
    +}
    +
    +/**
    +* Returns the delta x value.
    +*
    +* @method Phaser.Sprite#deltaX
    +* @memberof Phaser.Sprite
    +* @return {number} The delta value.
    +*/
    +Phaser.Sprite.prototype.deltaX = function () {
    +    return this.x - this.prevX;
    +}
    +
    +/**
    +* Returns the delta y value.
    +*
    +* @method Phaser.Sprite#deltaY
    +* @memberof Phaser.Sprite
    +* @return {number} The delta value.
    +*/
    +Phaser.Sprite.prototype.deltaY = function () {
    +    return this.y - this.prevY;
    +}
    +
    +/**
    +* Moves the sprite so its center is located on the given x and y coordinates.
    +* Doesn't change the anchor point of the sprite.
    +* 
    +* @method Phaser.Sprite#centerOn
    +* @memberof Phaser.Sprite
    +* @param {number} x - The x coordinate (in world space) to position the Sprite at.
    +* @param {number} y - The y coordinate (in world space) to position the Sprite at.
    +* @return (Phaser.Sprite) This instance.
    +*/
    +Phaser.Sprite.prototype.centerOn = function(x, y) {
    +
    +    this.x = x + (this.x - this.center.x);
    +    this.y = y + (this.y - this.center.y);
    +    return this;
    +
    +}
    +
    +/**
    +* Brings a 'dead' Sprite back to life, optionally giving it the health value specified.
    +* A resurrected Sprite has its alive, exists and visible properties all set to true.
    +* It will dispatch the onRevived event, you can listen to Sprite.events.onRevived for the signal.
    +* 
    +* @method Phaser.Sprite#revive
    +* @memberof Phaser.Sprite
    +* @param {number} [health=1] - The health to give the Sprite.
    +* @return (Phaser.Sprite) This instance.
    +*/
    +Phaser.Sprite.prototype.revive = function(health) {
    +
    +    if (typeof health === 'undefined') { health = 1; }
    +
    +    this.alive = true;
    +    this.exists = true;
    +    this.visible = true;
    +    this.health = health;
    +
    +    if (this.events)
    +    {
    +        this.events.onRevived.dispatch(this);
    +    }
    +
    +    return this;
    +
    +}
    +
    +/**
    +* Kills a Sprite. A killed Sprite has its alive, exists and visible properties all set to false.
    +* It will dispatch the onKilled event, you can listen to Sprite.events.onKilled for the signal.
    +* Note that killing a Sprite is a way for you to quickly recycle it in a Sprite pool, it doesn't free it up from memory.
    +* If you don't need this Sprite any more you should call Sprite.destroy instead.
    +* 
    +* @method Phaser.Sprite#kill
    +* @memberof Phaser.Sprite
    +* @return (Phaser.Sprite) This instance.
    +*/
    +Phaser.Sprite.prototype.kill = function() {
    +
    +    this.alive = false;
    +    this.exists = false;
    +    this.visible = false;
    +
    +    if (this.events)
    +    {
    +        this.events.onKilled.dispatch(this);
    +    }
    +
    +    return this;
    +
    +}
    +
    +/**
    +* Destroys the Sprite. This removes it from its parent group, destroys the input, event and animation handlers if present
    +* and nulls its reference to game, freeing it up for garbage collection.
    +* 
    +* @method Phaser.Sprite#destroy
    +* @memberof Phaser.Sprite
    +*/
    +Phaser.Sprite.prototype.destroy = function() {
    +
    +    if (this.group)
    +    {
    +        this.group.remove(this);
    +    }
    +
    +    if (this.input)
    +    {
    +        this.input.destroy();
    +    }
    +
    +    if (this.events)
    +    {
    +        this.events.destroy();
    +    }
    +
    +    if (this.animations)
    +    {
    +        this.animations.destroy();
    +    }
    +
    +    this.alive = false;
    +    this.exists = false;
    +    this.visible = false;
    +
    +    this.game = null;
    +
    +}
    +
    +/**
    +* Damages the Sprite, this removes the given amount from the Sprites health property.
    +* If health is then taken below zero Sprite.kill is called.
    +* 
    +* @method Phaser.Sprite#damage
    +* @memberof Phaser.Sprite
    +* @param {number} amount - The amount to subtract from the Sprite.health value.
    +* @return (Phaser.Sprite) This instance.
    +*/
    +Phaser.Sprite.prototype.damage = function(amount) {
    +
    +    if (this.alive)
    +    {
    +        this.health -= amount;
    +
    +        if (this.health < 0)
    +        {
    +            this.kill();
    +        }
    +    }
    +
    +    return this;
    +
    +}
    +
    +/**
    +* Resets the Sprite. This places the Sprite at the given x/y world coordinates and then
    +* sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values.
    +* If the Sprite has a physics body that too is reset.
    +* 
    +* @method Phaser.Sprite#reset
    +* @memberof Phaser.Sprite
    +* @param {number} x - The x coordinate (in world space) to position the Sprite at.
    +* @param {number} y - The y coordinate (in world space) to position the Sprite at.
    +* @param {number} [health=1] - The health to give the Sprite.
    +* @return (Phaser.Sprite) This instance.
    +*/
    +Phaser.Sprite.prototype.reset = function(x, y, health) {
    +
    +    if (typeof health === 'undefined') { health = 1; }
    +
    +    this.x = x;
    +    this.y = y;
    +    this.position.x = this.x;
    +    this.position.y = this.y;
    +    this.alive = true;
    +    this.exists = true;
    +    this.visible = true;
    +    this.renderable = true;
    +    this._outOfBoundsFired = false;
    +
    +    this.health = health;
    +
    +    if (this.body)
    +    {
    +        this.body.reset();
    +    }
    +
    +    return this;
    +    
    +}
    +
    +/**
    +* Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only
    +* bought to the top of that Group, not the entire display list.
    +* 
    +* @method Phaser.Sprite#bringToTop
    +* @memberof Phaser.Sprite
    +* @return (Phaser.Sprite) This instance.
    +*/
    +Phaser.Sprite.prototype.bringToTop = function() {
    +
    +    if (this.group)
    +    {
    +        this.group.bringToTop(this);
    +    }
    +    else
    +    {
    +        this.game.world.bringToTop(this);
    +    }
    +
    +    return this;
    +
    +}
    +
    +/**
    +* Play an animation based on the given key. The animation should previously have been added via sprite.animations.add()
    +* If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself.
    +* 
    +* @method Phaser.Sprite#play
    +* @memberof Phaser.Sprite
    +* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
    +* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
    +* @param {boolean} [loop=false] - Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.
    +* @param {boolean} [killOnComplete=false] - If set to true when the animation completes (only happens if loop=false) the parent Sprite will be killed.
    +* @return {Phaser.Animation} A reference to playing Animation instance.
    +*/
    +Phaser.Sprite.prototype.play = function (name, frameRate, loop, killOnComplete) {
    +
    +    if (this.animations)
    +    {
    +        return this.animations.play(name, frameRate, loop, killOnComplete);
    +    }
    +
    +}
    +
    +/**
    +* Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
    +* Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90.
    +* If you wish to work in radians instead of degrees use the property Sprite.rotation instead.
    +* @name Phaser.Sprite#angle
    +* @property {number} angle - Gets or sets the Sprites angle of rotation in degrees.
    +*/
    +Object.defineProperty(Phaser.Sprite.prototype, 'angle', {
    +
    +    get: function() {
    +        return Phaser.Math.wrapAngle(Phaser.Math.radToDeg(this.rotation));
    +    },
    +
    +    set: function(value) {
    +        this.rotation = Phaser.Math.degToRad(Phaser.Math.wrapAngle(value));
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.Sprite#frame
    +* @property {number} frame - Gets or sets the current frame index and updates the Texture Cache for display.
    +*/
    +Object.defineProperty(Phaser.Sprite.prototype, "frame", {
    +    
    +    get: function () {
    +        return this.animations.frame;
    +    },
    +
    +    set: function (value) {
    +        this.animations.frame = value;
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.Sprite#frameName
    +* @property {string} frameName - Gets or sets the current frame name and updates the Texture Cache for display.
    +*/
    +Object.defineProperty(Phaser.Sprite.prototype, "frameName", {
    +    
    +    get: function () {
    +        return this.animations.frameName;
    +    },
    +
    +    set: function (value) {
    +        this.animations.frameName = value;
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.Sprite#inCamera
    +* @property {boolean} inCamera - Is this sprite visible to the camera or not?
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.Sprite.prototype, "inCamera", {
    +    
    +    get: function () {
    +        return this._cache.cameraVisible;
    +    }
    +
    +});
    +
    +/**
    +* The width of the sprite in pixels, setting this will actually modify the scale to acheive the value desired.
    +* If you wish to crop the Sprite instead see the Sprite.crop value.
    +*
    +* @name Phaser.Sprite#width
    +* @property {number} width - The width of the Sprite in pixels.
    +*/
    +Object.defineProperty(Phaser.Sprite.prototype, 'width', {
    +
    +    get: function() {
    +        return this.scale.x * this.currentFrame.width;
    +    },
    +
    +    set: function(value) {
    +
    +        this.scale.x = value / this.currentFrame.width;
    +        this._cache.scaleX = value / this.currentFrame.width;
    +        this._width = value;
    +
    +    }
    +
    +});
    +
    +/**
    +* The height of the sprite in pixels, setting this will actually modify the scale to acheive the value desired.
    +* If you wish to crop the Sprite instead see the Sprite.crop value.
    +*
    +* @name Phaser.Sprite#height
    +* @property {number} height - The height of the Sprite in pixels.
    +*/
    +Object.defineProperty(Phaser.Sprite.prototype, 'height', {
    +
    +    get: function() {
    +        return this.scale.y * this.currentFrame.height;
    +    },
    +
    +    set: function(value) {
    +
    +        this.scale.y = value / this.currentFrame.height;
    +        this._cache.scaleY = value / this.currentFrame.height;
    +        this._height = value;
    +
    +    }
    +
    +});
    +
    +/**
    +* By default a Sprite won't process any input events at all. By setting inputEnabled to true the Phaser.InputHandler is
    +* activated for this Sprite instance and it will then start to process click/touch events and more.
    +*
    +* @name Phaser.Sprite#inputEnabled
    +* @property {boolean} inputEnabled - Set to true to allow this Sprite to receive input events, otherwise false.
    +*/
    +Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", {
    +    
    +    get: function () {
    +
    +        return (this.input.enabled);
    +
    +    },
    +
    +    set: function (value) {
    +
    +        if (value)
    +        {
    +            if (this.input.enabled == false)
    +            {
    +                this.input.start();
    +            }
    +        }
    +        else
    +        {
    +            if (this.input.enabled)
    +            {
    +                this.input.stop();
    +            }
    +        }
    +
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Stage.js.html b/docs/Stage.js.html index eeb07873..4f2f1fce 100644 --- a/docs/Stage.js.html +++ b/docs/Stage.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -384,6 +504,18 @@ Phaser.Stage = function (game, width, height) { */ this.aspectRatio = width / height; + /** + * @property {number} _nextOffsetCheck - The time to run the next offset check. + * @private + */ + this._nextOffsetCheck = 0; + + /** + * @property {number|false} checkOffsetInterval - The time (in ms) between which the stage should check to see if it has moved. + * @default + */ + this.checkOffsetInterval = 2500; + }; Phaser.Stage.prototype = { @@ -416,6 +548,24 @@ Phaser.Stage.prototype = { window.onblur = this._onChange; window.onfocus = this._onChange; + }, + + /** + * Runs Stage processes that need periodic updates, such as the offset checks. + * @method Phaser.Stage#update + */ + update: function () { + + if (this.checkOffsetInterval !== false) + { + if (this.game.time.now > this._nextOffsetCheck) + { + Phaser.Canvas.getOffset(this.canvas, this.offset); + this._nextOffsetCheck = this.game.time.now + this.checkOffsetInterval; + } + + } + }, /** @@ -487,8 +637,8 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/StageScaleMode.js.html b/docs/StageScaleMode.js.html index 6bcc2c42..045b5c29 100644 --- a/docs/StageScaleMode.js.html +++ b/docs/StageScaleMode.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -912,8 +1032,8 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/State.js.html b/docs/State.js.html index 14226299..1e6468f2 100644 --- a/docs/State.js.html +++ b/docs/State.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -510,8 +630,8 @@ Phaser.State.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/StateManager.js.html b/docs/StateManager.js.html index eef04b6b..ba023349 100644 --- a/docs/StateManager.js.html +++ b/docs/StateManager.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -866,8 +986,8 @@ Phaser.StateManager.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Text.js.html b/docs/Text.js.html new file mode 100644 index 00000000..35a2d3f6 --- /dev/null +++ b/docs/Text.js.html @@ -0,0 +1,726 @@ + + + + + + Phaser Source: gameobjects/Text.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/Text.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}
    +*/
    +
    +/**
    +* Create a new <code>Text</code>.
    +* @class Phaser.Text
    +* @constructor
    +* @param {Phaser.Game} game - Current game instance.
    +* @param {number} x - X position of the new text object.
    +* @param {number} y - Y position of the new text object.
    +* @param {string} text - The actual text that will be written.
    +* @param {object} style - The style object containing style attributes like font, font size ,
    +*/
    +Phaser.Text = function (game, x, y, text, style) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +    text = text || '';
    +    style = style || '';
    +
    +    //  If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all
    +	/**
    +	* @property {boolean} exists - Description.
    +	* @default
    +	*/
    +    this.exists = true;
    +
    +    //  This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering
    +	/**
    +	* @property {boolean} alive - Description.
    +	* @default
    +	*/
    +    this.alive = true;
    +
    +	/**
    +	* @property {Description} group - Description.
    +	* @default
    +	*/
    +    this.group = null;
    +
    +	/**
    +	* @property {string} name - Description.
    +	* @default
    +	*/
    +    this.name = '';
    +
    +    /**
    +    * @property {Phaser.Game} game - A reference to the currently running game. 
    +    */
    +    this.game = game;
    +
    +    this._text = text;
    +    this._style = style;
    +
    +    PIXI.Text.call(this, text, style);
    +
    +    /**
    +     * @property {Description} type - Description. 
    +     */
    +    this.type = Phaser.TEXT;
    +
    +    /**
    +     * @property {Description} position - Description. 
    +     */
    +    this.position.x = this.x = x;
    +    this.position.y = this.y = y;
    +
    +    //  Replaces the PIXI.Point with a slightly more flexible one
    +    /**
    +     * @property {Phaser.Point} anchor - Description. 
    +     */
    +    this.anchor = new Phaser.Point();
    +    
    +    /**
    +     * @property {Phaser.Point} scale - Description. 
    +     */
    +    this.scale = new Phaser.Point(1, 1);
    +
    +    //  A mini cache for storing all of the calculated values
    +    /**
    +    * @property {Description} _cache - Description. 
    +    * @private
    +    */
    +    this._cache = { 
    +
    +        dirty: false,
    +
    +        //  Transform cache
    +        a00: 1, a01: 0, a02: x, a10: 0, a11: 1, a12: y, id: 1, 
    +
    +        //  The previous calculated position
    +        x: -1, y: -1,
    +
    +        //  The actual scale values based on the worldTransform
    +        scaleX: 1, scaleY: 1
    +
    +    };
    +
    +    this._cache.x = this.x;
    +    this._cache.y = this.y;
    +
    +    /**
    +    * @property {boolean} renderable - Description. 
    +    */
    +    this.renderable = true;
    +
    +};
    +
    +Phaser.Text.prototype = Object.create(PIXI.Text.prototype);
    +Phaser.Text.prototype.constructor = Phaser.Text;
    +
    +/**
    +* Automatically called by World.update.
    +* @method Phaser.Text.prototype.update
    +*/
    +Phaser.Text.prototype.update = function() {
    +
    +    if (!this.exists)
    +    {
    +        return;
    +    }
    +
    +    this._cache.dirty = false;
    +
    +    this._cache.x = this.x;
    +    this._cache.y = this.y;
    +
    +    if (this.position.x != this._cache.x || this.position.y != this._cache.y)
    +    {
    +        this.position.x = this._cache.x;
    +        this.position.y = this._cache.y;
    +        this._cache.dirty = true;
    +    }
    +
    +}
    +
    +/**
    +* @method Phaser.Text.prototype.destroy
    +*/
    +Phaser.Text.prototype.destroy = function() {
    +
    +    if (this.group)
    +    {
    +        this.group.remove(this);
    +    }
    +
    +    if (this.canvas.parentNode)
    +    {
    +        this.canvas.parentNode.removeChild(this.canvas);
    +    }
    +    else
    +    {
    +        this.canvas = null;
    +        this.context = null;
    +    }
    +
    +    this.exists = false;
    +
    +    this.group = null;
    +
    +}
    +
    +/**
    +* Get
    +* @returns {Description}
    +*//**
    +* Set
    +* @param {Description} value - Description
    +*/
    +Object.defineProperty(Phaser.Text.prototype, 'angle', {
    +
    +    get: function() {
    +        return Phaser.Math.radToDeg(this.rotation);
    +    },
    +
    +    set: function(value) {
    +        this.rotation = Phaser.Math.degToRad(value);
    +    }
    +
    +});
    +
    +Object.defineProperty(Phaser.Text.prototype, 'content', {
    +
    +    get: function() {
    +        return this._text;
    +    },
    +
    +    set: function(value) {
    +
    +        //  Let's not update unless needed, this way we can safely update the text in a core loop without constant re-draws
    +        if (value !== this._text)
    +        {
    +            this._text = value;
    +            this.setText(value);
    +        }
    +
    +    }
    +
    +});
    +
    +Object.defineProperty(Phaser.Text.prototype, 'font', {
    +
    +    get: function() {
    +        return this._style;
    +    },
    +
    +    set: function(value) {
    +
    +        //  Let's not update unless needed, this way we can safely update the text in a core loop without constant re-draws
    +        if (value !== this._style)
    +        {
    +            this._style = value;
    +            this.setStyle(value);
    +        }
    +
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/TileSprite.js.html b/docs/TileSprite.js.html new file mode 100644 index 00000000..812d8964 --- /dev/null +++ b/docs/TileSprite.js.html @@ -0,0 +1,562 @@ + + + + + + Phaser Source: gameobjects/TileSprite.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/TileSprite.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}
    +*/
    +
    +/**
    +* Create a new <code>TileSprite</code>.
    +* @class Phaser.Tilemap
    +* @constructor
    +* @param {Phaser.Game} game - Current game instance.
    +* @param {number} x - X position of the new tileSprite.
    +* @param {number} y - Y position of the new tileSprite.
    +* @param {number} width - the width of the tilesprite.
    +* @param {number} height - the height of the tilesprite.
    +* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
    +*/
    +Phaser.TileSprite = function (game, x, y, width, height, key, frame) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +    width = width || 256;
    +    height = height || 256;
    +    key = key || null;
    +    frame = frame || null;
    +
    +	Phaser.Sprite.call(this, game, x, y, key, frame);
    +
    +	/**
    +	* @property {Description} texture - Description. 
    +    */
    +    this.texture = PIXI.TextureCache[key];
    +
    +	PIXI.TilingSprite.call(this, this.texture, width, height);
    +
    +	/**
    +	* @property {Description} type - Description. 
    +    */
    +	this.type = Phaser.TILESPRITE;
    +
    +	/**
    +	* @property {Point} tileScale - The scaling of the image that is being tiled.
    +	*/	
    +	this.tileScale = new Phaser.Point(1, 1);
    +
    +	/**
    +	* @property {Point} tilePosition - The offset position of the image that is being tiled.
    +	*/	
    +	this.tilePosition = new Phaser.Point(0, 0);
    +
    +};
    +
    +Phaser.TileSprite.prototype = Phaser.Utils.extend(true, PIXI.TilingSprite.prototype, Phaser.Sprite.prototype);
    +Phaser.TileSprite.prototype.constructor = Phaser.TileSprite;
    +
    +//  Add our own custom methods
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Time.js.html b/docs/Time.js.html index 1748e42f..b616de5d 100644 --- a/docs/Time.js.html +++ b/docs/Time.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -525,6 +645,12 @@ Phaser.Time.prototype = { this.lastTime = time + this.timeToCall; this.physicsElapsed = 1.0 * (this.elapsed / 1000); + // Clamp the delta + if (this.physicsElapsed > 1) + { + this.physicsElapsed = 1; + } + // Paused? if (this.game.paused) { @@ -606,8 +732,8 @@ Phaser.Time.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Touch.js.html b/docs/Touch.js.html index 1a8af421..be9a5a3c 100644 --- a/docs/Touch.js.html +++ b/docs/Touch.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -674,8 +794,8 @@ Phaser.Touch.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Tween.js.html b/docs/Tween.js.html index 2bc8905d..16c1ae76 100644 --- a/docs/Tween.js.html +++ b/docs/Tween.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -950,8 +1070,8 @@ Phaser.Tween.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/TweenManager.js.html b/docs/TweenManager.js.html index fd001a9f..7936a498 100644 --- a/docs/TweenManager.js.html +++ b/docs/TweenManager.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -527,8 +647,8 @@ Phaser.TweenManager.prototype = {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Utils.js.html b/docs/Utils.js.html index 64a886ee..6bd7466b 100644 --- a/docs/Utils.js.html +++ b/docs/Utils.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -568,8 +688,8 @@ if (typeof Function.prototype.bind != 'function') {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/World.js.html b/docs/World.js.html index 8e0f1301..21d2ad92 100644 --- a/docs/World.js.html +++ b/docs/World.js.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -601,8 +721,8 @@ Object.defineProperty(Phaser.World.prototype, "randomY", {
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/build/conf_dev.json b/docs/build/conf_dev.json index 2a8fc1b4..e5ba68ae 100644 --- a/docs/build/conf_dev.json +++ b/docs/build/conf_dev.json @@ -8,12 +8,14 @@ "../../src/Intro.js", "../../src/animation/", "../../src/core/", + "../../src/gameobjects/", "../../src/geom/", "../../src/input/", "../../src/loader/", "../../src/math/", "../../src/net/", "../../src/particles/", + "../../src/physics/arcade/", "../../src/sound/", "../../src/system/", "../../src/time/", diff --git a/docs/classes.list.html b/docs/classes.list.html index 2d5f8a17..b1682b66 100644 --- a/docs/classes.list.html +++ b/docs/classes.list.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -387,6 +507,15 @@
    AnimationParser
    +
    BitmapText
    +
    + +
    Bullet
    +
    + +
    Button
    +
    +
    Cache
    @@ -441,6 +570,9 @@
    Sinusoidal
    +
    Events
    +
    +
    Frame
    @@ -450,6 +582,12 @@
    Game
    +
    GameObjectFactory
    +
    + +
    Graphics
    +
    +
    Group
    @@ -492,6 +630,12 @@
    Emitter
    +
    Physics
    +
    + +
    Arcade
    +
    +
    Plugin
    @@ -513,6 +657,9 @@
    Rectangle
    +
    RenderTexture
    +
    +
    RequestAnimationFrame
    @@ -525,6 +672,9 @@
    SoundManager
    +
    Sprite
    +
    +
    Stage
    @@ -537,6 +687,12 @@
    StateManager
    +
    Text
    +
    + +
    TileSprite
    +
    +
    Time
    @@ -598,8 +754,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/global.html b/docs/global.html index 10ffb391..90667b5e 100644 --- a/docs/global.html +++ b/docs/global.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -385,6 +505,2031 @@
    +
    +

    audio(key, volume, loop) → {Phaser.Sound}

    + + +
    +
    + + +
    +

    Creates a new instance of the Sound class.

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

    The Game.cache key of the sound that this object will use.

    volume + + +number + + + +

    The volume at which the sound will be played.

    loop + + +boolean + + + +

    Whether or not the sound will loop.

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

    The newly created text object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Sound + + +
    +
    + + + + + +
    + + + +
    +

    bitmapText(x, y, text, style) → {Phaser.BitmapText}

    + + +
    +
    + + +
    +
      +
    • Create a new <code>BitmapText</code>.
    • +
    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    X position of the new bitmapText object.

    y + + +number + + + +

    Y position of the new bitmapText object.

    text + + +string + + + +

    The actual text that will be written.

    style + + +object + + + +

    The style object containing style attributes like font, font size , etc.

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

    The newly created bitmapText object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.BitmapText + + +
    +
    + + + + + +
    + + + +
    +

    bottom() → {number}

    + + +
    +
    + + +
    +

    The sum of the y and height properties. Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +number + + +
    +
    + + + + + +
    + + + +
    +

    bottom(value)

    + + +
    +
    + + +
    +

    The sum of the y and height properties. Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    value + + +number + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    button(x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) → {Phaser.Button}

    + + +
    +
    + + +
    +

    Creates a new <code>Button</code> object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    x + + +number + + + + + + <optional>
    + + + + + +

    X position of the new button object.

    y + + +number + + + + + + <optional>
    + + + + + +

    Y position of the new button object.

    key + + +string + + + + + + <optional>
    + + + + + +

    The image key as defined in the Game.Cache to use as the texture for this button.

    callback + + +function + + + + + + <optional>
    + + + + + +

    The function to call when this button is pressed

    callbackContext + + +object + + + + + + <optional>
    + + + + + +

    The context in which the callback will be called (usually 'this')

    overFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.

    outFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.

    downFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.

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

    The newly created button object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Button + + +
    +
    + + + + + +
    + + + +
    +

    child(group, x, y, key, frame) → {Phaser.Sprite}

    + + +
    +
    + + +
    +

    Create a new Sprite with specific position and sprite sheet key that will automatically be added as a child of the given parent.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    group + + +Phaser.Group + + + + + + + + + +

    The Group to add this child to.

    x + + +number + + + + + + + + + +

    X position of the new sprite.

    y + + +number + + + + + + + + + +

    Y position of the new sprite.

    key + + +string +| + +RenderTexture + + + + + + <optional>
    + + + + + +

    The image key as defined in the Game.Cache to use as the texture for this sprite OR a RenderTexture.

    frame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.

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

    the newly created sprite object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Sprite + + +
    +
    + + + + + +
    + + + +
    +

    emitter(x, y, maxParticles) → {Phaser.Emitter}

    + + +
    +
    + + +
    +

    Emitter is a lightweight particle emitter. It can be used for one-time explosions or for +continuous effects like rain and fire. All it really does is launch Particle objects out +at set intervals, and fixes their positions and velocities accorindgly.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    x + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

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

    y + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

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

    maxParticles + + +number + + + + + + <optional>
    + + + + + +
    + + 50 + +

    The total number of particles in this emitter.

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

    The newly created emitter object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Emitter + + +
    +
    + + + + + +
    + + + +
    +

    existing.(object) → {*}

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    object + + +* + + + +

    An instance of Phaser.Sprite, Phaser.Button or any other display object..

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

    The child that was added to the Group.

    +
    + + + +
    +
    + Type +
    +
    + +* + + +
    +
    + + + + + +
    + + + +
    +

    graphics(x, y) → {Phaser.Graphics}

    + + +
    +
    + + +
    +

    Creates a new <code>Graphics</code> object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    X position of the new graphics object.

    y + + +number + + + +

    Y position of the new graphics object.

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

    The newly created graphics object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Graphics + + +
    +
    + + + + + +
    + + + +
    +

    group(parent, name) → {Phaser.Group}

    + + +
    +
    + + +
    +

    A Group is a container for display objects that allows for fast pooling, recycling and collision checks.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    parent + + +* + + + + + + + + + + + +

    The parent Group or DisplayObjectContainer that will hold this group, if any.

    name + + +string + + + + + + <optional>
    + + + + + +
    + + group + +

    A name for this Group. Not used internally but useful for debugging.

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

    The newly created group.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Group + + +
    +
    + + + + + +
    + + +

    HEXtoRGB(hex) → {array}

    @@ -518,6 +2663,1764 @@ +
    + + + +
    +

    renderTexture(key, width, height) → {Phaser.RenderTexture}

    + + +
    +
    + + +
    +

    A dynamic initially blank canvas to which images can be drawn

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

    Asset key for the render texture.

    width + + +number + + + +

    the width of the render texture.

    height + + +number + + + +

    the height of the render texture.

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

    The newly created renderTexture object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.RenderTexture + + +
    +
    + + + + + +
    + + + +
    + + + +
    +
    + + +
    +

    The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties. +However it does affect the width property.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +number + + +
    +
    + + + + + +
    + + + +
    + + + +
    +
    + + +
    +

    The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties. +However it does affect the width property.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    value + + +number + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    sprite(x, y, key, frame) → {Phaser.Sprite}

    + + +
    +
    + + +
    +

    Create a new Sprite with specific position and sprite sheet key.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    x + + +number + + + + + + + + + +

    X position of the new sprite.

    y + + +number + + + + + + + + + +

    Y position of the new sprite.

    key + + +string +| + +Phaser.RenderTexture +| + +PIXI.Texture + + + + + + + + + +

    This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.

    frame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.

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

    the newly created sprite object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Sprite + + +
    +
    + + + + + +
    + + + +
    +

    text(x, y, text, style) → {Phaser.Text}

    + + +
    +
    + + +
    +

    Creates a new <code>Text</code>.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    X position of the new text object.

    y + + +number + + + +

    Y position of the new text object.

    text + + +string + + + +

    The actual text that will be written.

    style + + +object + + + +

    The style object containing style attributes like font, font size , etc.

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

    The newly created text object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Text + + +
    +
    + + + + + +
    + + + +
    +

    tilemap(key) → {Phaser.Tilemap}

    + + +
    +
    + + +
    +

    Description.

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

    Asset key for the JSON file.

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

    The newly created tilemap object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Tilemap + + +
    +
    + + + + + +
    + + + +
    +

    tilemaplayer(x, y, width, height) → {Phaser.TilemapLayer}

    + + +
    +
    + + +
    +

    Description.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    X position of the new tilemapLayer.

    y + + +number + + + +

    Y position of the new tilemapLayer.

    width + + +number + + + +

    the width of the tilemapLayer.

    height + + +number + + + +

    the height of the tilemapLayer.

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

    The newly created tilemaplayer object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.TilemapLayer + + +
    +
    + + + + + +
    + + + +
    +

    tileset(key) → {Phaser.Tileset}

    + + +
    +
    + + +
    +

    Description.

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

    The image key as defined in the Game.Cache to use as the tileset.

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

    The newly created tileset object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Tileset + + +
    +
    + + + + + +
    + + + +
    +

    tileSprite(x, y, width, height, key, frame) → {Phaser.TileSprite}

    + + +
    +
    + + +
    +

    Creates a new <code>TileSprite</code>.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    X position of the new tileSprite.

    y + + +number + + + +

    Y position of the new tileSprite.

    width + + +number + + + +

    the width of the tilesprite.

    height + + +number + + + +

    the height of the tilesprite.

    key + + +string +| + +Phaser.RenderTexture +| + +PIXI.Texture + + + +

    This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.

    frame + + +string +| + +number + + + +

    If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.

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

    The newly created tileSprite object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.TileSprite + + +
    +
    + + + + + +
    + + + +
    +

    tween(obj) → {Phaser.Tween}

    + + +
    +
    + + +
    +

    Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    obj + + +object + + + +

    Object the tween will be run on.

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

    Description.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Tween + + +
    +
    + + + + +
    @@ -545,8 +4448,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/index.html b/docs/index.html index a0ec9616..513d1335 100644 --- a/docs/index.html +++ b/docs/index.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -352,7 +472,7 @@

    - src/Intro.js + D:\wamp\www\phaser\src/Intro.js

    @@ -364,7 +484,7 @@

    Phaser - http://www.phaser.io

    -

    v{version} - Built at: {buildDate}

    +

    v<%= version %> - Built at: <%= buildDate %>

    By Richard Davey http://www.photonstorm.com @photonstorm

    A feature-packed 2D HTML5 game framework born from the smouldering pits of Flixel and constructed via plenty of blood, sweat, tears and coffee by Richard Davey (@photonstorm).

    @@ -452,8 +572,8 @@ and my love of game development originate.


    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template.
    diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html index 7bdb5b06..32b68635 100644 --- a/docs/namespaces.list.html +++ b/docs/namespaces.list.html @@ -54,6 +54,18 @@ AnimationParser +
  • + BitmapText +
  • + +
  • + Bullet +
  • + +
  • + Button +
  • +
  • Cache
  • @@ -126,6 +138,10 @@ Sinusoidal +
  • + Events +
  • +
  • Frame
  • @@ -138,6 +154,14 @@ Game +
  • + GameObjectFactory +
  • + +
  • + Graphics +
  • +
  • Group
  • @@ -194,6 +218,14 @@ Emitter +
  • + Physics +
  • + +
  • + Arcade +
  • +
  • Plugin
  • @@ -222,6 +254,10 @@ Rectangle +
  • + RenderTexture +
  • +
  • RequestAnimationFrame
  • @@ -238,6 +274,10 @@ SoundManager +
  • + Sprite +
  • +
  • Stage
  • @@ -254,6 +294,14 @@ StateManager +
  • + Text +
  • + +
  • + TileSprite +
  • +
  • Time
  • @@ -296,10 +344,82 @@ @@ -387,6 +507,15 @@
    AnimationParser
    +
    BitmapText
    +
    + +
    Bullet
    +
    + +
    Button
    +
    +
    Cache
    @@ -441,6 +570,9 @@
    Sinusoidal
    +
    Events
    +
    +
    Frame
    @@ -450,6 +582,12 @@
    Game
    +
    GameObjectFactory
    +
    + +
    Graphics
    +
    +
    Group
    @@ -492,6 +630,12 @@
    Emitter
    +
    Physics
    +
    + +
    Arcade
    +
    +
    Plugin
    @@ -513,6 +657,9 @@
    Rectangle
    +
    RenderTexture
    +
    +
    RequestAnimationFrame
    @@ -525,6 +672,9 @@
    SoundManager
    +
    Sprite
    +
    +
    Stage
    @@ -537,6 +687,12 @@
    StateManager
    +
    Text
    +
    + +
    TileSprite
    +
    +
    Time
    @@ -598,8 +754,8 @@
    - Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 23 2013 13:51:58 GMT+0100 (BST) using the DocStrap template. + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. diff --git a/src/gameobjects/Bullet.js b/src/gameobjects/Bullet.js index d5a491d7..4da6912e 100644 --- a/src/gameobjects/Bullet.js +++ b/src/gameobjects/Bullet.js @@ -5,7 +5,7 @@ */ /** -* Create a new Bullet. +* Warning: Bullet is an experimental object that we don't advise using for now. * * A Bullet is like a stripped-down Sprite, useful for when you just need to get something moving around the screen quickly with little of the extra * features that a Sprite supports. diff --git a/src/gameobjects/Sprite.js b/src/gameobjects/Sprite.js index b83ddffe..3384cb73 100644 --- a/src/gameobjects/Sprite.js +++ b/src/gameobjects/Sprite.js @@ -5,7 +5,7 @@ */ /** -* Create a new Sprite object. Sprites are the lifeblood of your game, used for nearly everything visual. +* Create a new `Sprite` object. Sprites are the lifeblood of your game, used for nearly everything visual. * At its most basic a Sprite consists of a set of coordinates and a texture that is rendered to the canvas. * They also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input), * events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases. @@ -68,7 +68,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { /** * If you would like the Sprite to have a lifespan once 'born' you can set this to a positive value. Handy for particles, bullets, etc. * The lifespan is decremented by game.time.elapsed each update, once it reaches zero the kill() function is called. - * @property {number} lifespan + * @property {number} lifespan - The lifespan of the Sprite (in ms) before it will be killed. * @default */ this.lifespan = 0; @@ -148,7 +148,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { * Setting than anchor to 0.5,0.5 means the textures origin is centered * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right * - * @property {Phaser.Point} anchor + * @property {Phaser.Point} anchor - The anchor around with Sprite rotation and scaling takes place. */ this.anchor = new Phaser.Point(); @@ -169,7 +169,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { * Should this Sprite be automatically culled if out of range of the camera? * A culled sprite has its renderable property set to 'false'. * - * @property {boolean} autoCull + * @property {boolean} autoCull - A flag indicating if the Sprite should be automatically camera culled or not. * @default */ this.autoCull = false; @@ -310,7 +310,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { /** * You can crop the Sprites texture by modifying the crop properties. For example crop.width = 50 would set the Sprite to only render 50px wide. * The crop is only applied if you have set Sprite.cropEnabled to true. - * @property {Phaser.Rectangle} crop + * @property {Phaser.Rectangle} crop - The crop Rectangle applied to the Sprite texture before rendering. * @default */ this.crop = new Phaser.Rectangle(0, 0, this._cache.width, this._cache.height); diff --git a/src/physics/arcade/ArcadePhysics.js b/src/physics/arcade/ArcadePhysics.js index 31ae5718..3aff9dcc 100644 --- a/src/physics/arcade/ArcadePhysics.js +++ b/src/physics/arcade/ArcadePhysics.js @@ -1,52 +1,174 @@ +/** +* @author Richard Davey +* @copyright 2013 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} +*/ + +/** +* @class Phaser.Physics +*/ Phaser.Physics = {}; +/** +* Arcade Physics constructor. +* +* @class Phaser.Physics.Arcade +* @classdesc Arcade Physics Constructor +* @constructor +* @param {Phaser.Game} game reference to the current game instance. +*/ Phaser.Physics.Arcade = function (game) { + /** + * @property {Phaser.Game} game - Local reference to game. + */ this.game = game; + /** + * @property {Phaser.Point} gravity - The World gravity setting. Defaults to x: 0, y: 0, or no gravity. + */ this.gravity = new Phaser.Point; + + /** + * @property {Phaser.Rectangle} bounds - The bounds inside of which the physics world exists. Defaults to match the world bounds. + */ this.bounds = new Phaser.Rectangle(0, 0, game.world.width, game.world.height); /** - * Used by the QuadTree to set the maximum number of objects - * @type {number} + * @property {number} maxObjects - Used by the QuadTree to set the maximum number of objects per quad. */ this.maxObjects = 10; /** - * Used by the QuadTree to set the maximum number of levels - * @type {number} + * @property {number} maxLevels - Used by the QuadTree to set the maximum number of iteration levels. */ this.maxLevels = 4; + /** + * @property {number} OVERLAP_BIAS - A value added to the delta values during collision checks. + */ this.OVERLAP_BIAS = 4; - this.TILE_OVERLAP = false; + // this.TILE_OVERLAP = false; + + /** + * @property {Phaser.QuadTree} quadTree - The world QuadTree. + */ this.quadTree = new Phaser.QuadTree(this, this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels); + + /** + * @property {number} quadTreeID - The QuadTree ID. + */ this.quadTreeID = 0; // Avoid gc spikes by caching these values for re-use + + /** + * @property {Phaser.Rectangle} _bounds1 - Internal cache var. + * @private + */ this._bounds1 = new Phaser.Rectangle; + + /** + * @property {Phaser.Rectangle} _bounds2 - Internal cache var. + * @private + */ this._bounds2 = new Phaser.Rectangle; + + /** + * @property {number} _overlap - Internal cache var. + * @private + */ this._overlap = 0; + + /** + * @property {number} _maxOverlap - Internal cache var. + * @private + */ this._maxOverlap = 0; + + /** + * @property {number} _velocity1 - Internal cache var. + * @private + */ this._velocity1 = 0; + + /** + * @property {number} _velocity2 - Internal cache var. + * @private + */ this._velocity2 = 0; + + /** + * @property {number} _newVelocity1 - Internal cache var. + * @private + */ this._newVelocity1 = 0; + + /** + * @property {number} _newVelocity2 - Internal cache var. + * @private + */ this._newVelocity2 = 0; + + /** + * @property {number} _average - Internal cache var. + * @private + */ this._average = 0; + + /** + * @property {Array} _mapData - Internal cache var. + * @private + */ this._mapData = []; + + /** + * @property {number} _mapTiles - Internal cache var. + * @private + */ this._mapTiles = 0; + + /** + * @property {boolean} _result - Internal cache var. + * @private + */ this._result = false; + + /** + * @property {number} _total - Internal cache var. + * @private + */ this._total = 0; + + /** + * @property {number} _angle - Internal cache var. + * @private + */ this._angle = 0; + + /** + * @property {number} _dx - Internal cache var. + * @private + */ this._dx = 0; + + /** + * @property {number} _dy - Internal cache var. + * @private + */ this._dy = 0; }; Phaser.Physics.Arcade.prototype = { + /** + * Called automatically by a Physics body, it updates all motion related values on the Body. + * + * @method Phaser.Physics.Arcade#updateMotion + * @param {Phaser.Physics.Arcade.Body} The Body object to be updated. + */ updateMotion: function (body) { // If you're wondering why the velocity is halved and applied twice, read this: http://www.niksula.hut.fi/~hkankaan/Homepages/gravity.html @@ -74,11 +196,13 @@ Phaser.Physics.Arcade.prototype = { /** * A tween-like function that takes a starting velocity and some other factors and returns an altered velocity. * - * @param {number} Velocity Any component of velocity (e.g. 20). - * @param {number} Acceleration Rate at which the velocity is changing. - * @param {number} Drag Really kind of a deceleration, this is how much the velocity changes if Acceleration is not set. - * @param {number} Max An absolute value cap for the velocity. - * + * @method Phaser.Physics.Arcade#computeVelocity + * @param {number} axis - 1 for horizontal, 2 for vertical. + * @param {Phaser.Physics.Arcade.Body} body - The Body object to be updated. + * @param {number} velocity - Any component of velocity (e.g. 20). + * @param {number} acceleration - Rate at which the velocity is changing. + * @param {number} drag - Really kind of a deceleration, this is how much the velocity changes if Acceleration is not set. + * @param {number} mMax - An absolute value cap for the velocity. * @return {number} The altered Velocity value. */ computeVelocity: function (axis, body, velocity, acceleration, drag, max) { @@ -129,6 +253,12 @@ Phaser.Physics.Arcade.prototype = { }, + /** + * Called automatically by the core game loop. + * + * @method Phaser.Physics.Arcade#preUpdate + * @protected + */ preUpdate: function () { // Clear the tree @@ -140,6 +270,12 @@ Phaser.Physics.Arcade.prototype = { }, + /** + * Called automatically by the core game loop. + * + * @method Phaser.Physics.Arcade#postUpdate + * @protected + */ postUpdate: function () { // Clear the tree ready for the next update @@ -148,12 +284,13 @@ Phaser.Physics.Arcade.prototype = { }, /** - * Checks if two Sprite objects intersect. + * Checks if two Sprite objects overlap. * - * @param object1 The first object to check. Can be an instance of Phaser.Sprite or anything that extends it. - * @param object2 The second object to check. Can be an instance of Phaser.Sprite or anything that extends it. + * @method Phaser.Physics.Arcade#overlap + * @param {Phaser.Sprite} object1 - The first object to check. Can be an instance of Phaser.Sprite or anything that extends it. + * @param {Phaser.Sprite} object2 - The second object to check. Can be an instance of Phaser.Sprite or anything that extends it. * @returns {boolean} true if the two objects overlap. - **/ + */ overlap: function (object1, object2) { // Only test valid objects @@ -169,14 +306,16 @@ Phaser.Physics.Arcade.prototype = { /** * Checks for collision between two game objects. The objects can be Sprites, Groups, Emitters or Tilemaps. * You can perform Sprite vs. Sprite, Sprite vs. Group, Group vs. Group, Sprite vs. Tilemap or Group vs. Tilemap collisions. + * The objects are also automatically separated. * - * @param object1 The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.Tilemap - * @param object2 The second object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.Tilemap - * @param collideCallback An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you passed them to Collision.overlap. - * @param processCallback A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collideCallback will only be called if processCallback returns true. - * @param callbackContext The context in which to run the callbacks. - * @returns {boolean} true if any collisions were detected, otherwise false. - **/ + * @method Phaser.Physics.Arcade#collide + * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.Tilemap} object1 - The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.Tilemap + * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.Tilemap} object2 - The second object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.Tilemap + * @param {function} [collideCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you passed them to Collision.overlap. + * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collideCallback will only be called if processCallback returns true. + * @param {object} [callbackContext] - The context in which to run the callbacks. + * @returns {number} The number of collisions that were processed. + */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { collideCallback = collideCallback || null; @@ -257,6 +396,12 @@ Phaser.Physics.Arcade.prototype = { }, + /** + * An internal function. Use Phaser.Physics.Arcade.collide instead. + * + * @method Phaser.Physics.Arcade#collideSpriteVsTilemapLayer + * @private + */ collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext) { this._mapData = tilemapLayer.getTiles(sprite.body.x, sprite.body.y, sprite.body.width, sprite.body.height, true); @@ -297,6 +442,12 @@ Phaser.Physics.Arcade.prototype = { }, + /** + * An internal function. Use Phaser.Physics.Arcade.collide instead. + * + * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer + * @private + */ collideGroupVsTilemapLayer: function (group, tilemapLayer, collideCallback, processCallback, callbackContext) { if (group.length == 0) @@ -321,6 +472,12 @@ Phaser.Physics.Arcade.prototype = { }, + /** + * An internal function. Use Phaser.Physics.Arcade.collide instead. + * + * @method Phaser.Physics.Arcade#collideSpriteVsSprite + * @private + */ collideSpriteVsSprite: function (sprite1, sprite2, collideCallback, processCallback, callbackContext) { this.separate(sprite1.body, sprite2.body); @@ -353,6 +510,12 @@ Phaser.Physics.Arcade.prototype = { }, + /** + * An internal function. Use Phaser.Physics.Arcade.collide instead. + * + * @method Phaser.Physics.Arcade#collideSpriteVsGroup + * @private + */ collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext) { if (group.length == 0) @@ -389,6 +552,12 @@ Phaser.Physics.Arcade.prototype = { }, + /** + * An internal function. Use Phaser.Physics.Arcade.collide instead. + * + * @method Phaser.Physics.Arcade#collideGroupVsGroup + * @private + */ collideGroupVsGroup: function (group1, group2, collideCallback, processCallback, callbackContext) { if (group1.length == 0 || group2.length == 0) @@ -413,12 +582,13 @@ Phaser.Physics.Arcade.prototype = { }, - /** - * The core separation function to separate two physics bodies. - * @param body1 The first Sprite.Body to separate - * @param body2 The second Sprite.Body to separate - * @returns {boolean} Returns true if the bodies were separated, otherwise false. - */ + /** + * The core separation function to separate two physics bodies. + * @method Phaser.Physics.Arcade#separate + * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. + * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. + * @returns {boolean} Returns true if the bodies were separated, otherwise false. + */ separate: function (body1, body2) { this._result = (this.separateX(body1, body2) || this.separateY(body1, body2)); @@ -426,11 +596,12 @@ Phaser.Physics.Arcade.prototype = { }, /** - * Separates the two physics bodies on their X axis - * @param body1 The first Sprite.Body to separate - * @param body2 The second Sprite.Body to separate - * @returns {boolean} Whether the objects in fact touched and were separated along the X axis. - */ + * The core separation function to separate two physics bodies on the x axis. + * @method Phaser.Physics.Arcade#separateX + * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. + * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. + * @returns {boolean} Returns true if the bodies were separated, otherwise false. + */ separateX: function (body1, body2) { // Can't separate two immovable bodies @@ -533,11 +704,12 @@ Phaser.Physics.Arcade.prototype = { }, /** - * Separates the two physics bodies on their Y axis - * @param body1 The first Sprite.Body to separate - * @param body2 The second Sprite.Body to separate - * @returns {boolean} Whether the bodys in fact touched and were separated along the Y axis. - */ + * The core separation function to separate two physics bodies on the y axis. + * @method Phaser.Physics.Arcade#separateY + * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. + * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. + * @returns {boolean} Returns true if the bodies were separated, otherwise false. + */ separateY: function (body1, body2) { // Can't separate two immovable or non-existing bodys @@ -652,12 +824,13 @@ Phaser.Physics.Arcade.prototype = { }, - /** - * The core Collision separation function used by Collision.overlap. - * @param object1 The first GameObject to separate - * @param object2 The second GameObject to separate - * @returns {boolean} Returns true if the objects were separated, otherwise false. - */ + /** + * The core separation function to separate a physics body and a tile. + * @method Phaser.Physics.Arcade#separateTile + * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. + * @param {Phaser.Tile} tile - The tile to collide against. + * @returns {boolean} Returns true if the bodies were separated, otherwise false. + */ separateTile: function (body, tile) { this._result = (this.separateTileX(body, tile, true) || this.separateTileY(body, tile, true)); @@ -665,11 +838,12 @@ Phaser.Physics.Arcade.prototype = { }, /** - * Separates the two objects on their x axis - * @param object The GameObject to separate - * @param tile The Tile to separate - * @returns {boolean} Whether the objects in fact touched and were separated along the X axis. - */ + * The core separation function to separate a physics body and a tile on the x axis. + * @method Phaser.Physics.Arcade#separateTileX + * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. + * @param {Phaser.Tile} tile - The tile to collide against. + * @returns {boolean} Returns true if the bodies were separated, otherwise false. + */ separateTileX: function (body, tile, separate) { // Can't separate two immovable objects (tiles are always immovable) @@ -748,11 +922,12 @@ Phaser.Physics.Arcade.prototype = { }, /** - * Separates the two objects on their x axis - * @param object The GameObject to separate - * @param tile The Tile to separate - * @returns {boolean} Whether the objects in fact touched and were separated along the X axis. - */ + * The core separation function to separate a physics body and a tile on the x axis. + * @method Phaser.Physics.Arcade#separateTileY + * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. + * @param {Phaser.Tile} tile - The tile to collide against. + * @returns {boolean} Returns true if the bodies were separated, otherwise false. + */ separateTileY: function (body, tile, separate) { // Can't separate two immovable objects (tiles are always immovable) diff --git a/src/physics/arcade/Body.js b/src/physics/arcade/Body.js index a2b1f3a5..7827de7c 100644 --- a/src/physics/arcade/Body.js +++ b/src/physics/arcade/Body.js @@ -1,84 +1,318 @@ +/** +* @author Richard Davey +* @copyright 2013 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} +*/ + +/** +* The Physics Body is linked to a single Sprite. All physics operations should be performed against the body rather than +* the Sprite itself. For example you can set the velocity, acceleration, bounce values etc all on the Body. +* +* @class Phaser.Physics.Arcade.Body +* @classdesc Arcade Physics Body Constructor +* @constructor +* @param {Phaser.Sprite} sprite - The Sprite object this physics body belongs to. +*/ Phaser.Physics.Arcade.Body = function (sprite) { + /** + * @property {Phaser.Sprite} sprite - Reference to the parent Sprite. + */ this.sprite = sprite; + + /** + * @property {Phaser.Game} game - Local reference to game. + */ this.game = sprite.game; + /** + * @property {Phaser.Point} offset - The offset of the Physics Body from the Sprite x/y position. + */ this.offset = new Phaser.Point; + /** + * @property {number} x - The x position of the physics body. + * @readonly + */ this.x = sprite.x; + + /** + * @property {number} y - The y position of the physics body. + * @readonly + */ this.y = sprite.y; + + /** + * @property {number} preX - The previous x position of the physics body. + * @readonly + */ this.preX = sprite.x; + + /** + * @property {number} preY - The previous y position of the physics body. + * @readonly + */ this.preY = sprite.y; + + /** + * @property {number} preRotation - The previous rotation of the physics body. + * @readonly + */ this.preRotation = sprite.angle; + + /** + * @property {number} screenX - The x position of the physics body translated to screen space. + * @readonly + */ this.screenX = sprite.x; + + /** + * @property {number} screenY - The y position of the physics body translated to screen space. + * @readonly + */ this.screenY = sprite.y; - // un-scaled original size + /** + * @property {number} sourceWidth - The un-scaled original size. + * @readonly + */ this.sourceWidth = sprite.currentFrame.sourceSizeW; + + /** + * @property {number} sourceHeight - The un-scaled original size. + * @readonly + */ this.sourceHeight = sprite.currentFrame.sourceSizeH; - // calculated (scaled) size + /** + * @property {number} width - The calculated width of the physics body. + */ this.width = sprite.currentFrame.sourceSizeW; + + /** + * @property .numInternal ID cache + */ this.height = sprite.currentFrame.sourceSizeH; + + /** + * @property {number} halfWidth - The calculated width / 2 of the physics body. + */ this.halfWidth = Math.floor(sprite.currentFrame.sourceSizeW / 2); + + /** + * @property {number} halfHeight - The calculated height / 2 of the physics body. + */ this.halfHeight = Math.floor(sprite.currentFrame.sourceSizeH / 2); - // Scale value cache + /** + * @property {number} _sx - Internal cache var. + * @private + */ this._sx = sprite.scale.x; + + /** + * @property {number} _sy - Internal cache var. + * @private + */ this._sy = sprite.scale.y; + /** + * @property {Phaser.Point} velocity - The velocity in pixels per second sq. of the Body. + */ this.velocity = new Phaser.Point; + + /** + * @property {Phaser.Point} acceleration - The velocity in pixels per second sq. of the Body. + */ this.acceleration = new Phaser.Point; + + /** + * @property {Phaser.Point} drag - The drag applied to the motion of the Body. + */ this.drag = new Phaser.Point; + + /** + * @property {Phaser.Point} gravity - A private Gravity setting for the Body. + */ this.gravity = new Phaser.Point; + + /** + * @property {Phaser.Point} bounce - The elasticitiy of the Body when colliding. bounce.x/y = 1 means full rebound, bounce.x/y = 0.5 means 50% rebound velocity. + */ this.bounce = new Phaser.Point; + + /** + * @property {Phaser.Point} maxVelocity - The maximum velocity in pixels per second sq. that the Body can reach. + * @default + */ this.maxVelocity = new Phaser.Point(10000, 10000); + /** + * @property {number} angularVelocity - The angular velocity in pixels per second sq. of the Body. + * @default + */ this.angularVelocity = 0; + + /** + * @property {number} angularAcceleration - The angular acceleration in pixels per second sq. of the Body. + * @default + */ this.angularAcceleration = 0; + + /** + * @property {number} angularDrag - The angular drag applied to the rotation of the Body. + * @default + */ this.angularDrag = 0; + + /** + * @property {number} maxAngular - The maximum angular velocity in pixels per second sq. that the Body can reach. + * @default + */ this.maxAngular = 1000; + + /** + * @property {number} mass - The mass of the Body. + * @default + */ this.mass = 1; + /** + * @property {boolean} skipQuadTree - If the Body is an irregular shape you can set this to true to avoid it being added to the World quad tree. + * @default + */ this.skipQuadTree = false; + + /** + * @property {Array} quadTreeIDs - Internal ID cache. + * @protected + */ this.quadTreeIDs = []; + + /** + * @property {number} quadTreeIndex - Internal ID cache. + * @protected + */ this.quadTreeIndex = -1; // Allow collision + + /** + * Set the allowCollision properties to control which directions collision is processed for this Body. + * For example allowCollision.up = false means it won't collide when the collision happened while moving up. + * @property {object} allowCollision - An object containing allowed collision. + */ this.allowCollision = { none: false, any: true, up: true, down: true, left: true, right: true }; + + /** + * This object is populated with boolean values when the Body collides with another. + * touching.up = true means the collision happened to the top of this Body for example. + * @property {object} touching - An object containing touching results. + */ this.touching = { none: true, up: false, down: false, left: false, right: false }; + + /** + * This object is populated with previous touching values from the bodies previous collision. + * @property {object} wasTouching - An object containing previous touching results. + */ this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; + + /** + * @property {number} facing - A const reference to the direction the Body is traveling or facing. + * @default + */ this.facing = Phaser.NONE; + /** + * @property {boolean} immovable - An immovable Body will not receive any impacts from other bodies. + * @default + */ this.immovable = false; + + /** + * @property {boolean} moves - Set to true to allow the Physics system to move this Body, other false to move it manually. + * @default + */ this.moves = true; + + /** + * @property {number} rotation - The amount the Body is rotated. + * @default + */ this.rotation = 0; + + /** + * @property {boolean} allowRotation - Allow this Body to be rotated? (via angularVelocity, etc) + * @default + */ this.allowRotation = true; + + /** + * @property {boolean} allowGravity - Allow this Body to be influenced by the global Gravity? + * @default + */ this.allowGravity = true; - // These two flags allow you to disable the custom separation that takes place - // Used in combination with your own collision processHandler you can create whatever - // type of collision response you need. + /** + * This flag allows you to disable the custom x separation that takes place by Physics.Arcade.separate. + * Used in combination with your own collision processHandler you can create whatever type of collision response you need. + * @property {boolean} customSeparateX - Use a custom separation system or the built-in one? + * @default + */ this.customSeparateX = false; + + /** + * This flag allows you to disable the custom y separation that takes place by Physics.Arcade.separate. + * Used in combination with your own collision processHandler you can create whatever type of collision response you need. + * @property {boolean} customSeparateY - Use a custom separation system or the built-in one? + * @default + */ this.customSeparateY = false; - // When this body collides with another the amount of overlap is stored in here - // These values are useful if you want to provide your own custom separation logic. + /** + * When this body collides with another, the amount of overlap is stored here. + * @property {number} overlapX - The amount of horizontal overlap during the collision. + */ this.overlapX = 0; + + /** + * When this body collides with another, the amount of overlap is stored here. + * @property {number} overlapY - The amount of vertical overlap during the collision. + */ this.overlapY = 0; + /** + * @property {Phaser.Rectangle} hullX - The dynamically calculated hull used during collision. + */ this.hullX = new Phaser.Rectangle(); + + /** + * @property {Phaser.Rectangle} hullY - The dynamically calculated hull used during collision. + */ this.hullY = new Phaser.Rectangle(); - // If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true + /** + * If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true. + * @property {boolean} embedded - Body embed value. + */ this.embedded = false; + /** + * A Body can be set to collide against the World bounds automatically and rebound back into the World if this is set to true. Otherwise it will leave the World. + * @property {boolean} collideWorldBounds - Should the Body collide with the World bounds? + */ this.collideWorldBounds = false; }; Phaser.Physics.Arcade.Body.prototype = { + /** + * Internal method. + * + * @method Phaser.Physics.Arcade#updateBounds + * @protected + */ updateBounds: function (centerX, centerY, scaleX, scaleY) { if (scaleX != this._sx || scaleY != this._sy) @@ -93,6 +327,12 @@ Phaser.Physics.Arcade.Body.prototype = { }, + /** + * Internal method. + * + * @method Phaser.Physics.Arcade#preUpdate + * @protected + */ preUpdate: function () { // Store and reset collision flags @@ -131,8 +371,7 @@ Phaser.Physics.Arcade.Body.prototype = { this.checkWorldBounds(); } - this.updateHulls(); - } + this.updateHulls();Array } if (this.skipQuadTree == false && this.allowCollision.none == false && this.sprite.visible && this.sprite.alive) { @@ -143,6 +382,12 @@ Phaser.Physics.Arcade.Body.prototype = { }, + /** + * Internal method. + * + * @method Phaser.Physics.Arcade#postUpdate + * @protected + */ postUpdate: function () { // Calculate forward-facing edge @@ -183,6 +428,12 @@ Phaser.Physics.Arcade.Body.prototype = { }, + /** + * Internal method. + * + * @method Phaser.Physics.Arcade#updateHulls + * @protected + */ updateHulls: function () { this.hullX.setTo(this.x, this.preY, this.width, this.height); @@ -190,6 +441,12 @@ Phaser.Physics.Arcade.Body.prototype = { }, + /** + * Internal method. + * + * @method Phaser.Physics.Arcade#checkWorldBounds + * @protected + */ checkWorldBounds: function () { if (this.x < this.game.world.bounds.x) @@ -216,6 +473,17 @@ Phaser.Physics.Arcade.Body.prototype = { }, + /** + * You can modify the size of the physics Body to be any dimension you need. + * So it could be smaller or larger than the parent Sprite. You can also control the x and y offset, which + * is the position of the Body relative to the top-left of the Sprite. + * + * @method Phaser.Physics.Arcade#setSize + * @param {number} width - The width of the Body. + * @param {number} height - The height of the Body. + * @param {number} offsetX - The X offset of the Body from the Sprite position. + * @param {number} offsetY - The Y offset of the Body from the Sprite position. + */ setSize: function (width, height, offsetX, offsetY) { offsetX = offsetX || this.offset.x; @@ -231,6 +499,11 @@ Phaser.Physics.Arcade.Body.prototype = { }, + /** + * Resets all Body values (velocity, acceleration, rotation, etc) + * + * @method Phaser.Physics.Arcade#reset + */ reset: function () { this.velocity.setTo(0, 0); @@ -248,18 +521,42 @@ Phaser.Physics.Arcade.Body.prototype = { }, + /** + * Returns the absolute delta x value. + * + * @method Phaser.Physics.Arcade.Body#deltaAbsX + * @return {number} The absolute delta value. + */ deltaAbsX: function () { return (this.deltaX() > 0 ? this.deltaX() : -this.deltaX()); }, + /** + * Returns the absolute delta y value. + * + * @method Phaser.Physics.Arcade.Body#deltaAbsY + * @return {number} The absolute delta value. + */ deltaAbsY: function () { return (this.deltaY() > 0 ? this.deltaY() : -this.deltaY()); }, + /** + * Returns the delta x value. + * + * @method Phaser.Physics.Arcade.Body#deltaX + * @return {number} The delta value. + */ deltaX: function () { return this.x - this.preX; }, + /** + * Returns the delta y value. + * + * @method Phaser.Physics.Arcade.Body#deltaY + * @return {number} The delta value. + */ deltaY: function () { return this.y - this.preY; }, @@ -270,6 +567,10 @@ Phaser.Physics.Arcade.Body.prototype = { }; +/** +* @name Phaser.Physics.Arcade.Body#bottom +* @property {number} bottom - The bottom value of this Body (same as Body.y + Body.height) +*/ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { /** @@ -301,6 +602,10 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { }); +/** +* @name Phaser.Physics.Arcade.Body#right +* @property {number} right - The right value of this Body (same as Body.x + Body.width) +*/ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", { /**