diff --git a/Docs/conf.json b/Docs/conf.json index b955f215..cfc7e804 100644 --- a/Docs/conf.json +++ b/Docs/conf.json @@ -3,7 +3,7 @@ "allowUnknownTags": true }, "source": { - "include": [ "../src/Phaser.js", "../src/animation/", "../src/core/Camera.js", "../src/core/Game.js", "../src/core/Group.js", "../src/core/LinkedList.js", "../src/core/Plugin.js", "../src/core/PluginManager.js", "../src/core/Signal.js", "../src/core/SignalBinding.js" ], + "include": [ "../src/Phaser.js", "../src/animation/", "../src/core/", "../src/geom/" ], "exclude": [], "includePattern": ".+\\.js(doc)?$", "excludePattern": "(^|\\/|\\\\)_" diff --git a/Docs/out/Animation.js.html b/Docs/out/Animation.js.html index d1a4a2a6..c028b798 100644 --- a/Docs/out/Animation.js.html +++ b/Docs/out/Animation.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -436,6 +488,7 @@ Object.defineProperty(Phaser.Animation.prototype, "paused", { /** * @name Phaser.Animation#frameTotal * @property {number} frameTotal - The total number of frames in the currently loaded FrameData, or -1 if no FrameData is loaded. +* @readonly */ Object.defineProperty(Phaser.Animation.prototype, "frameTotal", { @@ -538,7 +591,7 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:37 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/AnimationManager.js.html b/Docs/out/AnimationManager.js.html index 986ad3a5..90563ccb 100644 --- a/Docs/out/AnimationManager.js.html +++ b/Docs/out/AnimationManager.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -356,6 +408,7 @@ Phaser.AnimationManager.prototype = { /** * @name Phaser.AnimationManager#frameData * @property {Phaser.Animation.FrameData} frameData - The current animations FrameData. +* @readonly */ Object.defineProperty(Phaser.AnimationManager.prototype, "frameData", { @@ -368,6 +421,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameData", { /** * @name Phaser.AnimationManager#frameTotal * @property {number} frameTotal - The total number of frames in the currently loaded FrameData, or -1 if no FrameData is loaded. +* @readonly */ Object.defineProperty(Phaser.AnimationManager.prototype, "frameTotal", { @@ -486,7 +540,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", { Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Camera.js.html b/Docs/out/Camera.js.html index 4a05f29a..765e9052 100644 --- a/Docs/out/Camera.js.html +++ b/Docs/out/Camera.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -468,7 +520,7 @@ Object.defineProperty(Phaser.Camera.prototype, "height", { Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Circle.js.html b/Docs/out/Circle.js.html new file mode 100644 index 00000000..02a5b67e --- /dev/null +++ b/Docs/out/Circle.js.html @@ -0,0 +1,681 @@ + + + + + + Phaser Source: geom/Circle.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: geom/Circle.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 Circle object with the center coordinate specified by the x and y parameters and the diameter specified by the diameter parameter. If you call this function without parameters, a circle with x, y, diameter and radius properties set to 0 is created.
    +* @class Circle
    +* @classdesc Phaser - Circle
    +* @constructor
    +* @param {number} [x] The x coordinate of the center of the circle.
    +* @param {number} [y] The y coordinate of the center of the circle.
    +* @param {number} [diameter] The diameter of the circle.
    +* @return {Phaser.Circle} This circle object
    +**/
    +Phaser.Circle = function (x, y, diameter) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +    diameter = diameter || 0;
    +
    +    /**
    +    * @property {number} x - The x coordinate of the center of the circle.
    +    **/
    +    this.x = x;
    +
    +    /**
    +    * @property {number} y - The y coordinate of the center of the circle.
    +    **/
    +    this.y = y;
    +
    +    /**
    +    * @property {number} _diameter - The diameter of the circle.
    +    * @private
    +    **/
    +    this._diameter = diameter;
    +
    +    if (diameter > 0)
    +    {
    +    	/**
    +    	* @property {number} _radius - The radius of the circle.
    +    	* @private
    +        **/
    +        this._radius = diameter * 0.5;
    +    }
    +    else
    +    {
    +        this._radius = 0;
    +    }
    +
    +};
    +
    +Phaser.Circle.prototype = {
    +
    +    /**
    +    * The circumference of the circle.
    +    * @method Phaser.Circle#circumference
    +    * @return {number}
    +    **/
    +    circumference: function () {
    +        return 2 * (Math.PI * this._radius);
    +    },
    +
    +    /**
    +    * Sets the members of Circle to the specified values.
    +    * @method Phaser.Circle#setTo
    +    * @param {number} x - The x coordinate of the center of the circle.
    +    * @param {number} y - The y coordinate of the center of the circle.
    +    * @param {number} diameter - The diameter of the circle in pixels.
    +    * @return {Circle} This circle object.
    +    **/
    +    setTo: function (x, y, diameter) {
    +        this.x = x;
    +        this.y = y;
    +        this._diameter = diameter;
    +        this._radius = diameter * 0.5;
    +        return this;
    +    },
    +
    +    /**
    +    * Copies the x, y and diameter properties from any given object to this Circle.
    +    * @method Phaser.Circle#copyFrom
    +    * @param {any} source - The object to copy from.
    +    * @return {Circle} This Circle object.
    +    **/
    +    copyFrom: function (source) {
    +        return this.setTo(source.x, source.y, source.diameter);
    +    },
    +
    +    /**
    +    * Copies the x, y and diameter properties from this Circle to any given object.
    +    * @method Phaser.Circle#copyTo
    +    * @param {any} dest - The object to copy to.
    +    * @return {Object} This dest object.
    +    **/
    +    copyTo: function(dest) {
    +        dest[x] = this.x;
    +        dest[y] = this.y;
    +        dest[diameter] = this._diameter;
    +        return dest;
    +    },
    +
    +    /**
    +    * Returns the distance from the center of the Circle object to the given object
    +    * (can be Circle, Point or anything with x/y properties)
    +    * @method Phaser.Circle#distance
    +    * @param {object} dest - The target object. Must have visible x and y properties that represent the center of the object.
    +    * @param {boolean} [round] - Round the distance to the nearest integer (default false).
    +    * @return {number} The distance between this Point object and the destination Point object.
    +    */
    +    distance: function (dest, round) {
    +
    +        if (typeof round === "undefined") { round = false }
    +
    +        if (round)
    +        {
    +            return Phaser.Math.distanceRound(this.x, this.y, dest.x, dest.y);
    +        }
    +        else
    +        {
    +            return Phaser.Math.distance(this.x, this.y, dest.x, dest.y);
    +        }
    +
    +    },
    +
    +    /**
    +    * Returns a new Circle object with the same values for the x, y, width, and height properties as this Circle object.
    +    * @method Phaser.Circle#clone
    +    * @param {Phaser.Circle} out - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
    +    * @return {Phaser.Circle} The cloned Circle object.
    +    */
    +    clone: function(out) {
    +
    +        if (typeof out === "undefined") { out = new Phaser.Circle(); }
    +
    +        return out.setTo(a.x, a.y, a.diameter);
    +
    +    },
    +
    +    /**
    +    * Return true if the given x/y coordinates are within this Circle object.
    +    * @method Phaser.Circle#contains
    +    * @param {number} x - The X value of the coordinate to test.
    +    * @param {number} y - The Y value of the coordinate to test.
    +    * @return {boolean} True if the coordinates are within this circle, otherwise false.
    +    */
    +    contains: function (x, y) {
    +        return Phaser.Circle.contains(this, x, y);
    +    },
    +
    +    /**
    +    * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle.
    +    * @method Phaser.Circle#circumferencePoint
    +    * @param {number} angle - The angle in radians (unless asDegrees is true) to return the point from.
    +    * @param {boolean} asDegrees - Is the given angle in radians (false) or degrees (true)?
    +    * @param {Phaser.Point} [out] - An optional Point object to put the result in to. If none specified a new Point object will be created.
    +    * @return {Phaser.Point} The Point object holding the result.
    +    */
    +    circumferencePoint: function (angle, asDegrees, out) {
    +        return Phaser.Circle.circumferencePoint(this, angle, asDegrees, out);
    +    },
    +
    +    /**
    +    * Adjusts the location of the Circle object, as determined by its center coordinate, by the specified amounts.
    +    * @method Phaser.Circle#offset
    +    * @param {number} dx - Moves the x value of the Circle object by this amount.
    +    * @param {number} dy - Moves the y value of the Circle object by this amount.
    +    * @return {Circle} This Circle object.
    +    **/
    +    offset: function (dx, dy) {
    +        this.x += dx;
    +        this.y += dy;
    +        return this;
    +    },
    +
    +    /**
    +    * Adjusts the location of the Circle object using a Point object as a parameter. This method is similar to the Circle.offset() method, except that it takes a Point object as a parameter.
    +    * @method Phaser.Circle#offsetPoint
    +    * @param {Point} point A Point object to use to offset this Circle object (or any valid object with exposed x and y properties).
    +    * @return {Circle} This Circle object.
    +    **/
    +    offsetPoint: function (point) {
    +        return this.offset(point.x, point.y);
    +    },
    +
    +    /**
    +    * Returns a string representation of this object.
    +    * @method Phaser.Circle#toString
    +    * @return {string} a string representation of the instance.
    +    **/
    +    toString: function () {
    +        return "[{Phaser.Circle (x=" + this.x + " y=" + this.y + " diameter=" + this.diameter + " radius=" + this.radius + ")}]";
    +    }
    +
    +};
    +
    +/**
    +* The largest distance between any two points on the circle. The same as the radius * 2.
    +* @name Phaser.Circle#diameter
    +* @property {number} diameter - Gets or sets the diameter of the circle.
    +*/
    +Object.defineProperty(Phaser.Circle.prototype, "diameter", {
    +
    +    get: function () {
    +        return this._diameter;
    +    },
    +
    +    set: function (value) {
    +        if (value > 0) {
    +            this._diameter = value;
    +            this._radius = value * 0.5;
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The length of a line extending from the center of the circle to any point on the circle itself. The same as half the diameter.
    +* @name Phaser.Circle#radius
    +* @property {number} radius - Gets or sets the radius of the circle.
    +*/
    +Object.defineProperty(Phaser.Circle.prototype, "radius", {
    +    
    +    get: function () {
    +        return this._radius;
    +    },
    +
    +    set: function (value) {
    +        if (value > 0) {
    +            this._radius = value;
    +            this._diameter = value * 2;
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The x coordinate of the leftmost point of the circle. Changing the left property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property.
    +* @name Phaser.Circle#left
    +* @propety {number} left - Gets or sets the value of the leftmost point of the circle.
    +*/
    +Object.defineProperty(Phaser.Circle.prototype, "left", {
    +    
    +    get: function () {
    +        return this.x - this._radius;
    +    },
    +
    +    set: function (value) {
    +        if (value > this.x) {
    +            this._radius = 0;
    +            this._diameter = 0;
    +        } else {
    +            this.radius = this.x - value;
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The x coordinate of the rightmost point of the circle. Changing the right property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property.
    +* @name Phaser.Circle#right
    +* @property {number} right - Gets or sets the value of the rightmost point of the circle.
    +*/
    +Object.defineProperty(Phaser.Circle.prototype, "right", {
    +
    +    get: function () {
    +        return this.x + this._radius;
    +    },
    +
    +    set: function (value) {
    +        if (value < this.x) {
    +            this._radius = 0;
    +            this._diameter = 0;
    +        } else {
    +            this.radius = value - this.x;
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The sum of the y minus the radius property. Changing the top property of a Circle object has no effect on the x and y properties, but does change the diameter.
    +* @name Phaser.Circle#top
    +* @property {number} top - Gets or sets the top of the circle.
    +*/
    +Object.defineProperty(Phaser.Circle.prototype, "top", {
    +
    +    get: function () {
    +        return this.y - this._radius;
    +    },
    +    
    +    set: function (value) {
    +        if (value > this.y) {
    +            this._radius = 0;
    +            this._diameter = 0;
    +        } else {
    +            this.radius = this.y - value;
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The sum of the y and radius properties. Changing the bottom property of a Circle object has no effect on the x and y properties, but does change the diameter.
    +* @name Phaser.Circle#bottom
    +* @property {number} bottom - Gets or sets the bottom of the circle.
    +*/
    +Object.defineProperty(Phaser.Circle.prototype, "bottom", {
    +
    +    get: function () {
    +        return this.y + this._radius;
    +    },
    +
    +    set: function (value) {
    +
    +        if (value < this.y) {
    +            this._radius = 0;
    +            this._diameter = 0;
    +        } else {
    +            this.radius = value - this.y;
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The area of this Circle.
    +* @name Phaser.Circle#area
    +* @property {number} area - The area of this circle.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.Circle.prototype, "area", {
    +
    +    get: function () {
    +        if (this._radius > 0) {
    +            return Math.PI * this._radius * this._radius;
    +        } else {
    +            return 0;
    +        }
    +    }
    +
    +});
    +
    +/**
    +* Determines whether or not this Circle object is empty. Will return a value of true if the Circle objects diameter is less than or equal to 0; otherwise false.
    +* If set to true it will reset all of the Circle objects properties to 0. A Circle object is empty if its diameter is less than or equal to 0.
    +* @name Phaser.Circle#empty
    +* @property {boolean} empty - Gets or sets the empty state of the circle.
    +*/
    +Object.defineProperty(Phaser.Circle.prototype, "empty", {
    +
    +    get: function () {
    +        return (this._diameter == 0);
    +    },
    +
    +    set: function (value) {
    +        this.setTo(0, 0, 0);
    +    }
    +
    +});
    +
    +/**
    +* Return true if the given x/y coordinates are within the Circle object.
    +* @method Phaser.Circle.contains
    +* @param {Phaser.Circle} a - The Circle to be checked.
    +* @param {number} x - The X value of the coordinate to test.
    +* @param {number} y - The Y value of the coordinate to test.
    +* @return {boolean} True if the coordinates are within this circle, otherwise false.
    +*/
    +Phaser.Circle.contains = function (a, x, y) {
    +
    +    //  Check if x/y are within the bounds first
    +    if (x >= a.left && x <= a.right && y >= a.top && y <= a.bottom) {
    +
    +        var dx = (a.x - x) * (a.x - x);
    +        var dy = (a.y - y) * (a.y - y);
    +
    +        return (dx + dy) <= (a.radius * a.radius);
    +
    +    }
    +
    +    return false;
    +
    +};
    +
    +/**
    +* Determines whether the two Circle objects match. This method compares the x, y and diameter properties.
    +* @method Phaser.Circle.equals
    +* @param {Phaser.Circle} a - The first Circle object.
    +* @param {Phaser.Circle} b - The second Circle object.
    +* @return {boolean} A value of true if the object has exactly the same values for the x, y and diameter properties as this Circle object; otherwise false.
    +*/
    +Phaser.Circle.equals = function (a, b) {
    +    return (a.x == b.x && a.y == b.y && a.diameter == b.diameter);
    +};
    +
    +/**
    +* Determines whether the two Circle objects intersect.
    +* This method checks the radius distances between the two Circle objects to see if they intersect.
    +* @method Phaser.Circle.intersects
    +* @param {Phaser.Circle} a - The first Circle object.
    +* @param {Phaser.Circle} b - The second Circle object.
    +* @return {boolean} A value of true if the specified object intersects with this Circle object; otherwise false.
    +*/
    +Phaser.Circle.intersects = function (a, b) {
    +    return (Phaser.Math.distance(a.x, a.y, b.x, b.y) <= (a.radius + b.radius));
    +};
    +
    +/**
    +* Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle.
    +* @method Phaser.Circle.circumferencePoint
    +* @param {Phaser.Circle} a - The first Circle object.
    +* @param {number} angle - The angle in radians (unless asDegrees is true) to return the point from.
    +* @param {boolean} asDegrees - Is the given angle in radians (false) or degrees (true)?
    +* @param {Phaser.Point} [out] - An optional Point object to put the result in to. If none specified a new Point object will be created.
    +* @return {Phaser.Point} The Point object holding the result.
    +*/
    +Phaser.Circle.circumferencePoint = function (a, angle, asDegrees, out) {
    +
    +    if (typeof asDegrees === "undefined") { asDegrees = false; }
    +    if (typeof out === "undefined") { out = new Phaser.Point(); }
    +
    +    if (asDegrees === true) {
    +        angle = Phaser.Math.radToDeg(angle);
    +    }
    +
    +    out.x = a.x + a.radius * Math.cos(angle);
    +    out.y = a.y + a.radius * Math.sin(angle);
    +
    +    return out;
    +
    +};
    +
    +/**
    +* Checks if the given Circle and Rectangle objects intersect.
    +* @method Phaser.Circle.intersectsRectangle
    +* @param {Phaser.Circle} c - The Circle object to test.
    +* @param {Phaser.Rectangle} r - The Rectangle object to test.
    +* @return {boolean} True if the two objects intersect, otherwise false.
    +*/
    +Phaser.Circle.intersectsRectangle = function (c, r) {
    +
    +    var cx = Math.abs(c.x - r.x - r.halfWidth);
    +    var xDist = r.halfWidth + c.radius;
    +
    +    if (cx > xDist) {
    +        return false;
    +    }
    +
    +    var cy = Math.abs(c.y - r.y - r.halfHeight);
    +    var yDist = r.halfHeight + c.radius;
    +
    +    if (cy > yDist) {
    +        return false;
    +    }
    +
    +    if (cx <= r.halfWidth || cy <= r.halfHeight) {
    +        return true;
    +    }
    +
    +    var xCornerDist = cx - r.halfWidth;
    +    var yCornerDist = cy - r.halfHeight;
    +    var xCornerDistSq = xCornerDist * xCornerDist;
    +    var yCornerDistSq = yCornerDist * yCornerDist;
    +    var maxCornerDistSq = c.radius * c.radius;
    +
    +    return xCornerDistSq + yCornerDistSq <= maxCornerDistSq;
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Frame.js.html b/Docs/out/Frame.js.html index ddd088ed..a1354c42 100644 --- a/Docs/out/Frame.js.html +++ b/Docs/out/Frame.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -276,7 +328,7 @@ Phaser.Animation.Frame.prototype = { Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/FrameData.js.html b/Docs/out/FrameData.js.html index cb183bc8..3511cc40 100644 --- a/Docs/out/FrameData.js.html +++ b/Docs/out/FrameData.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -320,6 +372,7 @@ Phaser.Animation.FrameData.prototype = { /** * @name Phaser.Animation.FrameData#total * @property {number} total - The total number of frames in this FrameData set. +* @readonly */ Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", { @@ -349,7 +402,7 @@ Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", { Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Game.js.html b/Docs/out/Game.js.html index f253b61b..e3a6ddcd 100644 --- a/Docs/out/Game.js.html +++ b/Docs/out/Game.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -591,7 +643,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", { Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Group.js.html b/Docs/out/Group.js.html index 70a2b016..a0be5682 100644 --- a/Docs/out/Group.js.html +++ b/Docs/out/Group.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -1154,6 +1206,7 @@ Phaser.Group.prototype = { /** * @name Phaser.Group#length * @property {number} length - The number of children in this Group. +* @readonly */ Object.defineProperty(Phaser.Group.prototype, "length", { @@ -1271,7 +1324,7 @@ Object.defineProperty(Phaser.Group.prototype, "visible", { Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/LinkedList.js.html b/Docs/out/LinkedList.js.html new file mode 100644 index 00000000..90ff05df --- /dev/null +++ b/Docs/out/LinkedList.js.html @@ -0,0 +1,364 @@ + + + + + + Phaser Source: core/LinkedList.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/LinkedList.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 basic linked list data structure.
    +*
    +* @class Phaser.LinkedList
    +* @constructor
    +*/
    +Phaser.LinkedList = function () {
    +
    +    /**
    +	* @property {object} next - Next element in the list.
    +	* @default
    +	*/
    +    this.next = null;
    +
    +    /**
    +	* @property {object} prev - Previous element in the list.
    +	* @default
    +	*/
    +    this.prev = null;
    +
    +    /**
    +	* @property {object} first - First element in the list.
    +	* @default
    +	*/
    +    this.first = null;
    +
    +    /**
    +	* @property {object} last - Last element in the list.
    +	* @default
    +	*/
    +    this.last = null;
    +    
    +    /**
    +	* @property {object} game - Number of elements in the list.
    +	* @default
    +	*/
    +    this.total = 0;
    +
    +};
    +
    +Phaser.LinkedList.prototype = {
    +
    +	/**
    +    * Adds a new element to this linked list.
    +	* 
    +	* @method Phaser.LinkedList#add
    +	* @param {object} child - The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through.
    +	* @return {object} The child that was added.
    +    */
    +    add: function (child) {
    +
    +    	//	If the list is empty
    +    	if (this.total == 0 && this.first == null && this.last == null)
    +    	{
    +    		this.first = child;
    +    		this.last = child;
    +	    	this.next = child;
    +	    	child.prev = this;
    +	    	this.total++;
    +    		return child;
    +    	}
    +
    +    	//	Get gets appended to the end of the list, regardless of anything, and it won't have any children of its own (non-nested list)
    +    	this.last.next = child;
    +
    +    	child.prev = this.last;
    +
    +    	this.last = child;
    +
    +		this.total++;
    +
    +		return child;
    +
    +    },
    +
    +	/**
    +    * Removes the given element from this linked list if it exists.
    + 	* 
    + 	* @method Phaser.LinkedList#remove
    + 	* @param {object} child - The child to be removed from the list.
    +    */
    +    remove: function (child) {
    +
    +    	if (child == this.first)
    +    	{
    +			// It was 'first', make 'first' point to first.next
    +    		this.first = this.first.next;
    +    	}      
    +		else if (child == this.last)
    +		{
    +			// It was 'last', make 'last' point to last.prev
    +			this.last = this.last.prev;
    +		} 
    +
    +		if (child.prev)
    +		{
    +			// make child.prev.next point to childs.next instead of child
    +			child.prev.next = child.next; 
    +		} 
    +
    +		if (child.next)
    +		{
    +			// make child.next.prev point to child.prev instead of child
    +			child.next.prev = child.prev;
    +		}
    +
    +		child.next = child.prev = null;
    +
    +		if (this.first == null )
    +		{
    +			this.last = null;
    +		}
    +
    +		this.total--;
    +
    +    },
    +
    +	/**
    +    * Calls a function on all members of this list, using the member as the context for the callback.
    +    * The function must exist on the member.
    +  	* 
    +  	* @method Phaser.LinkedList#callAll
    +  	* @param {function} callback - The function to call.
    +    */
    +    callAll: function (callback) {
    +
    +    	if (!this.first || !this.last)
    +    	{
    +    		return;
    +    	}
    +
    +		var entity = this.first;
    +		
    +		do	
    +		{
    +			if (entity && entity[callback])
    +			{
    +				entity[callback].call(entity);
    +			}
    +
    +			entity = entity.next;
    +
    +		}
    +		while(entity != this.last.next)			
    +
    +    }
    +
    +};
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Parser.js.html b/Docs/out/Parser.js.html index 0413b43e..51189dc7 100644 --- a/Docs/out/Parser.js.html +++ b/Docs/out/Parser.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -434,7 +486,7 @@ Phaser.Animation.Parser = { Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.Animation.Frame.html b/Docs/out/Phaser.Animation.Frame.html index ab4526f8..12d686ae 100644 --- a/Docs/out/Phaser.Animation.Frame.html +++ b/Docs/out/Phaser.Animation.Frame.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -2628,7 +2680,7 @@ Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.Animation.FrameData.html b/Docs/out/Phaser.Animation.FrameData.html index 650430a1..38d98ed6 100644 --- a/Docs/out/Phaser.Animation.FrameData.html +++ b/Docs/out/Phaser.Animation.FrameData.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -197,7 +249,7 @@
    -

    total

    +

    <readonly> total

    @@ -1575,7 +1627,7 @@ The frames are returned in the output array, or if none is provided in a new Arr Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.Animation.Parser.html b/Docs/out/Phaser.Animation.Parser.html index cfe17a43..3580f6d5 100644 --- a/Docs/out/Phaser.Animation.Parser.html +++ b/Docs/out/Phaser.Animation.Parser.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -1082,7 +1134,7 @@ Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.Animation.html b/Docs/out/Phaser.Animation.html index 5754fa3b..f1d09803 100644 --- a/Docs/out/Phaser.Animation.html +++ b/Docs/out/Phaser.Animation.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -687,7 +739,7 @@ It is created by the AnimationManager, consists of Animation.Frame objects and b
    Source:
    @@ -705,7 +757,7 @@ It is created by the AnimationManager, consists of Animation.Frame objects and b
    -

    frameTotal

    +

    <readonly> frameTotal

    @@ -1792,7 +1844,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat
    Source:
    @@ -2459,7 +2511,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.AnimationManager.html b/Docs/out/Phaser.AnimationManager.html index abbd306d..6c1f7ad9 100644 --- a/Docs/out/Phaser.AnimationManager.html +++ b/Docs/out/Phaser.AnimationManager.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -434,7 +486,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
    Source:
    @@ -452,7 +504,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
    -

    frameData

    +

    <readonly> frameData

    @@ -638,7 +690,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
    Source:
    @@ -656,7 +708,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
    -

    frameTotal

    +

    <readonly> frameTotal

    @@ -740,7 +792,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
    Source:
    @@ -944,7 +996,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
    Source:
    @@ -2283,7 +2335,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.Camera.html b/Docs/out/Phaser.Camera.html index a6e429bd..5a83e805 100644 --- a/Docs/out/Phaser.Camera.html +++ b/Docs/out/Phaser.Camera.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -747,7 +799,7 @@ The game automatically creates a single Stage sized camera on boot. Move the cam -Phaser.Rectangle +Phaser.Rectangle @@ -1162,7 +1214,7 @@ The game automatically creates a single Stage sized camera on boot. Move the cam -Phaser.Rectangle +Phaser.Rectangle @@ -1376,7 +1428,7 @@ Objects outside of this view are not rendered (unless set to ignore the Camera, -Phaser.Rectangle +Phaser.Rectangle @@ -1689,7 +1741,7 @@ Objects outside of this view are not rendered (unless set to ignore the Camera, -Phaser.World +Phaser.World @@ -2710,7 +2762,7 @@ without having to use game.camera.x and game.camera.y.

    Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.Circle.html b/Docs/out/Phaser.Circle.html new file mode 100644 index 00000000..4ebbc588 --- /dev/null +++ b/Docs/out/Phaser.Circle.html @@ -0,0 +1,4059 @@ + + + + + + Phaser Class: Circle + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Circle

    +
    + +
    +

    + Circle +

    + +

    Phaser - Circle

    + +
    + +
    +
    + + + + +
    +

    new Circle(x, y, diameter) → {Phaser.Circle}

    + + +
    +
    + + +
    +

    Creates a new Circle object with the center coordinate specified by the x and y parameters and the diameter specified by the diameter parameter. If you call this function without parameters, a circle with x, y, diameter and radius properties set to 0 is created.

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

    The x coordinate of the center of the circle.

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

    The y coordinate of the center of the circle.

    diameter + + +number + + + + + + <optional>
    + + + + + +

    The diameter of the circle.

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

    This circle object

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Circle + + +
    +
    + + + + + +
    + + +
    + + + + + + + + + + + + +

    Members

    + +
    + +
    +

    <readonly> area

    + + +
    +
    + +
    +

    The area of this Circle.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    area + + +number + + + +

    The area of this circle.

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

    bottom

    + + +
    +
    + +
    +

    The sum of the y and radius properties. Changing the bottom property of a Circle object has no effect on the x and y properties, but does change the diameter.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bottom + + +number + + + +

    Gets or sets the bottom of the circle.

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

    diameter

    + + +
    +
    + +
    +

    The largest distance between any two points on the circle. The same as the radius * 2.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    diameter + + +number + + + +

    Gets or sets the diameter of the circle.

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

    empty

    + + +
    +
    + +
    +

    Determines whether or not this Circle object is empty. Will return a value of true if the Circle objects diameter is less than or equal to 0; otherwise false. +If set to true it will reset all of the Circle objects properties to 0. A Circle object is empty if its diameter is less than or equal to 0.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    empty + + +boolean + + + +

    Gets or sets the empty state of the circle.

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

    left

    + + +
    +
    + +
    +

    The x coordinate of the leftmost point of the circle. Changing the left property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property.

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

    radius

    + + +
    +
    + +
    +

    The length of a line extending from the center of the circle to any point on the circle itself. The same as half the diameter.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    radius + + +number + + + +

    Gets or sets the radius of the circle.

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

    The x coordinate of the rightmost point of the circle. Changing the right property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    right + + +number + + + +

    Gets or sets the value of the rightmost point of the circle.

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

    top

    + + +
    +
    + +
    +

    The sum of the y minus the radius property. Changing the top property of a Circle object has no effect on the x and y properties, but does change the diameter.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    top + + +number + + + +

    Gets or sets the top of the circle.

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

    x

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

    The x coordinate of the center of the circle.

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

    y

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

    The y coordinate of the center of the circle.

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

    Methods

    + +
    + +
    +

    <static> circumferencePoint(a, angle, asDegrees, out) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Circle + + + + + + + + + +

    The first Circle object.

    angle + + +number + + + + + + + + + +

    The angle in radians (unless asDegrees is true) to return the point from.

    asDegrees + + +boolean + + + + + + + + + +

    Is the given angle in radians (false) or degrees (true)?

    out + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    An optional Point object to put the result in to. If none specified a new Point object will be created.

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

    The Point object holding the result.

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

    <static> contains(a, x, y) → {boolean}

    + + +
    +
    + + +
    +

    Return true if the given x/y coordinates are within the Circle object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Circle + + + +

    The Circle to be checked.

    x + + +number + + + +

    The X value of the coordinate to test.

    y + + +number + + + +

    The Y value of the coordinate to test.

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

    True if the coordinates are within this circle, otherwise false.

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

    <static> equals(a, b) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the two Circle objects match. This method compares the x, y and diameter properties.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Circle + + + +

    The first Circle object.

    b + + +Phaser.Circle + + + +

    The second Circle object.

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

    A value of true if the object has exactly the same values for the x, y and diameter properties as this Circle object; otherwise false.

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

    <static> intersects(a, b) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the two Circle objects intersect. +This method checks the radius distances between the two Circle objects to see if they intersect.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Circle + + + +

    The first Circle object.

    b + + +Phaser.Circle + + + +

    The second Circle object.

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

    A value of true if the specified object intersects with this Circle object; otherwise false.

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

    <static> intersectsRectangle(c, r) → {boolean}

    + + +
    +
    + + +
    +

    Checks if the given Circle and Rectangle objects intersect.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    c + + +Phaser.Circle + + + +

    The Circle object to test.

    r + + +Phaser.Rectangle + + + +

    The Rectangle object to test.

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

    True if the two objects intersect, otherwise false.

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

    circumference() → {number}

    + + +
    +
    + + +
    +

    The circumference of the circle.

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

    circumferencePoint(angle, asDegrees, out) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    angle + + +number + + + + + + + + + +

    The angle in radians (unless asDegrees is true) to return the point from.

    asDegrees + + +boolean + + + + + + + + + +

    Is the given angle in radians (false) or degrees (true)?

    out + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    An optional Point object to put the result in to. If none specified a new Point object will be created.

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

    The Point object holding the result.

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

    clone(out) → {Phaser.Circle}

    + + +
    +
    + + +
    +

    Returns a new Circle object with the same values for the x, y, width, and height properties as this Circle object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    out + + +Phaser.Circle + + + +

    Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.

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

    The cloned Circle object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Circle + + +
    +
    + + + + + +
    + + + +
    +

    contains(x, y) → {boolean}

    + + +
    +
    + + +
    +

    Return true if the given x/y coordinates are within this Circle object.

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

    The X value of the coordinate to test.

    y + + +number + + + +

    The Y value of the coordinate to test.

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

    True if the coordinates are within this circle, otherwise false.

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

    copyFrom(source) → {Circle}

    + + +
    +
    + + +
    +

    Copies the x, y and diameter properties from any given object to this Circle.

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

    The object to copy from.

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

    This Circle object.

    +
    + + + +
    +
    + Type +
    +
    + +Circle + + +
    +
    + + + + + +
    + + + +
    +

    copyTo(dest) → {Object}

    + + +
    +
    + + +
    +

    Copies the x, y and diameter properties from this Circle to any given object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    dest + + +any + + + +

    The object to copy to.

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

    This dest object.

    +
    + + + +
    +
    + Type +
    +
    + +Object + + +
    +
    + + + + + +
    + + + +
    +

    distance(dest, round) → {number}

    + + +
    +
    + + +
    +

    Returns the distance from the center of the Circle object to the given object +(can be Circle, Point or anything with x/y properties)

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    dest + + +object + + + + + + + + + +

    The target object. Must have visible x and y properties that represent the center of the object.

    round + + +boolean + + + + + + <optional>
    + + + + + +

    Round the distance to the nearest integer (default false).

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

    The distance between this Point object and the destination Point object.

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

    offset(dx, dy) → {Circle}

    + + +
    +
    + + +
    +

    Adjusts the location of the Circle object, as determined by its center coordinate, by the specified amounts.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    dx + + +number + + + +

    Moves the x value of the Circle object by this amount.

    dy + + +number + + + +

    Moves the y value of the Circle object by this amount.

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

    This Circle object.

    +
    + + + +
    +
    + Type +
    +
    + +Circle + + +
    +
    + + + + + +
    + + + +
    +

    offsetPoint(point) → {Circle}

    + + +
    +
    + + +
    +

    Adjusts the location of the Circle object using a Point object as a parameter. This method is similar to the Circle.offset() method, except that it takes a Point object as a parameter.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    point + + +Point + + + +

    A Point object to use to offset this Circle object (or any valid object with exposed x and y properties).

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

    This Circle object.

    +
    + + + +
    +
    + Type +
    +
    + +Circle + + +
    +
    + + + + + +
    + + + +
    +

    setTo(x, y, diameter) → {Circle}

    + + +
    +
    + + +
    +

    Sets the members of Circle to the specified values.

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

    The x coordinate of the center of the circle.

    y + + +number + + + +

    The y coordinate of the center of the circle.

    diameter + + +number + + + +

    The diameter of the circle in pixels.

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

    This circle object.

    +
    + + + +
    +
    + Type +
    +
    + +Circle + + +
    +
    + + + + + +
    + + + +
    +

    toString() → {string}

    + + +
    +
    + + +
    +

    Returns a string representation of this object.

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

    a string representation of the instance.

    +
    + + + +
    +
    + Type +
    +
    + +string + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Game.html b/Docs/out/Phaser.Game.html index 184e7781..c5a3c4d8 100644 --- a/Docs/out/Phaser.Game.html +++ b/Docs/out/Phaser.Game.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -3043,7 +3095,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on -Phaser.Stage +Phaser.Stage @@ -3664,7 +3716,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on -Phaser.World +Phaser.World @@ -4147,7 +4199,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.Group.html b/Docs/out/Phaser.Group.html index dd422aea..c821b008 100644 --- a/Docs/out/Phaser.Group.html +++ b/Docs/out/Phaser.Group.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -462,7 +514,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -687,7 +739,7 @@ This will have no impact on the rotation value of its children, but it will upda
    -

    length

    +

    <readonly> length

    @@ -980,7 +1032,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1184,7 +1236,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1291,7 +1343,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -1398,7 +1450,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -6073,7 +6125,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Phaser.LinkedList.html b/Docs/out/Phaser.LinkedList.html new file mode 100644 index 00000000..c9337926 --- /dev/null +++ b/Docs/out/Phaser.LinkedList.html @@ -0,0 +1,1226 @@ + + + + + + Phaser Class: LinkedList + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: LinkedList

    +
    + +
    +

    + LinkedList +

    + +

    Phaser.LinkedList

    + +
    + +
    +
    + + + + +
    +

    new LinkedList()

    + + +
    +
    + + +
    +

    A basic linked list data structure.

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

    Members

    + +
    + +
    +

    first

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    first + + +object + + + +

    First element in the list.

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

    last

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    last + + +object + + + +

    Last element in the list.

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

    next

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    next + + +object + + + +

    Next element in the list.

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

    prev

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    prev + + +object + + + +

    Previous element in the list.

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

    total

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +object + + + +

    Number of elements in the list.

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

    Methods

    + +
    + +
    +

    add(child) → {object}

    + + +
    +
    + + +
    +

    Adds a new element to this linked list.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    child + + +object + + + +

    The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through.

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

    The child that was added.

    +
    + + + +
    +
    + Type +
    +
    + +object + + +
    +
    + + + + + +
    + + + +
    +

    callAll(callback)

    + + +
    +
    + + +
    +

    Calls a function on all members of this list, using the member as the context for the callback. +The function must exist on the member.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    callback + + +function + + + +

    The function to call.

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

    remove(child)

    + + +
    +
    + + +
    +

    Removes the given element from this linked list if it exists.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    child + + +object + + + +

    The child to be removed from the list.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Plugin.html b/Docs/out/Phaser.Plugin.html new file mode 100644 index 00000000..d6e5d47d --- /dev/null +++ b/Docs/out/Phaser.Plugin.html @@ -0,0 +1,1578 @@ + + + + + + Phaser Class: Plugin + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Plugin

    +
    + +
    +

    + Plugin +

    + +

    Phaser - Plugin

    + +
    + +
    +
    + + + + +
    +

    new Plugin(game, parent)

    + + +
    +
    + + +
    +

    This is a base Plugin template to use for any Phaser plugin development.

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

    A reference to the currently running game.

    parent + + +Any + + + +

    The object that owns this plugin, usually Phaser.PluginManager.

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

    Members

    + +
    + +
    +

    active

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    active + + +boolean + + + +

    A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped.

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

    game

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

    A reference to the currently running game.

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

    hasPostRender

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    hasPostRender + + +boolean + + + +

    A flag to indicate if this plugin has a postRender method.

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

    hasPreUpdate

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    hasPreUpdate + + +boolean + + + +

    A flag to indicate if this plugin has a preUpdate method.

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

    hasRender

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    hasRender + + +boolean + + + +

    A flag to indicate if this plugin has a render method.

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

    hasUpdate

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    hasUpdate + + +boolean + + + +

    A flag to indicate if this plugin has an update method.

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

    parent

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    parent + + +Any + + + +

    The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null.

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

    visible

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    visible + + +boolean + + + +

    A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped.

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

    Methods

    + +
    + +
    +

    destroy()

    + + +
    +
    + + +
    +

    Clear down this Plugin and null out references

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

    postRender()

    + + +
    +
    + + +
    +

    Post-render is called after the Game Renderer and State.render have run. +It is only called if visible is set to true.

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

    preUpdate()

    + + +
    +
    + + +
    +

    Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics). +It is only called if active is set to true.

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

    render()

    + + +
    +
    + + +
    +

    Render is called right after the Game Renderer completes, but before the State.render. +It is only called if visible is set to true.

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

    update()

    + + +
    +
    + + +
    +

    Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render. +It is only called if active is set to true.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Point.html b/Docs/out/Phaser.Point.html new file mode 100644 index 00000000..405b7af6 --- /dev/null +++ b/Docs/out/Phaser.Point.html @@ -0,0 +1,4768 @@ + + + + + + Phaser Class: Point + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Point

    +
    + +
    +

    + Point +

    + +

    The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

    + +
    + +
    +
    + + + + +
    +

    new Point(x, y)

    + + +
    +
    + + +
    +

    Creates a new Point. If you pass no parameters a Point is created set to (0,0).

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

    The horizontal position of this Point (default 0)

    y + + +number + + + +

    The vertical position of this Point (default 0)

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

    Members

    + +
    + +
    +

    x

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

    The x coordinate of the point.

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

    y

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

    The y coordinate of the point.

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

    Methods

    + +
    + +
    +

    <static> add(a, b, out) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Adds the coordinates of two points together to create a new point.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Point + + + + + + + + + +

    The first Point object.

    b + + +Phaser.Point + + + + + + + + + +

    The second Point object.

    out + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    Optional Point to store the value in, if not supplied a new Point object will be created.

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

    The new Point object.

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

    <static> distance(a, b, round) → {number}

    + + +
    +
    + + +
    +

    Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x/y properties).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +object + + + + + + + + + +

    The target object. Must have visible x and y properties that represent the center of the object.

    b + + +object + + + + + + + + + +

    The target object. Must have visible x and y properties that represent the center of the object.

    round + + +boolean + + + + + + <optional>
    + + + + + +

    Round the distance to the nearest integer (default false).

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

    The distance between this Point object and the destination Point object.

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

    <static> divide(a, b, out) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Divides the coordinates of two points to create a new point.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Point + + + + + + + + + +

    The first Point object.

    b + + +Phaser.Point + + + + + + + + + +

    The second Point object.

    out + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    Optional Point to store the value in, if not supplied a new Point object will be created.

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

    The new Point object.

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

    <static> equals(a, b) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the two given Point objects are equal. They are considered equal if they have the same x and y values.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Point + + + +

    The first Point object.

    b + + +Phaser.Point + + + +

    The second Point object.

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

    A value of true if the Points are equal, otherwise false.

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

    <static> multiply(a, b, out) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Multiplies the coordinates of two points to create a new point.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Point + + + + + + + + + +

    The first Point object.

    b + + +Phaser.Point + + + + + + + + + +

    The second Point object.

    out + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    Optional Point to store the value in, if not supplied a new Point object will be created.

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

    The new Point object.

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

    <static> rotate(a, x, y, angle, asDegrees, distance) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Rotates a Point around the x/y coordinates given to the desired angle.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Point + + + +

    The Point object to rotate.

    x + + +number + + + +

    The x coordinate of the anchor point

    y + + +number + + + +

    The y coordinate of the anchor point

    angle + + +number + + + +

    The angle in radians (unless asDegrees is true) to rotate the Point to.

    asDegrees + + +boolean + + + +

    Is the given rotation in radians (false) or degrees (true)?

    distance + + +number + + + +

    An optional distance constraint between the Point and the anchor.

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

    The modified point object.

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

    <static> subtract(a, b, out) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Subtracts the coordinates of two points to create a new point.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Point + + + + + + + + + +

    The first Point object.

    b + + +Phaser.Point + + + + + + + + + +

    The second Point object.

    out + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    Optional Point to store the value in, if not supplied a new Point object will be created.

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

    The new Point object.

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

    add(x, y) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Adds the given x and y values to this Point.

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

    The value to add to Point.x.

    y + + +number + + + +

    The value to add to Point.y.

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

    This Point object. Useful for chaining method calls.

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

    clamp(min, max) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Clamps this Point object values to be between the given min and max.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    min + + +number + + + +

    The minimum value to clamp this Point to.

    max + + +number + + + +

    The maximum value to clamp this Point to.

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

    This Point object.

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

    clampX(min, max) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Clamps the x value of this Point to be between the given min and max.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    min + + +number + + + +

    The minimum value to clamp this Point to.

    max + + +number + + + +

    The maximum value to clamp this Point to.

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

    This Point object.

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

    clampY(min, max) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Clamps the y value of this Point to be between the given min and max

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    min + + +number + + + +

    The minimum value to clamp this Point to.

    max + + +number + + + +

    The maximum value to clamp this Point to.

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

    This Point object.

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

    clone(output) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Creates a copy of the given Point.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    output + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    Optional Point object. If given the values will be set into this object, otherwise a brand new Point object will be created and returned.

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

    The new Point object.

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

    copyFrom(source) → {Point}

    + + +
    +
    + + +
    +

    Copies the x and y properties from any given object to this Point.

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

    The object to copy from.

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

    This Point object.

    +
    + + + +
    +
    + Type +
    +
    + +Point + + +
    +
    + + + + + +
    + + + +
    +

    copyFrom(source) → {Point}

    + + +
    +
    + + +
    +

    Copies the x and y properties from any given object to this Point.

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

    The object to copy from.

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

    This Point object.

    +
    + + + +
    +
    + Type +
    +
    + +Point + + +
    +
    + + + + + +
    + + + +
    +

    copyTo(dest) → {Object}

    + + +
    +
    + + +
    +

    Copies the x and y properties from this Point to any given object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    dest + + +any + + + +

    The object to copy to.

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

    The dest object.

    +
    + + + +
    +
    + Type +
    +
    + +Object + + +
    +
    + + + + + +
    + + + +
    +

    distance(dest, round) → {number}

    + + +
    +
    + + +
    +

    Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x/y properties)

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    dest + + +object + + + + + + + + + +

    The target object. Must have visible x and y properties that represent the center of the object.

    round + + +boolean + + + + + + <optional>
    + + + + + +

    Round the distance to the nearest integer (default false).

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

    The distance between this Point object and the destination Point object.

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

    divide(x, y) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Divides Point.x and Point.y by the given x and y values.

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

    The value to divide Point.x by.

    y + + +number + + + +

    The value to divide Point.x by.

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

    This Point object. Useful for chaining method calls.

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

    equals(a) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the given objects x/y values are equal to this Point object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Point + + + +

    The first object to compare.

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

    A value of true if the Points are equal, otherwise false.

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

    invert() → {Point}

    + + +
    +
    + + +
    +

    Inverts the x and y values of this Point

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

    This Point object.

    +
    + + + +
    +
    + Type +
    +
    + +Point + + +
    +
    + + + + + +
    + + + +
    +

    multiply(x, y) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Multiplies Point.x and Point.y by the given x and y values.

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

    The value to multiply Point.x by.

    y + + +number + + + +

    The value to multiply Point.x by.

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

    This Point object. Useful for chaining method calls.

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

    rotate(x, y, angle, asDegrees, distance) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Rotates this Point around the x/y coordinates given to the desired angle.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    x + + +number + + + + + + + + + +

    The x coordinate of the anchor point

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

    The y coordinate of the anchor point

    angle + + +number + + + + + + + + + +

    The angle in radians (unless asDegrees is true) to rotate the Point to.

    asDegrees + + +boolean + + + + + + + + + +

    Is the given rotation in radians (false) or degrees (true)?

    distance + + +number + + + + + + <optional>
    + + + + + +

    An optional distance constraint between the Point and the anchor.

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

    The modified point object.

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

    setTo(x, y) → {Point}

    + + +
    +
    + + +
    +

    Sets the x and y values of this Point object to the given coordinates.

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

    The horizontal position of this point.

    y + + +number + + + +

    The vertical position of this point.

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

    This Point object. Useful for chaining method calls.

    +
    + + + +
    +
    + Type +
    +
    + +Point + + +
    +
    + + + + + +
    + + + +
    +

    subtract(x, y) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Subtracts the given x and y values from this Point.

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

    The value to subtract from Point.x.

    y + + +number + + + +

    The value to subtract from Point.y.

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

    This Point object. Useful for chaining method calls.

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

    toString() → {string}

    + + +
    +
    + + +
    +

    Returns a string representation of this object.

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

    A string representation of the instance.

    +
    + + + +
    +
    + Type +
    +
    + +string + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Rectangle.html b/Docs/out/Phaser.Rectangle.html new file mode 100644 index 00000000..e77f6465 --- /dev/null +++ b/Docs/out/Phaser.Rectangle.html @@ -0,0 +1,7109 @@ + + + + + + Phaser Class: Rectangle + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Rectangle

    +
    + +
    +

    + Rectangle +

    + +

    Phaser.Rectangle

    + +
    + +
    +
    + + + + +
    +

    new Rectangle(x, y, width, height) → {Rectangle}

    + + +
    +
    + + +
    +

    Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified width and height parameters. If you call this function without parameters, a Rectangle with x, y, width, and height properties set to 0 is created.

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

    The x coordinate of the top-left corner of the Rectangle.

    y + + +number + + + +

    The y coordinate of the top-left corner of the Rectangle.

    width + + +number + + + +

    The width of the Rectangle in pixels.

    height + + +number + + + +

    The height of the Rectangle in pixels.

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

    This Rectangle object.

    +
    + + + +
    +
    + Type +
    +
    + +Rectangle + + +
    +
    + + + + + +
    + + +
    + + + + + + + + + + + + +

    Members

    + +
    + +
    +

    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.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bottom + + +number + + + +

    The sum of the y and height properties.

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

    bottom

    + + +
    +
    + +
    +

    The location of the Rectangles bottom right corner as a Point object.

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

    Gets or sets the location of the Rectangles bottom right corner as a Point object.

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

    centerX

    + + +
    +
    + +
    +

    The x coordinate of the center of the Rectangle.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    centerX + + +number + + + +

    The x coordinate of the center of the Rectangle.

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

    centerY

    + + +
    +
    + +
    +

    The y coordinate of the center of the Rectangle.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    centerY + + +number + + + +

    The y coordinate of the center of the Rectangle.

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

    empty

    + + +
    +
    + +
    +

    Determines whether or not this Rectangle object is empty. A Rectangle object is empty if its width or height is less than or equal to 0. +If set to true then all of the Rectangle properties are set to 0.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    empty + + +boolean + + + +

    Gets or sets the Rectangles empty state.

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

    <readonly> halfHeight

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    halfHeight + + +number + + + +

    Half of the height of the Rectangle.

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

    <readonly> halfWidth

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    halfWidth + + +number + + + +

    Half of the width of the Rectangle.

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

    height

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

    Description.

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

    left

    + + +
    +
    + +
    +

    The x coordinate of the left of the Rectangle. Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    left + + +number + + + +

    The x coordinate of the left of the Rectangle.

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

    <readonly> perimeter

    + + +
    +
    + +
    +

    The perimeter size of the Rectangle. This is the sum of all 4 sides.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    perimeter + + +number + + + +

    The perimeter size of the Rectangle. This is the sum of all 4 sides.

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

    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.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    right + + +number + + + +

    The sum of the x and width properties.

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

    top

    + + +
    +
    + +
    +

    The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. +However it does affect the height property, whereas changing the y value does not affect the height property.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    top + + +number + + + +

    The y coordinate of the top of the Rectangle.

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

    topLeft

    + + +
    +
    + +
    +

    The location of the Rectangles top left corner as a Point object.

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

    The location of the Rectangles top left corner as a Point object.

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

    <readonly> volume

    + + +
    +
    + +
    +

    The volume of the Rectangle derived from width * height.

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

    The volume of the Rectangle derived from width * height.

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

    width

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

    Description.

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

    x

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

    Description.

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

    y

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

    Description.

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

    Methods

    + +
    + +
    +

    <static> clone(a, output) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Rectangle + + + + + + + + + +

    The Rectangle object.

    output + + +Phaser.Rectangle + + + + + + <optional>
    + + + + + +

    Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    <static> contains(a, x, y) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the specified coordinates are contained within the region defined by this Rectangle object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Rectangle + + + +

    The Rectangle object.

    x + + +number + + + +

    The x coordinate of the point to test.

    y + + +number + + + +

    The y coordinate of the point to test.

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

    A value of true if the Rectangle object contains the specified point; otherwise false.

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

    <static> containsPoint(a, point) → {boolean}

    + + +
    +
    + + +
    +

    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.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Rectangle + + + +

    The Rectangle object.

    point + + +Phaser.Point + + + +

    The point object being checked. Can be Point or any object with .x and .y values.

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

    A value of true if the Rectangle object contains the specified point; otherwise false.

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

    <static> containsRect(a, b) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the first Rectangle object is fully contained within the second Rectangle object. +A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Rectangle + + + +

    The first Rectangle object.

    b + + +Phaser.Rectangle + + + +

    The second Rectangle object.

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

    A value of true if the Rectangle object contains the specified point; otherwise false.

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

    <static> equals(a, b) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the two Rectangles are equal. +This method compares the x, y, width and height properties of each Rectangle.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Rectangle + + + +

    The first Rectangle object.

    b + + +Phaser.Rectangle + + + +

    The second Rectangle object.

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

    A value of true if the two Rectangles have exactly the same values for the x, y, width and height properties; otherwise false.

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

    <static> inflate(a, dx, dy) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    Increases the size of the Rectangle object by the specified amounts. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Rectangle + + + +

    The Rectangle object.

    dx + + +number + + + +

    The amount to be added to the left side of the Rectangle.

    dy + + +number + + + +

    The amount to be added to the bottom side of the Rectangle.

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

    This Rectangle object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    <static> inflatePoint(a, point) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    Increases the size of the Rectangle object. This method is similar to the Rectangle.inflate() method except it takes a Point object as a parameter.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Rectangle + + + +

    The Rectangle object.

    point + + +Phaser.Point + + + +

    The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object.

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

    The Rectangle object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    <static> intersection(a, b, out) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the Rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Rectangle + + + + + + + + + +

    The first Rectangle object.

    b + + +Phaser.Rectangle + + + + + + + + + +

    The second Rectangle object.

    out + + +Phaser.Rectangle + + + + + + <optional>
    + + + + + +

    Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned.

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

    A Rectangle object that equals the area of intersection. If the Rectangles do not intersect, this method returns an empty Rectangle object; that is, a Rectangle with its x, y, width, and height properties set to 0.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    <static> intersects(a, b, tolerance) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the two Rectangles intersect with each other. +This method checks the x, y, width, and height properties of the Rectangles.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +Phaser.Rectangle + + + +

    The first Rectangle object.

    b + + +Phaser.Rectangle + + + +

    The second Rectangle object.

    tolerance + + +number + + + +

    A tolerance value to allow for an intersection test with padding, default to 0

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

    A value of true if the specified object intersects with this Rectangle object; otherwise false.

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

    <static> intersectsRaw(left, right, top, bottom, tolerance) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the object specified intersects (overlaps) with the given values.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    left + + +number + + + +

    Description.

    right + + +number + + + +

    Description.

    top + + +number + + + +

    Description.

    bottom + + +number + + + +

    Description.

    tolerance + + +number + + + +

    A tolerance value to allow for an intersection test with padding, default to 0

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

    A value of true if the specified object intersects with the Rectangle; otherwise false.

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

    <static> size(a, output) → {Phaser.Point}

    + + +
    +
    + + +
    +

    The size of the Rectangle object, expressed as a Point object with the values of the width and height properties.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Rectangle + + + + + + + + + +

    The Rectangle object.

    output + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    Optional Point object. If given the values will be set into the object, otherwise a brand new Point object will be created and returned.

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

    The size of the Rectangle object

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

    <static> union(a, b, out) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    Adds two Rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two Rectangles.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    a + + +Phaser.Rectangle + + + + + + + + + +

    The first Rectangle object.

    b + + +Phaser.Rectangle + + + + + + + + + +

    The second Rectangle object.

    out + + +Phaser.Rectangle + + + + + + <optional>
    + + + + + +

    Optional Rectangle object. If given the new values will be set into this object, otherwise a brand new Rectangle object will be created and returned.

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

    A Rectangle object that is the union of the two Rectangles.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    clone(output) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    output + + +Phaser.Rectangle + + + + + + <optional>
    + + + + + +

    Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    contains(x, y) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the specified coordinates are contained within the region defined by this Rectangle object.

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

    The x coordinate of the point to test.

    y + + +number + + + +

    The y coordinate of the point to test.

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

    A value of true if the Rectangle object contains the specified point; otherwise false.

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

    containsRect(b) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the first Rectangle object is fully contained within the second Rectangle object. +A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    b + + +Phaser.Rectangle + + + +

    The second Rectangle object.

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

    A value of true if the Rectangle object contains the specified point; otherwise false.

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

    copyFrom(source) → {Rectangle}

    + + +
    +
    + + +
    +

    Copies the x, y, width and height properties from any given object to this Rectangle.

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

    The object to copy from.

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

    This Rectangle object.

    +
    + + + +
    +
    + Type +
    +
    + +Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    copyTo(source) → {object}

    + + +
    +
    + + +
    +

    Copies the x, y, width and height properties from this Rectangle to any given object.

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

    The object to copy to.

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

    This object.

    +
    + + + +
    +
    + Type +
    +
    + +object + + +
    +
    + + + + + +
    + + + +
    +

    equals(b) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the two Rectangles are equal. +This method compares the x, y, width and height properties of each Rectangle.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    b + + +Phaser.Rectangle + + + +

    The second Rectangle object.

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

    A value of true if the two Rectangles have exactly the same values for the x, y, width and height properties; otherwise false.

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

    floor()

    + + +
    +
    + + +
    +

    Runs Math.floor() on both the x and y values of this Rectangle.

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

    inflate(dx, dy) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    Increases the size of the Rectangle object by the specified amounts. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    dx + + +number + + + +

    The amount to be added to the left side of the Rectangle.

    dy + + +number + + + +

    The amount to be added to the bottom side of the Rectangle.

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

    This Rectangle object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    intersection(b, out) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the Rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    b + + +Phaser.Rectangle + + + +

    The second Rectangle object.

    out + + +Phaser.Rectangle + + + +

    Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned.

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

    A Rectangle object that equals the area of intersection. If the Rectangles do not intersect, this method returns an empty Rectangle object; that is, a Rectangle with its x, y, width, and height properties set to 0.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    intersects(b, tolerance) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the two Rectangles intersect with each other. +This method checks the x, y, width, and height properties of the Rectangles.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    b + + +Phaser.Rectangle + + + +

    The second Rectangle object.

    tolerance + + +number + + + +

    A tolerance value to allow for an intersection test with padding, default to 0.

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

    A value of true if the specified object intersects with this Rectangle object; otherwise false.

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

    intersectsRaw(left, right, top, bottomt, tolerance) → {boolean}

    + + +
    +
    + + +
    +

    Determines whether the object specified intersects (overlaps) with the given values.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    left + + +number + + + +

    Description.

    right + + +number + + + +

    Description.

    top + + +number + + + +

    Description.

    bottomt + + +number + + + +

    Description.

    tolerance + + +number + + + +

    A tolerance value to allow for an intersection test with padding, default to 0

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

    A value of true if the specified object intersects with the Rectangle; otherwise false.

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

    offset(dx, dy) → {Rectangle}

    + + +
    +
    + + +
    +

    Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    dx + + +number + + + +

    Moves the x value of the Rectangle object by this amount.

    dy + + +number + + + +

    Moves the y value of the Rectangle object by this amount.

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

    This Rectangle object.

    +
    + + + +
    +
    + Type +
    +
    + +Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    offsetPoint(point) → {Rectangle}

    + + +
    +
    + + +
    +

    Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    point + + +Point + + + +

    A Point object to use to offset this Rectangle object.

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

    This Rectangle object.

    +
    + + + +
    +
    + Type +
    +
    + +Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    setTo(x, y, width, height) → {Rectangle}

    + + +
    +
    + + +
    +

    Sets the members of Rectangle to the specified values.

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

    The x coordinate of the top-left corner of the Rectangle.

    y + + +number + + + +

    The y coordinate of the top-left corner of the Rectangle.

    width + + +number + + + +

    The width of the Rectangle in pixels.

    height + + +number + + + +

    The height of the Rectangle in pixels.

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

    This Rectangle object

    +
    + + + +
    +
    + Type +
    +
    + +Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    size(output) → {Phaser.Point}

    + + +
    +
    + + +
    +

    The size of the Rectangle object, expressed as a Point object with the values of the width and height properties.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    output + + +Phaser.Point + + + + + + <optional>
    + + + + + +

    Optional Point object. If given the values will be set into the object, otherwise a brand new Point object will be created and returned.

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

    The size of the Rectangle object.

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

    toString() → {string}

    + + +
    +
    + + +
    +

    Returns a string representation of this object.

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

    A string representation of the instance.

    +
    + + + +
    +
    + Type +
    +
    + +string + + +
    +
    + + + + + +
    + + + +
    +

    union(b, out) → {Phaser.Rectangle}

    + + +
    +
    + + +
    +

    Adds two Rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two Rectangles.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    b + + +Phaser.Rectangle + + + + + + + + + +

    The second Rectangle object.

    out + + +Phaser.Rectangle + + + + + + <optional>
    + + + + + +

    Optional Rectangle object. If given the new values will be set into this object, otherwise a brand new Rectangle object will be created and returned.

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

    A Rectangle object that is the union of the two Rectangles.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Rectangle + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Signal.html b/Docs/out/Phaser.Signal.html new file mode 100644 index 00000000..b319e1b8 --- /dev/null +++ b/Docs/out/Phaser.Signal.html @@ -0,0 +1,2065 @@ + + + + + + Phaser Class: Signal + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Signal

    +
    + +
    +

    + Signal +

    + +

    A Signal is used for object communication via a custom broadcaster instead of Events.

    + +
    + +
    +
    + + + + +
    +

    new Signal()

    + + +
    +
    + + + + + + + + + + +
    + + + + + + + + + + + +
    Author:
    +
    +
      +
    • Miller Medeiros http://millermedeiros.github.com/js-signals/
    • +
    +
    + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + +

    Members

    + +
    + +
    +

    active

    + + +
    +
    + +
    +

    If Signal is active and should broadcast events.

    +

    <p><strong>IMPORTANT:</strong> Setting this property during a dispatch will only affect the next dispatch, if you want to stop the propagation of a signal use halt() instead.</p>

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    active + + +boolean + + + +
    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • true
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    memorize

    + + +
    +
    + +
    +

    If Signal should keep record of previously dispatched parameters and +automatically execute listener during add()/addOnce() if Signal was +already dispatched before.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    memorize + + +boolean + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + +

    Methods

    + +
    + +
    +

    add(listener, listenerContext, priority) → {Phaser.SignalBinding}

    + + +
    +
    + + +
    +

    Add a listener to the signal.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    listener + + +function + + + + + + + + + +

    Signal handler function.

    listenerContext + + +object + + + + + + <optional>
    + + + + + +

    Context on which listener will be executed (object that should represent the this variable inside listener function).

    priority + + +number + + + + + + <optional>
    + + + + + +

    The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0).

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

    An Object representing the binding between the Signal and listener.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.SignalBinding + + +
    +
    + + + + + +
    + + + +
    +

    addOnce(listener, listenerContext, priority) → {Phaser.SignalBinding}

    + + +
    +
    + + +
    +

    Add listener to the signal that should be removed after first execution (will be executed only once).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    listener + + +function + + + + + + + + + +

    Signal handler function.

    listenerContext + + +object + + + + + + <optional>
    + + + + + +

    Context on which listener will be executed (object that should represent the this variable inside listener function).

    priority + + +number + + + + + + <optional>
    + + + + + +

    The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0)

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

    An Object representing the binding between the Signal and listener.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.SignalBinding + + +
    +
    + + + + + +
    + + + +
    +

    dispatch(params)

    + + +
    +
    + + +
    +

    Dispatch/Broadcast Signal to all listeners added to the queue.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    params + + +any + + + + + + <optional>
    + + + + + +

    Parameters that should be passed to each handler.

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

    dispatch()

    + + +
    +
    + + + + + + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    dispatch + + +Description + + + +

    Description.

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

    dispose()

    + + +
    +
    + + +
    +

    Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).

    +

    <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>

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

    forget()

    + + +
    +
    + + +
    +

    Forget memorized arguments.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + +
    See:
    +
    +
      +
    • Signal.memorize
    • +
    +
    + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    getNumListeners() → {number}

    + + +
    +
    + + +
    +

    Gets the total number of listeneres attached to ths Signal.

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

    Number of listeners attached to the Signal.

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

    halt()

    + + +
    +
    + + +
    +

    Stop propagation of the event, blocking the dispatch to next listeners on the queue.

    +

    <p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + +
    See:
    +
    +
      +
    • Signal.prototype.disable
    • +
    +
    + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    has(listener, context) → {boolean}

    + + +
    +
    + + +
    +

    Check if listener was attached to Signal.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    listener + + +Function + + + + + + + + + +

    Signal handler function.

    context + + +Object + + + + + + <optional>
    + + + + + +

    Context on which listener will be executed (object that should represent the this variable inside listener function).

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

    If Signal has the specified listener.

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

    remove(listener, context) → {function}

    + + +
    +
    + + +
    +

    Remove a single listener from the dispatch queue.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    listener + + +function + + + + + + + + + +

    Handler function that should be removed.

    context + + +object + + + + + + <optional>
    + + + + + +

    Execution context (since you can add the same handler multiple times if executing in a different context).

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

    Listener handler function.

    +
    + + + +
    +
    + Type +
    +
    + +function + + +
    +
    + + + + + +
    + + + +
    +

    removeAll()

    + + +
    +
    + + +
    +

    Remove all listeners from the Signal.

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

    toString() → {string}

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

    String representation of the object.

    +
    + + + +
    +
    + Type +
    +
    + +string + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.Stage.html b/Docs/out/Phaser.Stage.html new file mode 100644 index 00000000..06c46fa8 --- /dev/null +++ b/Docs/out/Phaser.Stage.html @@ -0,0 +1,1254 @@ + + + + + + Phaser Class: Stage + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Stage

    +
    + +
    +

    + Stage +

    + +

    Phaser.Stage

    + +
    + +
    +
    + + + + +
    +

    new Stage(game, width, height)

    + + +
    +
    + + +
    +

    The Stage controls the canvas on which everything is displayed. It handles display within the browser, +focus handling, game resizing, scaling and the pause, boot and orientation screens.

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

    Game reference to the currently running game.

    width + + +number + + + +

    Width of the canvas element.

    height + + +number + + + +

    Height of the canvas element.

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

    Members

    + +
    + +
    +

    aspectRatio

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

    Aspect ratio.

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

    backgroundColor

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    paused + + +number +| + +string + + + +

    Gets and sets the background color of the stage. The color can be given as a number: 0xff0000 or a hex string: '#ff0000'

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

    canvas

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    canvas + + +HTMLCanvasElement + + + +

    Reference to the newly created <canvas> element.

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

    game

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

    A reference to the currently running Game.

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

    offset

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

    Get the offset values (for input and other things).

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

    scale

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    scale + + +Phaser.StageScaleMode + + + +

    The scale of the current running game.

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

    scaleMode

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    scaleMode + + +number + + + +

    The current scaleMode.

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

    Methods

    + +
    + +
    +

    visibilityChange(event)

    + + +
    +
    + + +
    +

    This method is called when the document visibility is changed.

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

    Its type will be used to decide whether the game should be paused or not.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.State.html b/Docs/out/Phaser.State.html new file mode 100644 index 00000000..2abdd191 --- /dev/null +++ b/Docs/out/Phaser.State.html @@ -0,0 +1,2345 @@ + + + + + + Phaser Class: State + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: State

    +
    + +
    +

    + State +

    + +

    Phaser.State

    + +
    + +
    +
    + + + + +
    +

    new State()

    + + +
    +
    + + +
    +

    This is a base State class which can be extended if you are creating your own game. +It provides quick access to common functions such as the camera, cache, input, match, sound and more.

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

    Members

    + +
    + +
    +

    add

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    add + + +Phaser.GameObjectFactory + + + +

    Reference to the GameObjectFactory.

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

    cache

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    cache + + +Phaser.Cache + + + +

    Reference to the assets cache.

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

    camera

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    camera + + +Phaser.Physics.PhysicsManager + + + +

    A handy reference to world.camera.

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

    game

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

    A reference to the currently running Game.

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

    input

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    input + + +Phaser.Input + + + +

    Reference to the input manager

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

    load

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    load + + +Phaser.Loader + + + +

    Reference to the assets loader.

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

    math

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    math + + +Phaser.GameMath + + + +

    Reference to the math helper.

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

    particles

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    add + + +Description + + + +

    Description.

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

    physics

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    physics + + +Phaser.Physics.PhysicsManager + + + +

    Reference to the physics manager.

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

    sound

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    sound + + +Phaser.SoundManager + + + +

    Reference to the sound manager.

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

    stage

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    stage + + +Phaser.Stage + + + +

    Reference to the stage.

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

    time

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    time + + +Phaser.TimeManager + + + +

    Reference to game clock.

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

    tweens

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    tweens + + +Phaser.TweenManager + + + +

    Reference to the tween manager.

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

    world

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

    Reference to the world.

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

    Methods

    + +
    + +
    +

    create()

    + + +
    +
    + + +
    +

    This method is called after the game engine successfully switches states. +Feel free to add any setup code here (do not load anything here, override preload() instead).

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

    destroy()

    + + +
    +
    + + +
    +

    This method will be called when the state is destroyed.

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

    loadRender()

    + + +
    +
    + + +
    +

    Put render operations here.

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

    loadUpdate()

    + + +
    +
    + + +
    +

    Put update logic here.

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

    paused()

    + + +
    +
    + + +
    +

    This method will be called when game paused.

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

    preload()

    + + +
    +
    + + +
    +

    Override this method to add some load operations. +If you need to use the loader, you may need to use them here.

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

    render()

    + + +
    +
    + + +
    +

    Put render operations here.

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

    update()

    + + +
    +
    + + +
    +

    Put update logic here.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.StateManager.html b/Docs/out/Phaser.StateManager.html new file mode 100644 index 00000000..e88858ea --- /dev/null +++ b/Docs/out/Phaser.StateManager.html @@ -0,0 +1,3202 @@ + + + + + + Phaser Class: StateManager + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: StateManager

    +
    + +
    +

    + StateManager +

    + +

    Phaser.StateManager

    + +
    + +
    +
    + + + + +
    +

    new StateManager(game, pendingState)

    + + +
    +
    + + +
    +

    The State Manager is responsible for loading, setting up and switching game states.

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

    A reference to the currently running game.

    pendingState + + +Phaser.State +| + +Object + + + + + + <optional>
    + + + + + +
    + + null + +

    A State object to seed the manager with.

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

    Members

    + +
    + +
    +

    current

    + + +
    +
    + +
    +

    The current active State object (defaults to null).

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    current + + +string + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    game

    + + +
    +
    + +
    +

    A reference to the currently running game.

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

    game

    + + +
    +
    + +
    +

    A reference to the currently running game.

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

    onCreateCallback

    + + +
    +
    + +
    +

    This will be called when create states (setup states...).

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onCreateCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onInitCallback

    + + +
    +
    + +
    +

    This will be called when the state is started (i.e. set as the current active state).

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onInitCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onLoadRenderCallback

    + + +
    +
    + +
    +

    This will be called when the State is rendered but only during the load process.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onLoadRenderCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onLoadUpdateCallback

    + + +
    +
    + +
    +

    This will be called when the State is updated but only during the load process.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onLoadUpdateCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onPausedCallback

    + + +
    +
    + +
    +

    This will be called when states paused.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onPausedCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onPreloadCallback

    + + +
    +
    + +
    +

    This will be called when init states (loading assets...).

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onPreloadCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onPreRenderCallback

    + + +
    +
    + +
    +

    This will be called before the State is rendered and before the stage is cleared.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onPreRenderCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onRenderCallback

    + + +
    +
    + +
    +

    This will be called when the State is rendered, this doesn't happen during load (see onLoadRenderCallback).

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onRenderCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onShutDownCallback

    + + +
    +
    + +
    +

    This will be called when the state is shut down (i.e. swapped to another state).

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onShutDownCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    onUpdateCallback

    + + +
    +
    + +
    +

    This will be called when State is updated, this doesn't happen during load (@see onLoadUpdateCallback).

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onUpdateCallback + + +function + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    states

    + + +
    +
    + +
    +

    Description.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    states. + + +Description + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    states

    + + +
    +
    + +
    +

    The state to be switched to in the next frame.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    states + + +Description + + + +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + +

    Methods

    + +
    + +
    +

    add(key, state, autoStart)

    + + +
    +
    + + +
    +

    Add a new State.

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

    A unique key you use to reference this state, i.e. "MainMenu", "Level1".

    state + + +State + + + +

    The state you want to switch to.

    autoStart + + +boolean + + + +

    Start the state immediately after creating it? (default true)

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

    checkState(key) → {boolean}

    + + +
    +
    + + +
    +

    Description.

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

    The key of the state you want to check.

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

    Description.

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

    destroy()

    + + +
    +
    + + +
    +

    Nuke the entire game from orbit

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

    Links game properties to the State given by the key.

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

    State key.

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

    <protected> loadComplete()

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

    <protected> preRender()

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

    remove(key)

    + + +
    +
    + + +
    +

    Delete the given state.

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

    A unique key you use to reference this state, i.e. "MainMenu", "Level1".

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

    <protected> render()

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

    <protected> setCurrentState(key)

    + + +
    +
    + + +
    +

    Sets the current State. Should not be called directly (use StateManager.start)

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

    State key.

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

    start(key, clearWorld, clearCache)

    + + +
    +
    + + +
    +

    Start the given state

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

    The key of the state you want to start.

    clearWorld + + +boolean + + + + + + <optional>
    + + + + + +

    clear everything in the world? (Default to true)

    clearCache + + +boolean + + + + + + <optional>
    + + + + + +

    clear asset cache? (Default to false and ONLY available when clearWorld=true)

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

    <protected> update()

    + + +
    +
    + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.World.html b/Docs/out/Phaser.World.html new file mode 100644 index 00000000..a118f818 --- /dev/null +++ b/Docs/out/Phaser.World.html @@ -0,0 +1,1915 @@ + + + + + + Phaser Class: World + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: World

    +
    + +
    +

    + World +

    + +

    Phaser.World

    + +
    + +
    +
    + + + + +
    +

    new World(game)

    + + +
    +
    + + +
    +

    "This world is but a canvas to our imagination." - Henry David Thoreau

    +

    <p> +A game has only one world. The world is an abstract place in which all game objects live. It is not bound +by stage limits and can be any size. You look into the world via cameras. All game objects live within +the world at world-based coordinates. By default a world is created the same size as your Stage.

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

    Reference to the current game instance.

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

    Members

    + +
    + +
    +

    bounds

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

    Bound of this world that objects can not escape from.

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

    camera

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    camera + + +Phaser.Camera + + + +

    Camera instance.

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

    <readonly> centerX

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    centerX + + +number + + + +

    Gets the X position corresponding to the center point of the world.

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

    <readonly> centerY

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    centerY + + +number + + + +

    Gets the Y position corresponding to the center point of the world.

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

    currentRenderOrderID

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    currentRenderOrderID + + +number + + + +

    Reset each frame, keeps a count of the total number of objects updated.

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

    game

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

    A reference to the currently running Game.

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

    group

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

    Object container stores every object created with create* methods.

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

    height

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

    Gets or sets the current height of the game world.

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

    <readonly> randomX

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    randomX + + +number + + + +

    Gets a random integer which is lesser than or equal to the current width of the game world.

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

    <readonly> randomY

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    randomY + + +number + + + +

    Gets a random integer which is lesser than or equal to the current height of the game world.

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

    width

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

    Gets or sets the current width of the game world.

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

    Methods

    + +
    + +
    +

    <protected> boot()

    + + +
    +
    + + +
    +

    Initialises the game world.

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

    destroy()

    + + +
    +
    + + +
    +

    Destroyer of worlds.

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

    postUpdate()

    + + +
    +
    + + +
    +

    This is called automatically every frame, and is where main logic happens.

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

    setSize(width, height)

    + + +
    +
    + + +
    +

    Updates the size of this world.

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

    New width of the world.

    height + + +number + + + +

    New height of the world.

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

    update()

    + + +
    +
    + + +
    +

    This is called automatically every frame, and is where main logic happens.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/Phaser.js.html b/Docs/out/Phaser.js.html index dc6f169a..8bd8fd9a 100644 --- a/Docs/out/Phaser.js.html +++ b/Docs/out/Phaser.js.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -157,7 +209,7 @@ PIXI.InteractionManager = function (dummy) { Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:37 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/Plugin.js.html b/Docs/out/Plugin.js.html new file mode 100644 index 00000000..bc355e1f --- /dev/null +++ b/Docs/out/Plugin.js.html @@ -0,0 +1,326 @@ + + + + + + Phaser Source: core/Plugin.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/Plugin.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}
    +*/
    +
    +/** 
    +* This is a base Plugin template to use for any Phaser plugin development.
    +* 
    +* @class Phaser.Plugin
    +* @classdesc Phaser - Plugin
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +* @param {Any} parent - The object that owns this plugin, usually Phaser.PluginManager.
    +*/
    +Phaser.Plugin = function (game, parent) {
    +
    +    if (typeof parent === 'undefined') { parent = null; }
    +
    +	/**
    +	* @property {Phaser.Game} game - A reference to the currently running game.
    +	*/
    +    this.game = game;
    +    
    +    /**
    +	* @property {Any} parent - The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null.
    +	*/
    +    this.parent = parent;
    +    
    +    /**
    +	* @property {boolean} active - A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped.
    +	* @default
    +	*/
    +    this.active = false;
    +    
    +    /**
    +	* @property {boolean} visible - A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped.
    +	* @default
    +	*/
    +    this.visible = false;
    +    
    +    /**
    +	* @property {boolean} hasPreUpdate - A flag to indicate if this plugin has a preUpdate method.
    +	* @default
    +	*/
    +    this.hasPreUpdate = false;
    +    
    +    /**
    +	* @property {boolean} hasUpdate - A flag to indicate if this plugin has an update method.
    +	* @default
    +	*/
    +    this.hasUpdate = false;
    +    
    +    /**
    +	* @property {boolean} hasRender - A flag to indicate if this plugin has a render method.
    +	* @default
    +	*/
    +    this.hasRender = false;
    +    
    +    /**
    +	* @property {boolean} hasPostRender - A flag to indicate if this plugin has a postRender method.
    +	* @default
    +	*/
    +    this.hasPostRender = false;
    +
    +};
    +
    +Phaser.Plugin.prototype = {
    +
    +    /**
    +    * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics).
    +    * It is only called if active is set to true.
    +    * @method Phaser.Plugin#preUpdate
    +    */
    +    preUpdate: function () {
    +    },
    +
    +    /**
    +    * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render.
    +    * It is only called if active is set to true.
    +    * @method Phaser.Plugin#update
    +    */
    +    update: function () {
    +    },
    +
    +    /**
    +    * Render is called right after the Game Renderer completes, but before the State.render.
    +    * It is only called if visible is set to true.
    +    * @method Phaser.Plugin#render
    +    */
    +    render: function () {
    +    },
    +
    +    /**
    +    * Post-render is called after the Game Renderer and State.render have run.
    +    * It is only called if visible is set to true.
    +    * @method Phaser.Plugin#postRender
    +    */
    +    postRender: function () {
    +    },
    +
    +    /**
    +    * Clear down this Plugin and null out references
    +    * @method Phaser.Plugin#destroy
    +    */
    +    destroy: function () {
    +
    +        this.game = null;
    +        this.parent = null;
    +        this.active = false;
    +        this.visible = false;
    +        
    +    }
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/PluginManager-Phaser.PluginManager.html b/Docs/out/PluginManager-Phaser.PluginManager.html new file mode 100644 index 00000000..caa45d03 --- /dev/null +++ b/Docs/out/PluginManager-Phaser.PluginManager.html @@ -0,0 +1,595 @@ + + + + + + Phaser Class: PluginManager + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: PluginManager

    +
    + +
    +

    + PluginManager +

    + +

    PPhaser - PluginManager

    + +
    + +
    +
    + + + + +
    +

    new PluginManager(game, parent)

    + + +
    +
    + + +
    +

    Description.

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

    A reference to the currently running game.

    parent + + +Description + + + +

    Description.

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

    Members

    + +
    + +
    +

    game

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

    A reference to the currently running game.

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

    plugins

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    plugins + + +array + + + +

    Description.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/PluginManager.html b/Docs/out/PluginManager.html new file mode 100644 index 00000000..abcbd9b9 --- /dev/null +++ b/Docs/out/PluginManager.html @@ -0,0 +1,296 @@ + + + + + + Phaser Module: PluginManager + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Module: PluginManager

    +
    + +
    +

    + PluginManager +

    + +
    + +
    +
    + + + + + + +
    + + + + + + + + + + + +
    Author:
    +
    + +
    + + + + + + + + +
    License:
    +
    + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/PluginManager.js.html b/Docs/out/PluginManager.js.html new file mode 100644 index 00000000..45f1cc08 --- /dev/null +++ b/Docs/out/PluginManager.js.html @@ -0,0 +1,444 @@ + + + + + + Phaser Source: core/PluginManager.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/PluginManager.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}
    +* @module       Phaser.PluginManager
    +*/
    +
    +/** 
    +* Description.
    +* 
    +* @class Phaser.PluginManager
    +* @classdesc PPhaser - PluginManager
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +* @param {Description} parent - Description.
    +*/
    +Phaser.PluginManager = function(game, parent) {
    +
    +	/**
    +	* @property {Phaser.Game} game - A reference to the currently running game.
    +	*/
    +    this.game = game;
    +    
    +    /**
    +	* @property {Description} _parent - Description.
    +	* @private
    +	*/
    +    this._parent = parent;
    +    
    +    /**
    +	* @property {array} plugins - Description.
    +	*/
    +    this.plugins = [];
    +    
    +    /**
    +	* @property {array} _pluginsLength - Description.
    +	* @private
    +	* @default
    +	*/
    +    this._pluginsLength = 0;
    +
    +};
    +
    +Phaser.PluginManager.prototype = {
    +
    +    /**
    +    * Add a new Plugin to the PluginManager.
    +    * The plugin's game and parent reference are set to this game and pluginmanager parent.
    +    * @method Phaser.PluginManager#add
    +    * @param {Phaser.Plugin} plugin - Description.
    +    * @return {Phaser.Plugin} Description.
    +    */
    +    add: function (plugin) {
    +
    +        var result = false;
    +
    +        //  Prototype?
    +        if (typeof plugin === 'function')
    +        {
    +            plugin = new plugin(this.game, this._parent);
    +        }
    +        else
    +        {
    +            plugin.game = this.game;
    +            plugin.parent = this._parent;
    +        }
    +
    +        //  Check for methods now to avoid having to do this every loop
    +        if (typeof plugin['preUpdate'] === 'function')
    +        {
    +            plugin.hasPreUpdate = true;
    +            result = true;
    +        }
    +
    +        if (typeof plugin['update'] === 'function')
    +        {
    +            plugin.hasUpdate = true;
    +            result = true;
    +        }
    +
    +        if (typeof plugin['render'] === 'function')
    +        {
    +            plugin.hasRender = true;
    +            result = true;
    +        }
    +
    +        if (typeof plugin['postRender'] === 'function')
    +        {
    +            plugin.hasPostRender = true;
    +            result = true;
    +        }
    +
    +        //  The plugin must have at least one of the above functions to be added to the PluginManager.
    +        if (result)
    +        {
    +            if (plugin.hasPreUpdate || plugin.hasUpdate)
    +            {
    +                plugin.active = true;
    +            }
    +
    +            if (plugin.hasRender || plugin.hasPostRender)
    +            {
    +                plugin.visible = true;
    +            }
    +
    +            this._pluginsLength = this.plugins.push(plugin);
    +            return plugin;
    +        }
    +        else
    +        {
    +            return null;
    +        }
    +    },
    +
    +    /**
    +     * Remove a Plugin from the PluginManager.
    +     * @method Phaser.PluginManager#remove
    +     * @param {Phaser.Plugin} plugin - The plugin to be removed.
    +     */
    +    remove: function (plugin) {
    +
    +        //  TODO
    +        this._pluginsLength--;
    +
    +    },
    +
    +    /**
    +    * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics).
    +    * It only calls plugins who have active=true.
    +    * 
    +    * @method Phaser.PluginManager#preUpdate
    +    */
    +    preUpdate: function () {
    +
    +        if (this._pluginsLength == 0)
    +        {
    +            return;
    +        }
    +
    +        for (this._p = 0; this._p < this._pluginsLength; this._p++)
    +        {
    +            if (this.plugins[this._p].active && this.plugins[this._p].hasPreUpdate)
    +            {
    +                this.plugins[this._p].preUpdate();
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render.
    +    * It only calls plugins who have active=true.
    +    * 
    +    * @method Phaser.PluginManager#update
    +    */
    +    update: function () {
    +        
    +        if (this._pluginsLength == 0)
    +        {
    +            return;
    +        }
    +
    +        for (this._p = 0; this._p < this._pluginsLength; this._p++)
    +        {
    +            if (this.plugins[this._p].active && this.plugins[this._p].hasUpdate)
    +            {
    +                this.plugins[this._p].update();
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * Render is called right after the Game Renderer completes, but before the State.render.
    +    * It only calls plugins who have visible=true.
    +    * 
    +    * @method Phaser.PluginManager#render
    +    */
    +    render: function () {
    +
    +        if (this._pluginsLength == 0)
    +        {
    +            return;
    +        }
    +
    +        for (this._p = 0; this._p < this._pluginsLength; this._p++)
    +        {
    +            if (this.plugins[this._p].visible && this.plugins[this._p].hasRender)
    +            {
    +                this.plugins[this._p].render();
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * Post-render is called after the Game Renderer and State.render have run.
    +    * It only calls plugins who have visible=true.
    +    * 
    +    * @method Phaser.PluginManager#postRender
    +    */
    +    postRender: function () {
    +
    +        if (this._pluginsLength == 0)
    +        {
    +            return;
    +        }
    +
    +        for (this._p = 0; this._p < this._pluginsLength; this._p++)
    +        {
    +            if (this.plugins[this._p].visible && this.plugins[this._p].hasPostRender)
    +            {
    +                this.plugins[this._p].postRender();
    +            }
    +        }
    +
    +    },
    +
    +    /**
    +    * Clear down this PluginManager and null out references
    +    * 
    +    * @method Phaser.PluginManager#destroy
    +    */
    +    destroy: function () {
    +
    +        this.plugins.length = 0;
    +        this._pluginsLength = 0;
    +        this.game = null;
    +        this._parent = null;
    +
    +    }
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Point.js.html b/Docs/out/Point.js.html new file mode 100644 index 00000000..bf05e2d7 --- /dev/null +++ b/Docs/out/Point.js.html @@ -0,0 +1,606 @@ + + + + + + Phaser Source: geom/Point.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: geom/Point.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 Point. If you pass no parameters a Point is created set to (0,0).
    +* @class Phaser.Point
    +* @classdesc The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
    +* @constructor
    +* @param {number} x The horizontal position of this Point (default 0)
    +* @param {number} y The vertical position of this Point (default 0)
    +**/
    +Phaser.Point = function (x, y) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +
    +    /**
    +     * @property {number} x - The x coordinate of the point.
    +     **/
    +    this.x = x;
    +    
    +    /**
    +     * @property {number} y - The y coordinate of the point.
    +     **/
    +    this.y = y;
    +
    +};
    +
    +Phaser.Point.prototype = {
    +
    +    /**
    +    * Copies the x and y properties from any given object to this Point.
    +    * @method Phaser.Point#copyFrom
    +    * @param {any} source - The object to copy from.
    +    * @return {Point} This Point object.
    +    **/
    +    copyFrom: function (source) {
    +        return this.setTo(source.x, source.y);
    +    },
    +
    +    /**
    +    * Inverts the x and y values of this Point
    +    * @method Phaser.Point#invert
    +    * @return {Point} This Point object.
    +    **/
    +    invert: function () {
    +        return this.setTo(this.y, this.x);
    +    },
    +
    +    /**
    +    * Sets the x and y values of this Point object to the given coordinates.
    +    * @method Phaser.Point#setTo
    +    * @param {number} x - The horizontal position of this point.
    +    * @param {number} y - The vertical position of this point.
    +    * @return {Point} This Point object. Useful for chaining method calls.
    +    **/        
    +    setTo: function (x, y) {
    +        this.x = x;
    +        this.y = y;
    +        return this;
    +    },
    +
    +    /**
    +    * Adds the given x and y values to this Point.
    +    * @method Phaser.Point#add
    +    * @param {number} x - The value to add to Point.x.
    +    * @param {number} y - The value to add to Point.y.
    +    * @return {Phaser.Point} This Point object. Useful for chaining method calls.
    +    **/        
    +    add: function (x, y) {
    +
    +        this.x += x;
    +        this.y += y;
    +        return this;
    +
    +    },
    +
    +    /**
    +    * Subtracts the given x and y values from this Point.
    +    * @method Phaser.Point#subtract
    +    * @param {number} x - The value to subtract from Point.x.
    +    * @param {number} y - The value to subtract from Point.y.
    +    * @return {Phaser.Point} This Point object. Useful for chaining method calls.
    +    **/        
    +    subtract: function (x, y) {
    +
    +        this.x -= x;
    +        this.y -= y;
    +        return this;
    +
    +    },
    +
    +    /**
    +    * Multiplies Point.x and Point.y by the given x and y values.
    +    * @method Phaser.Point#multiply
    +    * @param {number} x - The value to multiply Point.x by.
    +    * @param {number} y - The value to multiply Point.x by.
    +    * @return {Phaser.Point} This Point object. Useful for chaining method calls.
    +    **/        
    +    multiply: function (x, y) {
    +
    +        this.x *= x;
    +        this.y *= y;
    +        return this;
    +
    +    },
    +
    +    /**
    +    * Divides Point.x and Point.y by the given x and y values.
    +    * @method Phaser.Point#divide
    +    * @param {number} x - The value to divide Point.x by.
    +    * @param {number} y - The value to divide Point.x by.
    +    * @return {Phaser.Point} This Point object. Useful for chaining method calls.
    +    **/        
    +    divide: function (x, y) {
    +
    +        this.x /= x;
    +        this.y /= y;
    +        return this;
    +
    +    },
    +
    +    /**
    +    * Clamps the x value of this Point to be between the given min and max.
    +    * @method Phaser.Point#clampX
    +    * @param {number} min - The minimum value to clamp this Point to.
    +    * @param {number} max - The maximum value to clamp this Point to.
    +    * @return {Phaser.Point} This Point object.
    +    */
    +    clampX: function (min, max) {
    +
    +        this.x = Phaser.Math.clamp(this.x, min, max);
    +        return this;
    +        
    +    },
    +
    +    /**
    +    * Clamps the y value of this Point to be between the given min and max
    +    * @method Phaser.Point#clampY
    +    * @param {number} min - The minimum value to clamp this Point to.
    +    * @param {number} max - The maximum value to clamp this Point to.
    +    * @return {Phaser.Point} This Point object.
    +    */
    +    clampY: function (min, max) {
    +
    +        this.y = Phaser.Math.clamp(this.y, min, max);
    +        return this;
    +        
    +    },
    +
    +    /**
    +    * Clamps this Point object values to be between the given min and max.
    +    * @method Phaser.Point#clamp
    +    * @param {number} min - The minimum value to clamp this Point to.
    +    * @param {number} max - The maximum value to clamp this Point to.
    +    * @return {Phaser.Point} This Point object.
    +    */
    +    clamp: function (min, max) {
    +
    +        this.x = Phaser.Math.clamp(this.x, min, max);
    +        this.y = Phaser.Math.clamp(this.y, min, max);
    +        return this;
    +
    +    },
    +
    +    /**
    +    * Creates a copy of the given Point.
    +    * @method Phaser.Point#clone
    +    * @param {Phaser.Point} [output] Optional Point object. If given the values will be set into this object, otherwise a brand new Point object will be created and returned.
    +    * @return {Phaser.Point} The new Point object.
    +    */
    +    clone: function (output) {
    +
    +        if (typeof output === "undefined") { output = new Phaser.Point; }
    +
    +        return output.setTo(this.x, this.y);
    +
    +    },
    +
    +    /**
    +    * Copies the x and y properties from any given object to this Point.
    +    * @method Phaser.Point#copyFrom
    +    * @param {any} source - The object to copy from.
    +    * @return {Point} This Point object.
    +    **/
    +    copyFrom: function (source) {
    +        return this.setTo(source.x, source.y);
    +    },
    +
    +    /**
    +    * Copies the x and y properties from this Point to any given object.
    +    * @method Phaser.Point#copyTo
    +    * @param {any} dest - The object to copy to.
    +    * @return {Object} The dest object.
    +    **/
    +    copyTo: function(dest) {
    +
    +        dest[x] = this.x;
    +        dest[y] = this.y;
    +
    +        return dest;
    +
    +    },
    +
    +    /**
    +    * Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x/y properties)
    +    * @method Phaser.Point#distance
    +    * @param {object} dest - The target object. Must have visible x and y properties that represent the center of the object.
    +    * @param {boolean} [round] - Round the distance to the nearest integer (default false).
    +    * @return {number} The distance between this Point object and the destination Point object.
    +    */
    +    distance: function (dest, round) {
    +
    +        return Phaser.Point.distance(this, dest, round);
    +        
    +    },
    +
    +    /**
    +    * Determines whether the given objects x/y values are equal to this Point object.
    +    * @method Phaser.Point#equals
    +    * @param {Phaser.Point} a - The first object to compare.
    +    * @return {boolean} A value of true if the Points are equal, otherwise false.
    +    */
    +    equals: function (a) {
    +        return (a.x == this.x && a.y == this.y);
    +    },
    +
    +    /**
    +    * Rotates this Point around the x/y coordinates given to the desired angle.
    +    * @method Phaser.Point#rotate
    +    * @param {number} x - The x coordinate of the anchor point
    +    * @param {number} y - The y coordinate of the anchor point
    +    * @param {number} angle - The angle in radians (unless asDegrees is true) to rotate the Point to.
    +    * @param {boolean} asDegrees - Is the given rotation in radians (false) or degrees (true)?
    +    * @param {number} [distance] - An optional distance constraint between the Point and the anchor.
    +    * @return {Phaser.Point} The modified point object.
    +    */
    +    rotate: function (x, y, angle, asDegrees, distance) {
    +        return Phaser.Point.rotate(this, x, y, angle, asDegrees, distance);
    +    },
    +
    +    /**
    +    * Returns a string representation of this object.
    +    * @method Phaser.Point#toString
    +    * @return {string} A string representation of the instance.
    +    **/
    +    toString: function () {
    +        return '[{Point (x=' + this.x + ' y=' + this.y + ')}]';
    +    }
    +
    +};
    +
    +/**
    +* Adds the coordinates of two points together to create a new point.
    +* @method Phaser.Point.add
    +* @param {Phaser.Point} a - The first Point object.
    +* @param {Phaser.Point} b - The second Point object.
    +* @param {Phaser.Point} [out] - Optional Point to store the value in, if not supplied a new Point object will be created.
    +* @return {Phaser.Point} The new Point object.
    +*/
    +Phaser.Point.add = function (a, b, out) {
    +
    +    if (typeof out === "undefined") { out = new Phaser.Point(); }
    +
    +    out.x = a.x + b.x;
    +    out.y = a.y + b.y;
    +
    +    return out;
    +
    +};
    +
    +/**
    +* Subtracts the coordinates of two points to create a new point.
    +* @method Phaser.Point.subtract
    +* @param {Phaser.Point} a - The first Point object.
    +* @param {Phaser.Point} b - The second Point object.
    +* @param {Phaser.Point} [out] - Optional Point to store the value in, if not supplied a new Point object will be created.
    +* @return {Phaser.Point} The new Point object.
    +*/
    +Phaser.Point.subtract = function (a, b, out) {
    +
    +    if (typeof out === "undefined") { out = new Phaser.Point(); }
    +
    +    out.x = a.x - b.x;
    +    out.y = a.y - b.y;
    +
    +    return out;
    +
    +};
    +
    +/**
    +* Multiplies the coordinates of two points to create a new point.
    +* @method Phaser.Point.multiply
    +* @param {Phaser.Point} a - The first Point object.
    +* @param {Phaser.Point} b - The second Point object.
    +* @param {Phaser.Point} [out] - Optional Point to store the value in, if not supplied a new Point object will be created.
    +* @return {Phaser.Point} The new Point object.
    +*/
    +Phaser.Point.multiply = function (a, b, out) {
    +
    +    if (typeof out === "undefined") { out = new Phaser.Point(); }
    +
    +    out.x = a.x * b.x;
    +    out.y = a.y * b.y;
    +
    +    return out;
    +
    +};
    +
    +/**
    +* Divides the coordinates of two points to create a new point.
    +* @method Phaser.Point.divide
    +* @param {Phaser.Point} a - The first Point object.
    +* @param {Phaser.Point} b - The second Point object.
    +* @param {Phaser.Point} [out] - Optional Point to store the value in, if not supplied a new Point object will be created.
    +* @return {Phaser.Point} The new Point object.
    +*/
    +Phaser.Point.divide = function (a, b, out) {
    +
    +    if (typeof out === "undefined") { out = new Phaser.Point(); }
    +
    +    out.x = a.x / b.x;
    +    out.y = a.y / b.y;
    +
    +    return out;
    +
    +};
    +
    +/**
    +* Determines whether the two given Point objects are equal. They are considered equal if they have the same x and y values.
    +* @method Phaser.Point.equals
    +* @param {Phaser.Point} a - The first Point object.
    +* @param {Phaser.Point} b - The second Point object.
    +* @return {boolean} A value of true if the Points are equal, otherwise false.
    +*/
    +Phaser.Point.equals = function (a, b) {
    +    return (a.x == b.x && a.y == b.y);
    +};
    +
    +/**
    +* Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x/y properties).
    +* @method Phaser.Point.distance
    +* @param {object} a - The target object. Must have visible x and y properties that represent the center of the object.
    +* @param {object} b - The target object. Must have visible x and y properties that represent the center of the object.
    +* @param {boolean} [round] - Round the distance to the nearest integer (default false).
    +* @return {number} The distance between this Point object and the destination Point object.
    +*/
    +Phaser.Point.distance = function (a, b, round) {
    +
    +    if (typeof round === "undefined") { round = false }
    +
    +    if (round)
    +    {
    +        return Phaser.Math.distanceRound(a.x, a.y, b.x, b.y);
    +    }
    +    else
    +    {
    +        return Phaser.Math.distance(a.x, a.y, b.x, b.y);
    +    }
    +
    +},
    +
    +/**
    +* Rotates a Point around the x/y coordinates given to the desired angle.
    +* @method Phaser.Point.rotate
    +* @param {Phaser.Point} a - The Point object to rotate.
    +* @param {number} x - The x coordinate of the anchor point
    +* @param {number} y - The y coordinate of the anchor point
    +* @param {number} angle - The angle in radians (unless asDegrees is true) to rotate the Point to.
    +* @param {boolean} asDegrees - Is the given rotation in radians (false) or degrees (true)?
    +* @param {number} distance - An optional distance constraint between the Point and the anchor.
    +* @return {Phaser.Point} The modified point object.
    +*/
    +Phaser.Point.rotate = function (a, x, y, angle, asDegrees, distance) {
    +
    +    asDegrees = asDegrees || false;
    +    distance = distance || null;
    +
    +    if (asDegrees)
    +    {
    +        angle = Phaser.Math.radToDeg(angle);
    +    }
    +
    +    //  Get distance from origin (cx/cy) to this point
    +    if (distance === null)
    +    {
    +        distance = Math.sqrt(((x - a.x) * (x - a.x)) + ((y - a.y) * (y - a.y)));
    +    }
    +
    +    return a.setTo(x + distance * Math.cos(angle), y + distance * Math.sin(angle));
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Rectangle.js.html b/Docs/out/Rectangle.js.html new file mode 100644 index 00000000..8ac3b2be --- /dev/null +++ b/Docs/out/Rectangle.js.html @@ -0,0 +1,875 @@ + + + + + + Phaser Source: geom/Rectangle.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: geom/Rectangle.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 Rectangle object with the top-left corner specified by the x and y parameters and with the specified width and height parameters. If you call this function without parameters, a Rectangle with x, y, width, and height properties set to 0 is created.
    +*
    +* @class Phaser.Rectangle
    +* @constructor
    +* @param {number} x - The x coordinate of the top-left corner of the Rectangle.
    +* @param {number} y - The y coordinate of the top-left corner of the Rectangle.
    +* @param {number} width - The width of the Rectangle in pixels.
    +* @param {number} height - The height of the Rectangle in pixels.
    +* @return {Rectangle} This Rectangle object.
    +**/
    +Phaser.Rectangle = function (x, y, width, height) {
    +
    +    x = x || 0;
    +    y = y || 0;
    +    width = width || 0;
    +    height = height || 0;
    +
    +    /**
    +    * @property {number} x - Description.
    +    */
    +    this.x = x;
    +    
    +    /**
    +    * @property {number} y - Description.
    +    */
    +    this.y = y;
    +    
    +    /**
    +    * @property {number} width - Description.
    +    */
    +    this.width = width;
    +    
    +    /**
    +    * @property {number} height - Description.
    +    */
    +    this.height = height;
    +
    +};
    +
    +Phaser.Rectangle.prototype = {
    +
    +    /**
    +    * Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts.
    +    * @method Phaser.Rectangle#offset
    +    * @param {number} dx - Moves the x value of the Rectangle object by this amount.
    +    * @param {number} dy - Moves the y value of the Rectangle object by this amount.
    +    * @return {Rectangle} This Rectangle object.
    +    **/
    +    offset: function (dx, dy) {
    +
    +        this.x += dx;
    +        this.y += dy;
    +
    +        return this;
    +
    +    },
    + 
    +    /**
    +    * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter.
    +    * @method Phaser.Rectangle#offsetPoint
    +    * @param {Point} point - A Point object to use to offset this Rectangle object.
    +    * @return {Rectangle} This Rectangle object.
    +    **/
    +    offsetPoint: function (point) {
    +        return this.offset(point.x, point.y);
    +    },
    + 
    +    /**
    +    * Sets the members of Rectangle to the specified values.
    +    * @method Phaser.Rectangle#setTo
    +    * @param {number} x - The x coordinate of the top-left corner of the Rectangle.
    +    * @param {number} y - The y coordinate of the top-left corner of the Rectangle.
    +    * @param {number} width - The width of the Rectangle in pixels.
    +    * @param {number} height - The height of the Rectangle in pixels.
    +    * @return {Rectangle} This Rectangle object
    +    **/
    +    setTo: function (x, y, width, height) {
    +
    +        this.x = x;
    +        this.y = y;
    +        this.width = width;
    +        this.height = height;
    +
    +        return this;
    +
    +    },
    + 
    +    /**
    +    * Runs Math.floor() on both the x and y values of this Rectangle.
    +    * @method Phaser.Rectangle#floor
    +    **/
    +    floor: function () {
    +
    +        this.x = Math.floor(this.x);
    +        this.y = Math.floor(this.y);
    +
    +    },
    + 
    +    /**
    +    * Copies the x, y, width and height properties from any given object to this Rectangle.
    +    * @method Phaser.Rectangle#copyFrom
    +    * @param {any} source - The object to copy from.
    +    * @return {Rectangle} This Rectangle object.
    +    **/
    +    copyFrom: function (source) {
    +        return this.setTo(source.x, source.y, source.width, source.height);
    +    },
    +
    +    /**
    +    * Copies the x, y, width and height properties from this Rectangle to any given object.
    +    * @method Phaser.Rectangle#copyTo
    +    * @param {any} source - The object to copy to.
    +    * @return {object} This object.
    +    **/
    +    copyTo: function (dest) {
    +
    +        dest.x = this.x;
    +        dest.y = this.y;
    +        dest.width = this.width;
    +        dest.height = this.height;
    +
    +        return dest;
    +
    +    },
    +
    +    /**
    +    * Increases the size of the Rectangle object by the specified amounts. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.
    +    * @method Phaser.Rectangle#inflate
    +    * @param {number} dx - The amount to be added to the left side of the Rectangle.
    +    * @param {number} dy - The amount to be added to the bottom side of the Rectangle.
    +    * @return {Phaser.Rectangle} This Rectangle object.
    +    */
    +    inflate: function (dx, dy) {
    +        return Phaser.Rectangle.inflate(this, dx, dy);
    +    },
    +
    +    /**
    +    * The size of the Rectangle object, expressed as a Point object with the values of the width and height properties.
    +    * @method Phaser.Rectangle#size
    +    * @param {Phaser.Point} [output] - Optional Point object. If given the values will be set into the object, otherwise a brand new Point object will be created and returned.
    +    * @return {Phaser.Point} The size of the Rectangle object.
    +    */
    +    size: function (output) {
    +        return Phaser.Rectangle.size(this, output);
    +    },
    +
    +    /**
    +    * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.
    +    * @method Phaser.Rectangle#clone
    +    * @param {Phaser.Rectangle} [output] - Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned.
    +    * @return {Phaser.Rectangle} 
    +    */
    +    clone: function (output) {
    +        return Phaser.Rectangle.clone(this, output);
    +    },
    +
    +    /**
    +    * Determines whether the specified coordinates are contained within the region defined by this Rectangle object.
    +    * @method Phaser.Rectangle#contains
    +    * @param {number} x - The x coordinate of the point to test.
    +    * @param {number} y - The y coordinate of the point to test.
    +    * @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false.
    +    */
    +    contains: function (x, y) {
    +        return Phaser.Rectangle.contains(this, x, y);
    +    },
    +
    +    /**
    +    * Determines whether the first Rectangle object is fully contained within the second Rectangle object.
    +    * A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first.
    +    * @method Phaser.Rectangle#containsRect
    +    * @param {Phaser.Rectangle} b - The second Rectangle object.
    +    * @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false.
    +    */
    +    containsRect: function (b) {
    +        return Phaser.Rectangle.containsRect(this, b);
    +    },
    +
    +    /**
    +    * Determines whether the two Rectangles are equal.
    +    * This method compares the x, y, width and height properties of each Rectangle.
    +    * @method Phaser.Rectangle#equals
    +    * @param {Phaser.Rectangle} b - The second Rectangle object.
    +    * @return {boolean} A value of true if the two Rectangles have exactly the same values for the x, y, width and height properties; otherwise false.
    +    */
    +    equals: function (b) {
    +        return Phaser.Rectangle.equals(this, b);
    +    },
    +
    +    /**
    +    * If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the Rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0.
    +    * @method Phaser.Rectangle#intersection
    +    * @param {Phaser.Rectangle} b - The second Rectangle object.
    +    * @param {Phaser.Rectangle} out - Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned.
    +    * @return {Phaser.Rectangle} A Rectangle object that equals the area of intersection. If the Rectangles do not intersect, this method returns an empty Rectangle object; that is, a Rectangle with its x, y, width, and height properties set to 0.
    +    */
    +    intersection: function (b, out) {
    +        return Phaser.Rectangle.intersection(this, b, output);
    +    },
    +
    +    /**
    +    * Determines whether the two Rectangles intersect with each other.
    +    * This method checks the x, y, width, and height properties of the Rectangles.
    +    * @method Phaser.Rectangle#intersects
    +    * @param {Phaser.Rectangle} b - The second Rectangle object.
    +    * @param {number} tolerance - A tolerance value to allow for an intersection test with padding, default to 0.
    +    * @return {boolean} A value of true if the specified object intersects with this Rectangle object; otherwise false.
    +    */
    +    intersects: function (b, tolerance) {
    +        return Phaser.Rectangle.intersects(this, b, tolerance);
    +    },
    +
    +    /**
    +    * Determines whether the object specified intersects (overlaps) with the given values.
    +    * @method Phaser.Rectangle#intersectsRaw
    +    * @param {number} left - Description.
    +    * @param {number} right - Description.
    +    * @param {number} top - Description.
    +    * @param {number} bottomt - Description.
    +    * @param {number} tolerance - A tolerance value to allow for an intersection test with padding, default to 0
    +    * @return {boolean} A value of true if the specified object intersects with the Rectangle; otherwise false.
    +    */
    +    intersectsRaw: function (left, right, top, bottom, tolerance) {
    +        return Phaser.Rectangle.intersectsRaw(this, left, right, top, bottom, tolerance);
    +    },
    +
    +    /**
    +    * Adds two Rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two Rectangles.
    +    * @method Phaser.Rectangle#union
    +    * @param {Phaser.Rectangle} b - The second Rectangle object.
    +    * @param {Phaser.Rectangle} [out] - Optional Rectangle object. If given the new values will be set into this object, otherwise a brand new Rectangle object will be created and returned.
    +    * @return {Phaser.Rectangle} A Rectangle object that is the union of the two Rectangles.
    +    */
    +    union: function (b, out) {
    +        return Phaser.Rectangle.union(this, b, out);
    +    },
    +
    +    /**
    +    * Returns a string representation of this object.
    +    * @method Phaser.Rectangle#toString
    +    * @return {string} A string representation of the instance.
    +    **/
    +    toString: function () {
    +        return "[{Rectangle (x=" + this.x + " y=" + this.y + " width=" + this.width + " height=" + this.height + " empty=" + this.empty + ")}]";
    +    }
    +
    +};
    +
    +/**
    +* @name Phaser.Rectangle#halfWidth
    +* @property {number} halfWidth - Half of the width of the Rectangle.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "halfWidth", {
    +
    +    get: function () {
    +        return Math.round(this.width / 2);
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.Rectangle#halfHeight
    +* @property {number} halfHeight - Half of the height of the Rectangle.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "halfHeight", {
    +
    +    get: function () {
    +        return Math.round(this.height / 2);
    +    }
    +
    +});
    +
    +/**
    +* 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.
    +* @name Phaser.Rectangle#bottom
    +* @property {number} bottom - The sum of the y and height properties.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "bottom", {
    +    
    +    get: function () {
    +        return this.y + this.height;
    +    },
    +  
    +    set: function (value) {
    +        if (value <= this.y) {
    +            this.height = 0;
    +        } else {
    +            this.height = (this.y - value);
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The location of the Rectangles bottom right corner as a Point object.
    +* @name Phaser.Rectangle#bottom
    +* @property {Phaser.Point} bottomRight - Gets or sets the location of the Rectangles bottom right corner as a Point object.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", {
    +    
    +    get: function () {
    +        return new Phaser.Point(this.right, this.bottom);
    +    },
    +
    +    set: function (value) {
    +        this.right = value.x;
    +        this.bottom = value.y;
    +    }
    +
    +});
    +
    +/**
    +* The x coordinate of the left of the Rectangle. Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property.
    +* @name Phaser.Rectangle#left
    +* @property {number} left - The x coordinate of the left of the Rectangle.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "left", {
    +   
    +    get: function () {
    +        return this.x;
    +    },
    +
    +    set: function (value) {
    +        if (value >= this.right) {
    +            this.width = 0;
    +        } else {
    +            this.width = this.right - value;
    +        }
    +        this.x = value;
    +    }
    +
    +});
    +
    +/**
    +* 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.
    +* @name Phaser.Rectangle#right
    +* @property {number} right - The sum of the x and width properties.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "right", {
    +       
    +    get: function () {
    +        return this.x + this.width;
    +    },
    +
    +    set: function (value) {
    +        if (value <= this.x) {
    +            this.width = 0;
    +        } else {
    +            this.width = this.x + value;
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The volume of the Rectangle derived from width * height.
    +* @name Phaser.Rectangle#volume
    +* @property {number} volume - The volume of the Rectangle derived from width * height.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "volume", {
    +    
    +    get: function () {
    +        return this.width * this.height;
    +    }
    +
    +});
    +
    +/**
    +* The perimeter size of the Rectangle. This is the sum of all 4 sides.
    +* @name Phaser.Rectangle#perimeter
    +* @property {number} perimeter - The perimeter size of the Rectangle. This is the sum of all 4 sides.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", {
    +    
    +    get: function () {
    +        return (this.width * 2) + (this.height * 2);
    +    }
    +
    +});
    +
    +/**
    +* The x coordinate of the center of the Rectangle.
    +* @name Phaser.Rectangle#centerX
    +* @property {number} centerX - The x coordinate of the center of the Rectangle.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "centerX", {
    +    
    +    get: function () {
    +        return this.x + this.halfWidth;
    +    },
    +
    +    set: function (value) {
    +        this.x = value - this.halfWidth;
    +    }
    +
    +});
    +
    +/**
    +* The y coordinate of the center of the Rectangle.
    +* @name Phaser.Rectangle#centerY
    +* @property {number} centerY - The y coordinate of the center of the Rectangle.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "centerY", {
    +    
    +    get: function () {
    +        return this.y + this.halfHeight;
    +    },
    +
    +    set: function (value) {
    +        this.y = value - this.halfHeight;
    +    }
    +
    +});
    +
    +/**
    +* The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties.
    +* However it does affect the height property, whereas changing the y value does not affect the height property.
    +* @name Phaser.Rectangle#top
    +* @property {number} top - The y coordinate of the top of the Rectangle.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "top", {
    +    
    +    get: function () {
    +        return this.y;
    +    },
    +
    +    set: function (value) {
    +        if (value >= this.bottom) {
    +            this.height = 0;
    +            this.y = value;
    +        } else {
    +            this.height = (this.bottom - value);
    +        }
    +    }
    +
    +});
    +
    +/**
    +* The location of the Rectangles top left corner as a Point object.
    +* @name Phaser.Rectangle#topLeft
    +* @property {Phaser.Point} topLeft - The location of the Rectangles top left corner as a Point object.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", {
    +
    +    get: function () {
    +        return new Phaser.Point(this.x, this.y);
    +    },
    +    
    +    set: function (value) {
    +        this.x = value.x;
    +        this.y = value.y;
    +    }
    +
    +});
    +
    +/**
    +* Determines whether or not this Rectangle object is empty. A Rectangle object is empty if its width or height is less than or equal to 0.
    +* If set to true then all of the Rectangle properties are set to 0. 
    +* @name Phaser.Rectangle#empty
    +* @property {boolean} empty - Gets or sets the Rectangles empty state.
    +*/
    +Object.defineProperty(Phaser.Rectangle.prototype, "empty", {
    +    
    +    get: function () {
    +        return (!this.width || !this.height);
    +    },
    +
    +    set: function (value) {
    +        this.setTo(0, 0, 0, 0);
    +    }
    +
    +});
    +
    +/**
    +* Increases the size of the Rectangle object by the specified amounts. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.
    +* @method Phaser.Rectangle.inflate
    +* @param {Phaser.Rectangle} a - The Rectangle object.
    +* @param {number} dx - The amount to be added to the left side of the Rectangle.
    +* @param {number} dy - The amount to be added to the bottom side of the Rectangle.
    +* @return {Phaser.Rectangle} This Rectangle object.
    +*/
    +Phaser.Rectangle.inflate = function (a, dx, dy) {
    +    a.x -= dx;
    +    a.width += 2 * dx;
    +    a.y -= dy;
    +    a.height += 2 * dy;
    +    return a;
    +};
    +
    +/**
    +* Increases the size of the Rectangle object. This method is similar to the Rectangle.inflate() method except it takes a Point object as a parameter.
    +* @method Phaser.Rectangle.inflatePoint
    +* @param {Phaser.Rectangle} a - The Rectangle object.
    +* @param {Phaser.Point} point - The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object.
    +* @return {Phaser.Rectangle} The Rectangle object.
    +*/
    +Phaser.Rectangle.inflatePoint = function (a, point) {
    +    return Phaser.Phaser.Rectangle.inflate(a, point.x, point.y);
    +};
    +
    +/**
    +* The size of the Rectangle object, expressed as a Point object with the values of the width and height properties.
    +* @method Phaser.Rectangle.size
    +* @param {Phaser.Rectangle} a - The Rectangle object.
    +* @param {Phaser.Point} [output] - Optional Point object. If given the values will be set into the object, otherwise a brand new Point object will be created and returned.
    +* @return {Phaser.Point} The size of the Rectangle object
    +*/
    +Phaser.Rectangle.size = function (a, output) {
    +    if (typeof output === "undefined") { output = new Phaser.Point(); }
    +    return output.setTo(a.width, a.height);
    +};
    +
    +/**
    +* Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.
    +* @method Phaser.Rectangle.clone
    +* @param {Phaser.Rectangle} a - The Rectangle object.
    +* @param {Phaser.Rectangle} [output] - Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned.
    +* @return {Phaser.Rectangle}
    +*/
    +Phaser.Rectangle.clone = function (a, output) {
    +    if (typeof output === "undefined") { output = new Phaser.Rectangle(); }
    +    return output.setTo(a.x, a.y, a.width, a.height);
    +};
    +
    +/**
    +* Determines whether the specified coordinates are contained within the region defined by this Rectangle object.
    +* @method Phaser.Rectangle.contains
    +* @param {Phaser.Rectangle} a - The Rectangle object.
    +* @param {number} x - The x coordinate of the point to test.
    +* @param {number} y - The y coordinate of the point to test.
    +* @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false.
    +*/
    +Phaser.Rectangle.contains = function (a, x, y) {
    +    return (x >= a.x && x <= a.right && y >= a.y && y <= a.bottom);
    +};
    +
    +/**
    +* 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
    +* @param {Phaser.Rectangle} a - The Rectangle object.
    +* @param {Phaser.Point} point - The point object being checked. Can be Point or any object with .x and .y values.
    +* @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);
    +};
    +
    +/**
    +* Determines whether the first Rectangle object is fully contained within the second Rectangle object.
    +* A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first.
    +* @method Phaser.Rectangle.containsRect
    +* @param {Phaser.Rectangle} a - The first Rectangle object.
    +* @param {Phaser.Rectangle} b - The second Rectangle object.
    +* @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false.
    +*/
    +Phaser.Rectangle.containsRect = function (a, b) {
    +
    +    //  If the given rect has a larger volume than this one then it can never contain it
    +    if (a.volume > b.volume)
    +    {
    +        return false;
    +    }
    +
    +    return (a.x >= b.x && a.y >= b.y && a.right <= b.right && a.bottom <= b.bottom);
    +
    +};
    +
    +/**
    +* Determines whether the two Rectangles are equal.
    +* This method compares the x, y, width and height properties of each Rectangle.
    +* @method Phaser.Rectangle.equals
    +* @param {Phaser.Rectangle} a - The first Rectangle object.
    +* @param {Phaser.Rectangle} b - The second Rectangle object.
    +* @return {boolean} A value of true if the two Rectangles have exactly the same values for the x, y, width and height properties; otherwise false.
    +*/
    +Phaser.Rectangle.equals = function (a, b) {
    +    return (a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height);
    +};
    +
    +/**
    +* If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the Rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0.
    +* @method Phaser.Rectangle.intersection
    +* @param {Phaser.Rectangle} a - The first Rectangle object.
    +* @param {Phaser.Rectangle} b - The second Rectangle object.
    +* @param {Phaser.Rectangle} [out] - Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned.
    +* @return {Phaser.Rectangle} A Rectangle object that equals the area of intersection. If the Rectangles do not intersect, this method returns an empty Rectangle object; that is, a Rectangle with its x, y, width, and height properties set to 0.
    +*/
    +Phaser.Rectangle.intersection = function (a, b, out) {
    +
    +    out  = out || new Phaser.Rectangle;
    +
    +    if (Phaser.Rectangle.intersects(a, b))
    +    {
    +        out.x = Math.max(a.x, b.x);
    +        out.y = Math.max(a.y, b.y);
    +        out.width = Math.min(a.right, b.right) - out.x;
    +        out.height = Math.min(a.bottom, b.bottom) - out.y;
    +    }
    +
    +    return out;
    +
    +};
    +
    +/**
    +* Determines whether the two Rectangles intersect with each other.
    +* This method checks the x, y, width, and height properties of the Rectangles.
    +* @method Phaser.Rectangle.intersects
    +* @param {Phaser.Rectangle} a - The first Rectangle object.
    +* @param {Phaser.Rectangle} b - The second Rectangle object.
    +* @param {number} tolerance - A tolerance value to allow for an intersection test with padding, default to 0
    +* @return {boolean} A value of true if the specified object intersects with this Rectangle object; otherwise false.
    +*/
    +Phaser.Rectangle.intersects = function (a, b, tolerance) {
    +
    +    tolerance = tolerance || 0;
    +
    +    return !(a.x > b.right + tolerance || a.right < b.x - tolerance || a.y > b.bottom + tolerance || a.bottom < b.y - tolerance);
    +
    +};
    +
    +/**
    +* Determines whether the object specified intersects (overlaps) with the given values.
    +* @method Phaser.Rectangle.intersectsRaw
    +* @param {number} left - Description.
    +* @param {number} right - Description.
    +* @param {number} top - Description.
    +* @param {number} bottom - Description.
    +* @param {number} tolerance - A tolerance value to allow for an intersection test with padding, default to 0
    +* @return {boolean} A value of true if the specified object intersects with the Rectangle; otherwise false.
    +*/
    +Phaser.Rectangle.intersectsRaw = function (a, left, right, top, bottom, tolerance) {
    +
    +    if (typeof tolerance === "undefined") { tolerance = 0; }
    +
    +    return !(left > a.right + tolerance || right < a.left - tolerance || top > a.bottom + tolerance || bottom < a.top - tolerance);
    +
    +};
    +
    +/**
    +* Adds two Rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two Rectangles.
    +* @method Phaser.Rectangle.union
    +* @param {Phaser.Rectangle} a - The first Rectangle object.
    +* @param {Phaser.Rectangle} b - The second Rectangle object.
    +* @param {Phaser.Rectangle} [out] - Optional Rectangle object. If given the new values will be set into this object, otherwise a brand new Rectangle object will be created and returned.
    +* @return {Phaser.Rectangle} A Rectangle object that is the union of the two Rectangles.
    +*/
    +Phaser.Rectangle.union = function (a, b, out) {
    +
    +    if (typeof out === "undefined") { out = new Phaser.Rectangle(); }
    +
    +    return out.setTo(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.max(a.right, b.right), Math.max(a.bottom, b.bottom));
    +    
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Signal.js.html b/Docs/out/Signal.js.html new file mode 100644 index 00000000..f10c19d0 --- /dev/null +++ b/Docs/out/Signal.js.html @@ -0,0 +1,508 @@ + + + + + + Phaser Source: core/Signal.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/Signal.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.Signal
    +* @classdesc A Signal is used for object communication via a custom broadcaster instead of Events.
    +* @author Miller Medeiros http://millermedeiros.github.com/js-signals/
    +* @constructor
    +*/
    +Phaser.Signal = function () {
    +
    +	/**
    +	* @property {Array.<Phaser.SignalBinding>} _bindings - Description.
    +	* @private
    +	*/
    +	this._bindings = [];
    +	
    +	/**
    +	* @property {Description} _prevParams - Description.
    +	* @private
    +	*/
    +	this._prevParams = null;
    +
    +	// enforce dispatch to aways work on same context (#47)
    +	var self = this;
    +
    +	/**
    +	* @property {Description} dispatch - Description.
    +	*/
    +	this.dispatch = function(){
    +		Phaser.Signal.prototype.dispatch.apply(self, arguments);
    +	};
    +
    +};
    +
    +Phaser.Signal.prototype = {
    +
    +	/**
    +    * If Signal should keep record of previously dispatched parameters and
    +	* automatically execute listener during `add()`/`addOnce()` if Signal was
    +	* already dispatched before.
    +	* @property {boolean} memorize
    +	*/
    +	memorize: false,
    +
    +	/**
    +	* @property {boolean} _shouldPropagate 
    +	* @private
    +	*/
    +	_shouldPropagate: true,
    +
    +	/**
    +	* If Signal is active and should broadcast events.
    +	* <p><strong>IMPORTANT:</strong> Setting this property during a dispatch will only affect the next dispatch, if you want to stop the propagation of a signal use `halt()` instead.</p>
    +	* @property {boolean} active
    +    * @default
    +    */
    +	active: true,
    +
    +	/**
    +	* @method Phaser.Signal#validateListener
    +	* @param {function} listener - Signal handler function.
    +	* @param {Description} fnName - Description.
    +	* @private
    +    */
    +	validateListener: function (listener, fnName) {
    +		if (typeof listener !== 'function') {
    +			throw new Error( 'listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName) );
    +		}
    +	},
    +
    +	/**
    +	 * @method Phaser.Signal#_registerListener
    +	 * @param {function} listener - Signal handler function.
    +	 * @param {boolean} isOnce - Description.
    +	 * @param {object} [listenerContext] - Description.
    +	 * @param {number} [priority] - The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0).
    +	 * @return {Phaser.SignalBinding} An Object representing the binding between the Signal and listener.
    +	 * @private
    +	 */
    +	_registerListener: function (listener, isOnce, listenerContext, priority) {
    +
    +		var prevIndex = this._indexOfListener(listener, listenerContext),
    +			binding;
    +
    +		if (prevIndex !== -1) {
    +			binding = this._bindings[prevIndex];
    +			if (binding.isOnce() !== isOnce) {
    +				throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.');
    +			}
    +		} else {
    +			binding = new Phaser.SignalBinding(this, listener, isOnce, listenerContext, priority);
    +			this._addBinding(binding);
    +		}
    +
    +		if (this.memorize && this._prevParams){
    +			binding.execute(this._prevParams);
    +		}
    +
    +		return binding;
    +	},
    +
    +	/**
    +	 * @method Phaser.Signal#_addBinding 
    +	 * @param {Phaser.SignalBinding} binding - An Object representing the binding between the Signal and listener.
    +	 * @private
    +	 */
    +	_addBinding: function (binding) {
    +		//simplified insertion sort
    +		var n = this._bindings.length;
    +		do { --n; } while (this._bindings[n] && binding._priority <= this._bindings[n]._priority);
    +		this._bindings.splice(n + 1, 0, binding);
    +	},
    +
    +	/**
    +	 * @method Phaser.Signal#_indexOfListener
    +	 * @param {function} listener - Signal handler function.
    +	 * @return {number} Description.
    +	 * @private
    +	 */
    +	_indexOfListener: function (listener, context) {
    +		var n = this._bindings.length,
    +			cur;
    +		while (n--) {
    +			cur = this._bindings[n];
    +			if (cur._listener === listener && cur.context === context) {
    +				return n;
    +			}
    +		}
    +		return -1;
    +	},
    +
    +	/**
    +	 * Check if listener was attached to Signal.
    +	 * 
    +	 * @method Phaser.Signal#has
    +	 * @param {Function} listener - Signal handler function.
    +	 * @param {Object} [context] - Context on which listener will be executed (object that should represent the `this` variable inside listener function).
    +	 * @return {boolean} If Signal has the specified listener.
    +	 */
    +	has: function (listener, context) {
    +		return this._indexOfListener(listener, context) !== -1;
    +	},
    +
    +	/**
    +	 * Add a listener to the signal.
    +	 * 
    +	 * @method Phaser.Signal#add
    +	 * @param {function} listener - Signal handler function.
    +	 * @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
    +	 * @param {number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0).
    +	 * @return {Phaser.SignalBinding} An Object representing the binding between the Signal and listener.
    +	 */
    +	add: function (listener, listenerContext, priority) {
    +		this.validateListener(listener, 'add');
    +		return this._registerListener(listener, false, listenerContext, priority);
    +	},
    +
    +	/**
    +	* Add listener to the signal that should be removed after first execution (will be executed only once).
    +	*
    +	* @method Phaser.Signal#addOnce
    +	* @param {function} listener Signal handler function.
    +	* @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function).
    +	* @param {number} [priority] The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0)
    +	* @return {Phaser.SignalBinding} An Object representing the binding between the Signal and listener.
    +	*/
    +	addOnce: function (listener, listenerContext, priority) {
    +		this.validateListener(listener, 'addOnce');
    +		return this._registerListener(listener, true, listenerContext, priority);
    +	},
    +
    +	/**
    +	* Remove a single listener from the dispatch queue.
    +	*
    +	* @method Phaser.Signal#remove
    +	* @param {function} listener Handler function that should be removed.
    +	* @param {object} [context] Execution context (since you can add the same handler multiple times if executing in a different context).
    +	* @return {function} Listener handler function.
    +	*/
    +	remove: function (listener, context) {
    +
    +		this.validateListener(listener, 'remove');
    +
    +		var i = this._indexOfListener(listener, context);
    +
    +		if (i !== -1)
    +		{
    +			this._bindings[i]._destroy(); //no reason to a Phaser.SignalBinding exist if it isn't attached to a signal
    +			this._bindings.splice(i, 1);
    +		}
    +
    +		return listener;
    +
    +	},
    +
    +	/**
    +	* Remove all listeners from the Signal.
    +	*
    +	* @method Phaser.Signal#removeAll
    +	*/
    +	removeAll: function () {
    +		var n = this._bindings.length;
    +		while (n--) {
    +			this._bindings[n]._destroy();
    +		}
    +		this._bindings.length = 0;
    +	},
    +
    +	/**
    +	* Gets the total number of listeneres attached to ths Signal.
    +	*
    +	* @method Phaser.Signal#getNumListeners
    +	* @return {number} Number of listeners attached to the Signal.
    +	*/
    +	getNumListeners: function () {
    +		return this._bindings.length;
    +	},
    +
    +	/**
    +	* Stop propagation of the event, blocking the dispatch to next listeners on the queue.
    +	* <p><strong>IMPORTANT:</strong> should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.</p>
    +	* @see Signal.prototype.disable
    +	*
    +	* @method Phaser.Signal#halt
    +	*/
    +	halt: function () {
    +		this._shouldPropagate = false;
    +	},
    +
    +	/**
    +	* Dispatch/Broadcast Signal to all listeners added to the queue.
    +	*
    +	* @method Phaser.Signal#dispatch
    +	* @param {any} [params] - Parameters that should be passed to each handler.
    +	*/
    +	dispatch: function (params) {
    +		if (! this.active) {
    +			return;
    +		}
    +
    +		var paramsArr = Array.prototype.slice.call(arguments),
    +			n = this._bindings.length,
    +			bindings;
    +
    +		if (this.memorize) {
    +			this._prevParams = paramsArr;
    +		}
    +
    +		if (! n) {
    +			//should come after memorize
    +			return;
    +		}
    +
    +		bindings = this._bindings.slice(); //clone array in case add/remove items during dispatch
    +		this._shouldPropagate = true; //in case `halt` was called before dispatch or during the previous dispatch.
    +
    +		//execute all callbacks until end of the list or until a callback returns `false` or stops propagation
    +		//reverse loop since listeners with higher priority will be added at the end of the list
    +		do { n--; } while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false);
    +	},
    +
    +	/**
    +	* Forget memorized arguments.
    +	* @see Signal.memorize
    +	*
    +	* @method Phaser.Signal#forget
    + 	*/
    +	forget: function(){
    +		this._prevParams = null;
    +	},
    +
    +	/**
    +	* Remove all bindings from signal and destroy any reference to external objects (destroy Signal object).
    +	* <p><strong>IMPORTANT:</strong> calling any method on the signal instance after calling dispose will throw errors.</p>
    +	*
    +	* @method Phaser.Signal#dispose
    +	*/
    +	dispose: function () {
    +		this.removeAll();
    +		delete this._bindings;
    +		delete this._prevParams;
    +	},
    +
    +	/**
    +	*
    +	* @method Phaser.Signal#toString
    +	* @return {string} String representation of the object.
    +	*/
    +	toString: function () {
    +		return '[Phaser.Signal active:'+ this.active +' numListeners:'+ this.getNumListeners() +']';
    +	}
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/SignalBinding.html b/Docs/out/SignalBinding.html new file mode 100644 index 00000000..3fe72dd4 --- /dev/null +++ b/Docs/out/SignalBinding.html @@ -0,0 +1,512 @@ + + + + + + Phaser Class: SignalBinding + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: SignalBinding

    +
    + +
    +

    + SignalBinding +

    + +

    Phaser.SignalBinding

    + +
    + +
    +
    + + + + +
    +

    new SignalBinding(signal, listener, isOnce, listenerContext, priority)

    + + +
    +
    + + +
    +

    Phaser.SignalBinding

    +

    Object that represents a binding between a Signal and a listener function. +<br />- <strong>This is an internal constructor and shouldn't be called by regular users.</strong> +<br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    signal + + +Signal + + + + + + + + + +

    Reference to Signal object that listener is currently bound to.

    listener + + +function + + + + + + + + + +

    Handler function bound to the signal.

    isOnce + + +boolean + + + + + + + + + +

    If binding should be executed just once.

    listenerContext + + +object + + + + + + <optional>
    + + + + + +

    Context on which listener will be executed (object that should represent the this variable inside listener function).

    priority + + +number + + + + + + <optional>
    + + + + + +

    The priority level of the event listener. (default = 0).

    + + + + +
    + + + + + + + + + + + +
    Author:
    +
    +
      +
    • Miller Medeiros http://millermedeiros.github.com/js-signals/
    • +
    +
    + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Docs/out/SignalBinding.js.html b/Docs/out/SignalBinding.js.html new file mode 100644 index 00000000..080ffba4 --- /dev/null +++ b/Docs/out/SignalBinding.js.html @@ -0,0 +1,373 @@ + + + + + + Phaser Source: core/SignalBinding.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/SignalBinding.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}
    +*/
    +
    +/**
    +* Phaser.SignalBinding
    +*
    +* Object that represents a binding between a Signal and a listener function.
    +* <br />- <strong>This is an internal constructor and shouldn't be called by regular users.</strong>
    +* <br />- inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
    +*
    +* @class Phaser.SignalBinding
    +* @name SignalBinding
    +* @author Miller Medeiros http://millermedeiros.github.com/js-signals/
    +* @constructor
    +* @inner
    +* @param {Signal} signal - Reference to Signal object that listener is currently bound to.
    +* @param {function} listener - Handler function bound to the signal.
    +* @param {boolean} isOnce - If binding should be executed just once.
    +* @param {object} [listenerContext] - Context on which listener will be executed (object that should represent the `this` variable inside listener function).
    +* @param {number} [priority] - The priority level of the event listener. (default = 0).
    +*/
    +Phaser.SignalBinding = function (signal, listener, isOnce, listenerContext, priority) {
    +
    +    /**
    +	* @property {Phaser.Game} _listener - Handler function bound to the signal.
    +	* @private
    +	*/
    +    this._listener = listener;
    +
    +    /**
    +	* @property {boolean} _isOnce - If binding should be executed just once.
    +	* @private
    +	*/
    +    this._isOnce = isOnce;
    +
    +    /**
    +	* @property {object|undefined|null} context - Context on which listener will be executed (object that should represent the `this` variable inside listener function).
    +	* @memberof SignalBinding.prototype
    +	*/
    +    this.context = listenerContext;
    +
    +    /**
    +	* @property {Signal} _signal - Reference to Signal object that listener is currently bound to.
    +	* @private
    +	*/
    +    this._signal = signal;
    +
    +    /**
    +	* @property {number} _priority - Listener priority.
    +	* @private
    +	*/
    +    this._priority = priority || 0;
    +
    +};
    +
    +Phaser.SignalBinding.prototype = {
    +
    +    /**
    +    * If binding is active and should be executed.
    +    * @property {boolean} active
    +    * @default
    +    */ 
    +    active: true,
    +
    +    /**
    +    * Default parameters passed to listener during `Signal.dispatch` and `SignalBinding.execute` (curried parameters).
    +    * @property {array|null} params 
    +    * @default 
    +    */
    +    params: null,
    +
    +    /**
    +    * Call listener passing arbitrary parameters.
    +    * <p>If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.</p>
    +    * @method Phaser.SignalBinding#execute
    +    * @param {array} [paramsArr] - Array of parameters that should be passed to the listener.
    +    * @return {Description} Value returned by the listener.
    +    */
    +    execute: function (paramsArr) {
    +
    +        var handlerReturn, params;
    +
    +        if (this.active && !!this._listener)
    +        {
    +            params = this.params? this.params.concat(paramsArr) : paramsArr;
    +            handlerReturn = this._listener.apply(this.context, params);
    +
    +            if (this._isOnce)
    +            {
    +                this.detach();
    +            }
    +        }
    +
    +        return handlerReturn;
    +
    +    },
    +
    +    /**
    +    * Detach binding from signal.
    +    * <p>alias to: @see mySignal.remove(myBinding.getListener());
    +    * @method Phaser.SignalBinding#detach
    +    * @return {function|null} Handler function bound to the signal or `null` if binding was previously detached.
    +    */
    +    detach: function () {
    +        return this.isBound() ? this._signal.remove(this._listener, this.context) : null;
    +    },
    +
    +    /**
    +    * @method Phaser.SignalBinding#isBound
    +    * @return {boolean} True if binding is still bound to the signal and has a listener.
    +    */
    +    isBound: function () {
    +        return (!!this._signal && !!this._listener);
    +    },
    +
    +    /**
    +    * @method Phaser.SignalBinding#isOnce
    +    * @return {boolean} If SignalBinding will only be executed once.
    +    */
    +    isOnce: function () {
    +        return this._isOnce;
    +    },
    +
    +    /**
    +    * @method Phaser.SignalBinding#getListener
    +    * @return {Function} Handler function bound to the signal.
    +    */
    +    getListener: function () {
    +        return this._listener;
    +    },
    +
    +    /**
    +    * @method Phaser.SignalBinding#getSignal
    +    * @return {Signal} Signal that listener is currently bound to.
    +    */
    +    getSignal: function () {
    +        return this._signal;
    +    },
    +
    +    /**
    +    * @method Phaser.SignalBinding#_destroy
    +    * Delete instance properties
    +    * @private
    +    */
    +    _destroy: function () {
    +        delete this._signal;
    +        delete this._listener;
    +        delete this.context;
    +    },
    +
    +    /**
    +    * @method Phaser.SignalBinding#toString
    +    * @return {string} String representation of the object.
    +    */
    +    toString: function () {
    +        return '[Phaser.SignalBinding isOnce:' + this._isOnce +', isBound:'+ this.isBound() +', active:' + this.active + ']';
    +    }
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/Stage.js.html b/Docs/out/Stage.js.html new file mode 100644 index 00000000..b7f5a656 --- /dev/null +++ b/Docs/out/Stage.js.html @@ -0,0 +1,357 @@ + + + + + + Phaser Source: core/Stage.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/Stage.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 Stage controls the canvas on which everything is displayed. It handles display within the browser,
    +* focus handling, game resizing, scaling and the pause, boot and orientation screens.
    +*
    +* @class Phaser.Stage
    +* @constructor
    +* @param {Phaser.Game} game - Game reference to the currently running game.
    +* @param {number} width - Width of the canvas element.
    +* @param {number} height - Height of the canvas element.
    + */
    +Phaser.Stage = function (game, width, height) {
    +
    +    /**
    +	* @property {Phaser.Game} game - A reference to the currently running Game.
    +	*/
    +	this.game = game;
    +
    +    /**
    +	* @property {string} game - Background color of the stage (defaults to black). Set via the public backgroundColor property.
    +	* @private
    +	* @default 'rgb(0,0,0)'
    +	*/
    +    this._backgroundColor = 'rgb(0,0,0)';
    +
    +    /**
    +	* @property {Phaser.Point} offset - Get the offset values (for input and other things).
    +	*/
    +	this.offset = new Phaser.Point;
    +    
    +    /**
    +    * @property {HTMLCanvasElement} canvas - Reference to the newly created <canvas> element.
    +    */
    +    this.canvas = Phaser.Canvas.create(width, height); 
    +    this.canvas.style['-webkit-full-screen'] = 'width: 100%; height: 100%';
    +    
    +    /**
    +    * @property {PIXI.Stage} _stage - The Pixi Stage which is hooked to the renderer.
    +    * @private
    +    */
    +    this._stage = new PIXI.Stage(0x000000, false);
    +    this._stage.name = '_stage_root';
    +
    +    /**
    +    * @property {number} scaleMode - The current scaleMode.
    +    */    
    +    this.scaleMode = Phaser.StageScaleMode.NO_SCALE;
    +
    +    /**
    +    * @property {Phaser.StageScaleMode} scale - The scale of the current running game.
    +    */
    +    this.scale = new Phaser.StageScaleMode(this.game, width, height);
    +
    +    /**
    +     * @property {number} aspectRatio - Aspect ratio.
    +     */
    +    this.aspectRatio = width / height;
    +
    +};
    +
    +Phaser.Stage.prototype = {
    +
    +    /**
    +    * Initialises the stage and adds the event listeners.
    +    * @method Phaser.Stage#boot
    +    * @private
    +    */
    +    boot: function () {
    +
    +        Phaser.Canvas.getOffset(this.canvas, this.offset);
    +
    +        this.bounds = new Phaser.Rectangle(this.offset.x, this.offset.y, this.game.width, this.game.height);
    +
    +        var _this = this;
    +
    +        this._onChange = function (event) {
    +            return _this.visibilityChange(event);
    +        }
    +
    +        Phaser.Canvas.setUserSelect(this.canvas, 'none');
    +        Phaser.Canvas.setTouchAction(this.canvas, 'none');
    +
    +        document.addEventListener('visibilitychange', this._onChange, false);
    +        document.addEventListener('webkitvisibilitychange', this._onChange, false);
    +        document.addEventListener('pagehide', this._onChange, false);
    +        document.addEventListener('pageshow', this._onChange, false);
    +
    +        window.onblur = this._onChange;
    +        window.onfocus = this._onChange;
    +
    +    },
    +
    +	/**
    +    * This method is called when the document visibility is changed.
    +    * @method Phaser.Stage#visibilityChange
    +    * @param {Event} event - Its type will be used to decide whether the game should be paused or not.
    +    */
    +    visibilityChange: function (event) {
    +
    +        if (this.disableVisibilityChange)
    +        {
    +            return;
    +        }
    +
    +        if (event.type == 'pagehide' || event.type == 'blur' || document['hidden'] == true || document['webkitHidden'] == true)
    +        {
    +	        this.game.paused = true;
    +        }
    +        else
    +        {
    +	        this.game.paused = false;
    +        }
    +
    +    },
    +
    +};
    +
    +/**
    +* @name Phaser.Stage#backgroundColor
    +* @property {number|string} paused - Gets and sets the background color of the stage. The color can be given as a number: 0xff0000 or a hex string: '#ff0000'
    +*/
    +Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", {
    +
    +    get: function () {
    +        return this._backgroundColor;
    +    },
    +
    +    set: function (color) {
    +
    +        this._backgroundColor = color;
    +
    +        if (typeof color === 'string')
    +        {
    +            color = Phaser.Color.hexToRGB(color);
    +        }
    +
    +        this._stage.setBackgroundColor(color);
    +
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/State.js.html b/Docs/out/State.js.html new file mode 100644 index 00000000..0110a04b --- /dev/null +++ b/Docs/out/State.js.html @@ -0,0 +1,380 @@ + + + + + + Phaser Source: core/State.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/State.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}
    +*/
    +
    +/**
    +* This is a base State class which can be extended if you are creating your own game.
    +* It provides quick access to common functions such as the camera, cache, input, match, sound and more.
    +*
    +* @class Phaser.State
    +* @constructor
    +*/
    +
    +Phaser.State = function () {
    +
    +    /**
    +	* @property {Phaser.Game} game - A reference to the currently running Game.
    +	*/
    +    this.game = null;
    +    
    +	/**
    +	* @property {Phaser.GameObjectFactory} add - Reference to the GameObjectFactory.
    +	* @default
    +	*/
    +    this.add = null;
    +    
    +    /**
    +	* @property {Phaser.Physics.PhysicsManager} camera - A handy reference to world.camera.
    +	* @default
    +	*/
    +    this.camera = null;
    +    
    +    /**
    +	* @property {Phaser.Cache} cache - Reference to the assets cache.
    +	* @default
    +	*/
    +    this.cache = null;
    +    
    +    /**
    +	* @property {Phaser.Input} input - Reference to the input manager
    +	* @default
    +	*/
    +    this.input = null;
    +    
    +    /**
    +	* @property {Phaser.Loader} load - Reference to the assets loader.
    +	* @default
    +	*/
    +    this.load = null;
    +    
    +    /**
    +	* @property {Phaser.GameMath} math - Reference to the math helper.
    +	* @default
    +	*/
    +    this.math = null;
    +    
    +    /**
    +	* @property {Phaser.SoundManager} sound - Reference to the sound manager.
    +	* @default
    +	*/
    +    this.sound = null;
    +    
    +    /**
    +	* @property {Phaser.Stage} stage - Reference to the stage.
    +	* @default
    +	*/
    +    this.stage = null;
    +    
    +    /**
    +	* @property {Phaser.TimeManager} time - Reference to game clock.
    +	* @default
    +	*/
    +    this.time = null;
    +    
    +    /**
    +	* @property {Phaser.TweenManager} tweens - Reference to the tween manager.
    +	* @default
    +	*/
    +    this.tweens = null;
    +    
    +    /**
    +	* @property {Phaser.World} world - Reference to the world.
    +	* @default
    +	*/
    +    this.world = null;
    +    
    +	/**
    +	* @property {Description} add - Description.
    +	* @default
    +	*/
    +    this.particles = null;
    +    
    +    /**
    +	* @property {Phaser.Physics.PhysicsManager} physics - Reference to the physics manager.
    +	* @default
    +	*/
    +    this.physics = null;
    +
    +};
    +
    +Phaser.State.prototype = {
    +
    +    /**
    +    * Override this method to add some load operations.
    +    * If you need to use the loader, you may need to use them here.
    +    * 
    +    * @method Phaser.State#preload
    +    */
    +    preload: function () {
    +    },
    +
    +    /**
    +    * Put update logic here.
    +    * 
    +    * @method Phaser.State#loadUpdate
    +    */
    +    loadUpdate: function () {
    +    },
    +
    +    /**
    +    * Put render operations here.
    +    * 
    +    * @method Phaser.State#loadRender
    +    */
    +    loadRender: function () {
    +    },
    +
    +    /**
    +    * This method is called after the game engine successfully switches states.
    +    * Feel free to add any setup code here (do not load anything here, override preload() instead).
    +    * 
    +    * @method Phaser.State#create
    +    */
    +    create: function () {
    +    },
    +
    +    /**
    +    * Put update logic here.
    +    * 
    +    * @method Phaser.State#update
    +    */
    +    update: function () {
    +    },
    +
    +    /**
    +    * Put render operations here.
    +    * 
    +    * @method Phaser.State#render
    +    */
    +    render: function () {
    +    },
    +
    +    /**
    +    * This method will be called when game paused.
    +    * 
    +    * @method Phaser.State#paused
    +    */
    +    paused: function () {
    +    },
    +
    +    /**
    +    * This method will be called when the state is destroyed.
    +    * @method Phaser.State#destroy
    +    */
    +    destroy: function () {
    +    }
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/StateManager.js.html b/Docs/out/StateManager.js.html new file mode 100644 index 00000000..ccd7c747 --- /dev/null +++ b/Docs/out/StateManager.js.html @@ -0,0 +1,736 @@ + + + + + + Phaser Source: core/StateManager.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/StateManager.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 State Manager is responsible for loading, setting up and switching game states.
    +* 
    +* @class Phaser.StateManager
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +* @param {Phaser.State|Object} [pendingState=null] - A State object to seed the manager with.
    +*/
    +Phaser.StateManager = function (game, pendingState) {
    +
    +	/**
    +	* A reference to the currently running game.
    +	* @property {Phaser.Game} game.
    +	*/
    +	this.game = game;
    +
    +	/**
    +	* Description.
    +	* @property {Description} states.
    +	*/
    +	this.states = {};
    +
    +	if (pendingState !== null)
    +	{
    +		this._pendingState = pendingState;
    +	}
    +
    +};
    +
    +Phaser.StateManager.prototype = {
    +	
    +	/**
    +	* A reference to the currently running game.
    +	* @property {Phaser.Game} game.
    +	*/
    +	game: null,
    +
    +	/**
    +	* The state to be switched to in the next frame.
    +	* @property {State} _pendingState 
    +	* @private
    +	*/
    +	_pendingState: null,
    +
    +	/**
    +	* Flag that sets if the State has been created or not.
    +	* @property {boolean}_created
    +	* @private
    +	*/
    +	_created: false,
    +
    +	/**
    +	* The state to be switched to in the next frame.
    +	* @property {Description} states
    +	*/
    +	states: {},
    +
    +	/**
    +	* The current active State object (defaults to null).
    +	* @property {string} current
    +	*/
    +	current: '',
    +	
    +	/**
    +	* This will be called when the state is started (i.e. set as the current active state).
    +	* @property {function} onInitCallback
    +	*/
    +	onInitCallback: null,
    +
    +	/**
    +	* This will be called when init states (loading assets...).
    +	* @property {function} onPreloadCallback
    +	*/
    +	onPreloadCallback: null,
    +	
    +	/**
    +	* This will be called when create states (setup states...).
    +	* @property {function} onCreateCallback
    +	*/
    +	onCreateCallback: null,
    +
    +	/**
    +	* This will be called when State is updated, this doesn't happen during load (@see onLoadUpdateCallback).
    +	* @property {function} onUpdateCallback
    +	*/
    +	onUpdateCallback: null,
    +
    +	/**
    +	* This will be called when the State is rendered, this doesn't happen during load (see onLoadRenderCallback).
    +	* @property {function} onRenderCallback
    +	*/
    +	onRenderCallback: null,
    +
    +	/**
    +	* This will be called before the State is rendered and before the stage is cleared.
    +	* @property {function} onPreRenderCallback
    +	*/
    +	onPreRenderCallback: null,
    +
    +	/**
    +	* This will be called when the State is updated but only during the load process.
    +	* @property {function} onLoadUpdateCallback
    +	*/
    +	onLoadUpdateCallback: null,
    +
    +	/**
    +	* This will be called when the State is rendered but only during the load process.
    +	* @property {function} onLoadRenderCallback
    +	*/
    +	onLoadRenderCallback: null,
    +
    +	/**
    +	* This will be called when states paused.
    +	* @property {function} onPausedCallback
    +	*/
    +	onPausedCallback: null,
    +
    +	/**
    +	* This will be called when the state is shut down (i.e. swapped to another state).
    +	* @property {function} onShutDownCallback
    +	*/
    +	onShutDownCallback: null,
    +
    +	/**
    +	* Description.
    +	* @method Phaser.StateManager#boot
    +	* @private
    +	*/
    +	boot: function () {
    +
    +		// console.log('Phaser.StateManager.boot');
    +
    +		if (this._pendingState !== null)
    +		{
    +			// console.log('_pendingState found');
    +			// console.log(typeof this._pendingState);
    +
    +			if (typeof this._pendingState === 'string')
    +			{
    +				//	State was already added, so just start it
    +				this.start(this._pendingState, false, false);
    +			}
    +			else
    +			{
    +				this.add('default', this._pendingState, true);
    +			}
    +
    +		}
    +
    +	},
    +
    +	/**
    +    * Add a new State.
    +    * @method Phaser.StateManager#add
    +    * @param key {string} - A unique key you use to reference this state, i.e. "MainMenu", "Level1".
    +    * @param state {State} - The state you want to switch to.
    +    * @param autoStart {boolean} - Start the state immediately after creating it? (default true)
    +    */
    +    add: function (key, state, autoStart) {
    +
    +        if (typeof autoStart === "undefined") { autoStart = false; }
    +
    +		// console.log('Phaser.StateManager.addState', key);
    +		// console.log(typeof state);
    +		// console.log('autoStart?', autoStart);
    +
    +		var newState;
    +
    +		if (state instanceof Phaser.State)
    +		{
    +			// console.log('Phaser.StateManager.addState: Phaser.State given');
    +			newState = state;
    +		}
    +		else if (typeof state === 'object')
    +		{
    +			// console.log('Phaser.StateManager.addState: Object given');
    +			newState = state;
    +			newState.game = this.game;
    +		}
    +		else if (typeof state === 'function')
    +		{
    +			// console.log('Phaser.StateManager.addState: Function given');
    +			newState = new state(this.game);
    +		}
    +
    +		this.states[key] = newState;
    +
    +		if (autoStart)
    +		{
    +			if (this.game.isBooted)
    +			{
    +				// console.log('Game is booted, so we can start the state now');
    +				this.start(key);
    +			}
    +			else
    +			{
    +				// console.log('Game is NOT booted, so set the current state as pending');
    +				this._pendingState = key;
    +			}
    +		}
    +
    +		return newState;
    +
    +    },
    +
    +	/**
    +     * Delete the given state.
    +     * @method Phaser.StateManager#remove
    +     * @param {string} key - A unique key you use to reference this state, i.e. "MainMenu", "Level1".
    +     */
    +    remove: function (key) {
    +
    +    	if (this.current == key)
    +    	{
    +	        this.callbackContext = null;
    +
    +	        this.onInitCallback = null;
    +	        this.onShutDownCallback = null;
    +
    +	        this.onPreloadCallback = null;
    +	        this.onLoadRenderCallback = null;
    +	        this.onLoadUpdateCallback = null;
    +	        this.onCreateCallback = null;
    +	        this.onUpdateCallback = null;
    +	        this.onRenderCallback = null;
    +	        this.onPausedCallback = null;
    +	        this.onDestroyCallback = null;
    +    	}
    +
    +    	delete this.states[key];
    +
    +    },
    +
    +	/**
    +    * Start the given state
    +    * @method Phaser.StateManager#start
    +    * @param {string} key - The key of the state you want to start.
    +    * @param {boolean} [clearWorld] - clear everything in the world? (Default to true)
    +    * @param {boolean} [clearCache] - clear asset cache? (Default to false and ONLY available when clearWorld=true)
    +    */
    +    start: function (key, clearWorld, clearCache) {
    +
    +    	// console.log('Phaser.StateManager.start', key);
    +    	// console.log(this);
    +    	// console.log(this.callbackContext);
    +
    +        if (typeof clearWorld === "undefined") { clearWorld = true; }
    +        if (typeof clearCache === "undefined") { clearCache = false; }
    +
    +        if (this.game.isBooted == false)
    +        {
    +			// console.log('Game is NOT booted, so set the requested state as pending');
    +			this._pendingState = key;
    +			return;
    +        }
    +
    +		if (this.checkState(key) == false)
    +		{
    +			return;
    +		}
    +		else
    +		{
    +			//	Already got a state running?
    +			if (this.current)
    +			{
    +				this.onShutDownCallback.call(this.callbackContext);
    +			}
    +
    +	        if (clearWorld)
    +	        {
    +				this.game.tweens.removeAll();
    +
    +	            this.game.world.destroy();
    +
    +	            if (clearCache == true)
    +	            {
    +	                this.game.cache.destroy();
    +	            }
    +	        }
    +
    +			this.setCurrentState(key);
    +		}
    +
    +        if (this.onPreloadCallback)
    +        {
    +	    	// console.log('Preload Callback found');
    +            this.game.load.reset();
    +            this.onPreloadCallback.call(this.callbackContext);
    +
    +            //  Is the loader empty?
    +            if (this.game.load.queueSize == 0)
    +            {
    +		    	// console.log('Loader queue empty');
    +                this.game.loadComplete();
    +            }
    +            else
    +            {
    +		    	// console.log('Loader started');
    +                //  Start the loader going as we have something in the queue
    +                this.game.load.start();
    +            }
    +        }
    +        else
    +        {
    +			// console.log('Preload callback not found');
    +            //  No init? Then there was nothing to load either
    +            this.game.loadComplete();
    +        }
    +
    +    },
    +	
    +	/**
    +	* Used by onInit and onShutdown when those functions don't exist on the state
    +    * @method Phaser.StateManager#dummy
    +    * @private
    +    */
    +    dummy: function () {
    +    },
    +
    +	/**
    +    * Description.
    +    * @method Phaser.StateManager#checkState
    +    * @param {string} key - The key of the state you want to check.
    +    * @return {boolean} Description.
    +    */
    +    checkState: function (key) {
    +
    +		if (this.states[key])
    +		{
    +			var valid = false;
    +
    +			if (this.states[key]['preload']) { valid = true; }
    +
    +			if (valid == false && this.states[key]['loadRender']) { valid = true; }
    +			if (valid == false && this.states[key]['loadUpdate']) { valid = true; }
    +			if (valid == false && this.states[key]['create']) { valid = true; }
    +			if (valid == false && this.states[key]['update']) { valid = true; }
    +			if (valid == false && this.states[key]['preRender']) { valid = true; }
    +			if (valid == false && this.states[key]['render']) { valid = true; }
    +			if (valid == false && this.states[key]['paused']) { valid = true; }
    +
    +        	if (valid == false)
    +        	{
    +	            console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions.");
    +	            return false;
    +	        }
    +
    +			return true;
    +		}
    +		else
    +		{
    +			console.warn("Phaser.StateManager - No state found with the key: " + key);
    +			return false;
    +		}
    +
    +    },
    +
    +	/**
    +    * Links game properties to the State given by the key.
    +    * @method Phaser.StateManager#link
    +    * @param {string} key - State key.
    +    * @protected
    +    */
    +    link: function (key) {
    +
    +		// console.log('linked');
    +        this.states[key].game = this.game;
    +        this.states[key].add = this.game.add;
    +        this.states[key].camera = this.game.camera;
    +        this.states[key].cache = this.game.cache;
    +        this.states[key].input = this.game.input;
    +        this.states[key].load = this.game.load;
    +        this.states[key].math = this.game.math;
    +        this.states[key].sound = this.game.sound;
    +        this.states[key].stage = this.game.stage;
    +        this.states[key].time = this.game.time;
    +        this.states[key].tweens = this.game.tweens;
    +        this.states[key].world = this.game.world;
    +        this.states[key].particles = this.game.particles;
    +        this.states[key].physics = this.game.physics;
    +        this.states[key].rnd = this.game.rnd;
    +
    +    },
    +
    +	/**
    +    * Sets the current State. Should not be called directly (use StateManager.start)
    +    * @method Phaser.StateManager#setCurrentState
    +    * @param {string} key - State key.
    +    * @protected
    +    */
    +	setCurrentState: function (key) {
    +
    +        this.callbackContext = this.states[key];
    +
    +        this.link(key);
    +
    +        //	Used when the state is set as being the current active state
    +        this.onInitCallback = this.states[key]['init'] || this.dummy;
    +
    +        this.onPreloadCallback = this.states[key]['preload'] || null;
    +        this.onLoadRenderCallback = this.states[key]['loadRender'] || null;
    +        this.onLoadUpdateCallback = this.states[key]['loadUpdate'] || null;
    +        this.onCreateCallback = this.states[key]['create'] || null;
    +        this.onUpdateCallback = this.states[key]['update'] || null;
    +        this.onPreRenderCallback = this.states[key]['preRender'] || null;
    +        this.onRenderCallback = this.states[key]['render'] || null;
    +        this.onPausedCallback = this.states[key]['paused'] || null;
    +
    +        //	Used when the state is no longer the current active state
    +        this.onShutDownCallback = this.states[key]['shutdown'] || this.dummy;
    +
    +		this.current = key;
    +		this._created = false;
    +
    +		this.onInitCallback.call(this.callbackContext);
    +
    +	},
    +
    +	/**
    +	* @method Phaser.StateManager#loadComplete
    +    * @protected
    +	*/
    +    loadComplete: function () {
    +
    +		// console.log('Phaser.StateManager.loadComplete');
    +
    +        if (this._created == false && this.onCreateCallback)
    +        {
    +			// console.log('Create callback found');
    +	        this._created = true;
    +            this.onCreateCallback.call(this.callbackContext);
    +        }
    +        else
    +        {
    +	        this._created = true;
    +        }
    +
    +    },
    +
    +	/**
    +	* @method Phaser.StateManager#update
    +    * @protected
    +	*/
    +    update: function () {
    +
    +    	if (this._created && this.onUpdateCallback)
    +    	{
    +			this.onUpdateCallback.call(this.callbackContext);
    +    	}
    +    	else
    +    	{
    +		    if (this.onLoadUpdateCallback)
    +		    {
    +		    	this.onLoadUpdateCallback.call(this.callbackContext);
    +			}
    +		}
    +
    +    },
    +
    +	/**
    +	* @method Phaser.StateManager#preRender
    +    * @protected
    +	*/
    +    preRender: function () {
    +
    +	    if (this.onPreRenderCallback)
    +	    {
    +	    	this.onPreRenderCallback.call(this.callbackContext);
    +		}
    +
    +    },
    +
    +	/**
    +	* @method Phaser.StateManager#render
    +    * @protected
    +	*/
    +    render: function () {
    +
    +    	if (this._created && this.onRenderCallback)
    +    	{
    +			this.onRenderCallback.call(this.callbackContext);
    +    	}
    +    	else
    +    	{
    +		    if (this.onLoadRenderCallback)
    +		    {
    +		    	this.onLoadRenderCallback.call(this.callbackContext);
    +			}
    +		}
    +
    +    },
    +
    +	/**
    +    * Nuke the entire game from orbit
    +    * @method Phaser.StateManager#destroy
    +    */
    +    destroy: function () {
    +
    +        this.callbackContext = null;
    +
    +        this.onInitCallback = null;
    +        this.onShutDownCallback = null;
    +
    +        this.onPreloadCallback = null;
    +        this.onLoadRenderCallback = null;
    +        this.onLoadUpdateCallback = null;
    +        this.onCreateCallback = null;
    +        this.onUpdateCallback = null;
    +        this.onRenderCallback = null;
    +        this.onPausedCallback = null;
    +        this.onDestroyCallback = null;
    +
    +        this.game = null;
    +        this.states = {};
    +        this._pendingState = null;
    +
    +    }
    +
    +};
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/World.js.html b/Docs/out/World.js.html new file mode 100644 index 00000000..966c784c --- /dev/null +++ b/Docs/out/World.js.html @@ -0,0 +1,453 @@ + + + + + + Phaser Source: core/World.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/World.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}
    +*/
    +
    +/**
    + * "This world is but a canvas to our imagination." - Henry David Thoreau
    + * <p>
    + * A game has only one world. The world is an abstract place in which all game objects live. It is not bound
    + * by stage limits and can be any size. You look into the world via cameras. All game objects live within
    + * the world at world-based coordinates. By default a world is created the same size as your Stage.
    + *
    + * @class Phaser.World
    + * @constructor
    + * @param {Phaser.Game} game - Reference to the current game instance.
    + */
    +Phaser.World = function (game) {
    +
    +    /**
    +	* @property {Phaser.Game} game - A reference to the currently running Game.
    +	*/
    +	this.game = game;
    +
    +    /**
    +	* @property {Phaser.Rectangle} bounds - Bound of this world that objects can not escape from.
    +	*/
    +	this.bounds = new Phaser.Rectangle(0, 0, game.width, game.height);
    +
    +    /**
    +	* @property {Phaser.Camera} camera - Camera instance.
    +	*/
    +	this.camera = null;
    +
    +    /**
    +	* @property {number} currentRenderOrderID - Reset each frame, keeps a count of the total number of objects updated.
    +	*/
    +	this.currentRenderOrderID = 0;
    +	
    +    /**
    +	* @property {Phaser.Group} group - Object container stores every object created with `create*` methods.
    +	*/
    +    this.group = null;
    +	
    +};
    +
    +Phaser.World.prototype = {
    +
    +    /**
    +    * Initialises the game world.
    +    *
    +    * @method Phaser.World#boot
    +    * @protected
    +    */
    +	boot: function () {
    +
    +		this.camera = new Phaser.Camera(this.game, 0, 0, 0, this.game.width, this.game.height);
    +
    +		this.game.camera = this.camera;
    +
    +		this.group = new Phaser.Group(this.game, null, '__world', true);
    +
    +	},
    +
    +    /**
    +    * This is called automatically every frame, and is where main logic happens.
    +    * 
    +    * @method Phaser.World#update
    +    */
    +	update: function () {
    +
    +		this.camera.update();
    +
    +		this.currentRenderOrderID = 0;
    +
    +		if (this.game.stage._stage.first._iNext)
    +		{
    +			var currentNode = this.game.stage._stage.first._iNext;
    +			
    +			do	
    +			{
    +				if (currentNode['preUpdate'])
    +				{
    +					currentNode.preUpdate();
    +				}
    +
    +				if (currentNode['update'])
    +				{
    +					currentNode.update();
    +				}
    +				
    +				currentNode = currentNode._iNext;
    +			}
    +			while (currentNode != this.game.stage._stage.last._iNext)
    +		}
    +
    +	},
    +
    +    /**
    +    * This is called automatically every frame, and is where main logic happens.
    +    * @method Phaser.World#postUpdate
    +    */
    +    postUpdate: function () {
    +
    +        if (this.game.stage._stage.first._iNext)
    +        {
    +            var currentNode = this.game.stage._stage.first._iNext;
    +            
    +            do  
    +            {
    +                if (currentNode['postUpdate'])
    +                {
    +                    currentNode.postUpdate();
    +                }
    +                
    +                currentNode = currentNode._iNext;
    +            }
    +            while (currentNode != this.game.stage._stage.last._iNext)
    +        }
    +
    +    },
    +
    +	/**
    +	* Updates the size of this world.
    +	* @method Phaser.World#setSize
    +	* @param {number} width - New width of the world.
    +	* @param {number} height - New height of the world.
    +	*/
    +	setSize: function (width, height) {
    +
    +		if (width >= this.game.width)
    +        {
    +            this.bounds.width = width;
    +        }
    +
    +        if (height >= this.game.height)
    +        {
    +            this.bounds.height = height;
    +        }
    +
    +	},
    +
    +    /**
    +    * Destroyer of worlds.
    +    * @method Phaser.World#destroy
    +    */
    +    destroy: function () {
    +
    +        this.camera.x = 0;
    +        this.camera.y = 0;
    +
    +        this.game.input.reset(true);
    +
    +        this.group.removeAll();
    +
    +    }
    +	
    +};
    +
    +/**
    +* @name Phaser.World#width
    +* @property {number} width - Gets or sets the current width of the game world.
    +*/
    +Object.defineProperty(Phaser.World.prototype, "width", {
    +
    +    get: function () {
    +        return this.bounds.width;
    +    },
    +
    +    set: function (value) {
    +        this.bounds.width = value;
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.World#height
    +* @property {number} height - Gets or sets the current height of the game world.
    +*/
    +Object.defineProperty(Phaser.World.prototype, "height", {
    +
    +    get: function () {
    +        return this.bounds.height;
    +    },
    +
    +    set: function (value) {
    +        this.bounds.height = value;
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.World#centerX
    +* @property {number} centerX - Gets the X position corresponding to the center point of the world.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.World.prototype, "centerX", {
    +
    +    get: function () {
    +        return this.bounds.halfWidth;
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.World#centerY
    +* @property {number} centerY - Gets the Y position corresponding to the center point of the world.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.World.prototype, "centerY", {
    +
    +    get: function () {
    +        return this.bounds.halfHeight;
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.World#randomX
    +* @property {number} randomX - Gets a random integer which is lesser than or equal to the current width of the game world.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.World.prototype, "randomX", {
    +
    +    get: function () {
    +        return Math.round(Math.random() * this.bounds.width);
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.World#randomY
    +* @property {number} randomY - Gets a random integer which is lesser than or equal to the current height of the game world.
    +* @readonly
    +*/
    +Object.defineProperty(Phaser.World.prototype, "randomY", {
    +
    +    get: function () {
    +        return Math.round(Math.random() * this.bounds.height);
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/Docs/out/classes.list.html b/Docs/out/classes.list.html index 56191375..6b090e08 100644 --- a/Docs/out/classes.list.html +++ b/Docs/out/classes.list.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -170,11 +222,47 @@
    Camera
    +
    Circle
    +
    +
    Game
    Group
    + +
    LinkedList
    +
    + +
    PluginManager
    +
    + +
    Plugin
    +
    + +
    Point
    +
    + +
    Rectangle
    +
    + +
    Signal
    +
    + +
    Stage
    +
    + +
    State
    +
    + +
    StateManager
    +
    + +
    World
    +
    + +
    SignalBinding
    +
    @@ -207,7 +295,7 @@ Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/index.html b/Docs/out/index.html index 20e12546..e5fcf3b9 100644 --- a/Docs/out/index.html +++ b/Docs/out/index.html @@ -1,31 +1,152 @@ + - - JSDoc: Index - - - - - - + + Phaser Index + + + + + + + +
    + + +
    + + +
    + +
    + - - - -

    + + Index + + @@ -35,7 +156,11 @@ - + + + + + @@ -45,19 +170,63 @@ -
    - -
    +
    -
    - Documentation generated by JSDoc 3.2.0-dev on Wed Oct 02 2013 11:08:33 GMT+0100 (BST) -
    +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.2.0-dev + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file diff --git a/Docs/out/module-Phaser.html b/Docs/out/module-Phaser.html index 513f05e0..7e8141f8 100644 --- a/Docs/out/module-Phaser.html +++ b/Docs/out/module-Phaser.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -184,7 +236,7 @@ Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/modules.list.html b/Docs/out/modules.list.html index 8b76d781..c7e78d84 100644 --- a/Docs/out/modules.list.html +++ b/Docs/out/modules.list.html @@ -32,6 +32,10 @@ Phaser +
  • + PluginManager +
  • + @@ -66,6 +70,10 @@ Camera +
  • + Circle +
  • +
  • Game
  • @@ -74,6 +82,50 @@ Group +
  • + LinkedList +
  • + +
  • + PluginManager +
  • + +
  • + Plugin +
  • + +
  • + Point +
  • + +
  • + Rectangle +
  • + +
  • + Signal +
  • + +
  • + Stage +
  • + +
  • + State +
  • + +
  • + StateManager +
  • + +
  • + World +
  • + +
  • + SignalBinding +
  • + @@ -170,11 +222,47 @@
    Camera
    +
    Circle
    +
    +
    Game
    Group
    + +
    LinkedList
    +
    + +
    PluginManager
    +
    + +
    Plugin
    +
    + +
    Point
    +
    + +
    Rectangle
    +
    + +
    Signal
    +
    + +
    Stage
    +
    + +
    State
    +
    + +
    StateManager
    +
    + +
    World
    +
    + +
    SignalBinding
    +
    @@ -207,7 +295,7 @@ Documentation generated by JSDoc 3.2.0-dev - on Wed Oct 02 2013 01:51:38 GMT+0100 (BST) using the DocStrap template. + on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template. diff --git a/Docs/out/scripts/prettify/lang-css.js b/Docs/out/scripts/prettify/lang-css.js index 041e1f59..b1de526a 100644 --- a/Docs/out/scripts/prettify/lang-css.js +++ b/Docs/out/scripts/prettify/lang-css.js @@ -1,2 +1,21 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", -/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); +PR.registerLangHandler(PR.createSimpleLexer([ + ["pln", /^[\t\n\f\r ]+/, null, " \t\r\n "] +], [ + ["str", /^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/, null], + ["str", /^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/, null], + ["lang-css-str", /^url\(([^"')]*)\)/i], + ["kwd", /^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i, null], + ["lang-css-kw", /^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i], + ["com", /^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//], + ["com", /^(?:<\!--|--\>)/], + ["lit", /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i], + ["lit", /^#[\da-f]{3,6}/i], + ["pln", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i], + ["pun", /^[^\s\w"']+/] +]), ["css"]); +PR.registerLangHandler(PR.createSimpleLexer([], [ + ["kwd", /^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i] +]), ["css-kw"]); +PR.registerLangHandler(PR.createSimpleLexer([], [ + ["str", /^[^"')]+/] +]), ["css-str"]); \ No newline at end of file diff --git a/Docs/out/scripts/prettify/prettify.js b/Docs/out/scripts/prettify/prettify.js index eef5ad7e..37fe3728 100644 --- a/Docs/out/scripts/prettify/prettify.js +++ b/Docs/out/scripts/prettify/prettify.js @@ -1,28 +1,496 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p 122 || (d < 65 || j > 90 || b.push([Math.max(65, j) | 32, Math.min(d, 90) | 32]), d < 97 || j > 122 || b.push([Math.max(97, j) & -33, Math.min(d, 122) & -33])) + } + } + b.sort(function(a, f) { + return a[0] - f[0] || f[1] - a[1] + }); + f = []; + j = [NaN, NaN]; + for (c = 0; c < b.length; ++c) i = b[c], i[0] <= j[1] + 1 ? j[1] = Math.max(j[1], i[1]) : f.push(j = i); + b = ["["]; + o && b.push("^"); + b.push.apply(b, a); + for (c = 0; c < f.length; ++c) i = f[c], b.push(e(i[0])), i[1] > i[0] && (i[1] + 1 > i[0] && b.push("-"), b.push(e(i[1]))); + b.push("]"); + return b.join("") + } + + function y(a) { + for (var f = a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g), b = f.length, d = [], c = 0, i = 0; c < b; ++c) { + var j = f[c]; + j === "(" ? ++i : "\\" === j.charAt(0) && (j = +j.substring(1)) && j <= i && (d[j] = -1) + } + for (c = 1; c < d.length; ++c) - 1 === d[c] && (d[c] = ++t); + for (i = c = 0; c < b; ++c) j = f[c], j === "(" ? (++i, d[i] === void 0 && (f[c] = "(?:")) : "\\" === j.charAt(0) && (j = +j.substring(1)) && j <= i && (f[c] = "\\" + d[i]); + for (i = c = 0; c < b; ++c)"^" === f[c] && "^" !== f[c + 1] && (f[c] = ""); + if (a.ignoreCase && s) for (c = 0; c < b; ++c) j = f[c], a = j.charAt(0), j.length >= 2 && a === "[" ? f[c] = h(j) : a !== "\\" && (f[c] = j.replace(/[A-Za-z]/g, function(a) { + a = a.charCodeAt(0); + return "[" + String.fromCharCode(a & -33, a | 32) + "]" + })); + return f.join("") + } + for (var t = 0, s = !1, l = !1, p = 0, d = a.length; p < d; ++p) { + var g = a[p]; + if (g.ignoreCase) l = !0; + else if (/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi, ""))) { + s = !0; + l = !1; + break + } + } + for (var r = { + b: 8, + t: 9, + n: 10, + v: 11, + f: 12, + r: 13 + }, n = [], p = 0, d = a.length; p < d; ++p) { + g = a[p]; + if (g.global || g.multiline) throw Error("" + g); + n.push("(?:" + y(g) + ")") + } + return RegExp(n.join("|"), l ? "gi" : "g") + } + + function M(a) { + function m(a) { + switch (a.nodeType) { + case 1: + if (e.test(a.className)) break; + for (var g = a.firstChild; g; g = g.nextSibling) m(g); + g = a.nodeName; + if ("BR" === g || "LI" === g) h[s] = "\n", t[s << 1] = y++, t[s++ << 1 | 1] = a; + break; + case 3: + case 4: + g = a.nodeValue, g.length && (g = p ? g.replace(/\r\n?/g, "\n") : g.replace(/[\t\n\r ]+/g, " "), h[s] = g, t[s << 1] = y, y += g.length, t[s++ << 1 | 1] = a) + } + } + var e = /(?:^|\s)nocode(?:\s|$)/, + h = [], + y = 0, + t = [], + s = 0, + l; + a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = document.defaultView.getComputedStyle(a, q).getPropertyValue("white-space")); + var p = l && "pre" === l.substring(0, 3); + m(a); + return { + a: h.join("").replace(/\n$/, ""), + c: t + } + } + + function B(a, m, e, h) { + m && (a = { + a: m, + d: a + }, e(a), h.push.apply(h, a.e)) + } + + function x(a, m) { + function e(a) { + for (var l = a.d, p = [l, "pln"], d = 0, g = a.a.match(y) || [], r = {}, n = 0, z = g.length; n < z; ++n) { + var f = g[n], + b = r[f], + o = void 0, + c; + if (typeof b === "string") c = !1; + else { + var i = h[f.charAt(0)]; + if (i) o = f.match(i[1]), b = i[0]; + else { + for (c = 0; c < t; ++c) if (i = m[c], o = f.match(i[1])) { + b = i[0]; + break + } + o || (b = "pln") + } + if ((c = b.length >= 5 && "lang-" === b.substring(0, 5)) && !(o && typeof o[1] === "string")) c = !1, b = "src"; + c || (r[f] = b) + } + i = d; + d += f.length; + if (c) { + c = o[1]; + var j = f.indexOf(c), + k = j + c.length; + o[2] && (k = f.length - o[2].length, j = k - c.length); + b = b.substring(5); + B(l + i, f.substring(0, j), e, p); + B(l + i + j, c, C(b, c), p); + B(l + i + k, f.substring(k), e, p) + } else p.push(l + i, b) + } + a.e = p + } + var h = {}, + y; + (function() { + for (var e = a.concat(m), l = [], p = {}, d = 0, g = e.length; d < g; ++d) { + var r = e[d], + n = r[3]; + if (n) for (var k = n.length; --k >= 0;) h[n.charAt(k)] = r; + r = r[1]; + n = "" + r; + p.hasOwnProperty(n) || (l.push(r), p[n] = q) + } + l.push(/[\S\s]/); + y = L(l) + })(); + var t = m.length; + return e + } + + function u(a) { + var m = [], + e = []; + a.tripleQuotedStrings ? m.push(["str", /^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/, q, "'\""]) : a.multiLineStrings ? m.push(["str", /^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, q, "'\"`"]) : m.push(["str", /^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/, q, "\"'"]); + a.verbatimStrings && e.push(["str", /^@"(?:[^"]|"")*(?:"|$)/, q]); + var h = a.hashComments; + h && (a.cStyleComments ? (h > 1 ? m.push(["com", /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, q, "#"]) : m.push(["com", /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/, q, "#"]), e.push(["str", /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/, q])) : m.push(["com", /^#[^\n\r]*/, q, "#"])); + a.cStyleComments && (e.push(["com", /^\/\/[^\n\r]*/, q]), e.push(["com", /^\/\*[\S\s]*?(?:\*\/|$)/, q])); + a.regexLiterals && e.push(["lang-regex", /^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]); + (h = a.types) && e.push(["typ", h]); + a = ("" + a.keywords).replace(/^ | $/g, ""); + a.length && e.push(["kwd", RegExp("^(?:" + a.replace(/[\s,]+/g, "|") + ")\\b"), q]); + m.push(["pln", /^\s+/, q, " \r\n\t\xa0"]); + e.push(["lit", /^@[$_a-z][\w$@]*/i, q], ["typ", /^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/, q], ["pln", /^[$_a-z][\w$@]*/i, q], ["lit", /^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i, q, "0123456789"], ["pln", /^\\[\S\s]?/, q], ["pun", /^.[^\s\w"-$'./@\\`]*/, q]); + return x(m, e) + } + + function D(a, m) { + function e(a) { + switch (a.nodeType) { + case 1: + if (k.test(a.className)) break; + if ("BR" === a.nodeName) h(a), a.parentNode && a.parentNode.removeChild(a); + else for (a = a.firstChild; a; a = a.nextSibling) e(a); + break; + case 3: + case 4: + if (p) { + var b = a.nodeValue, + d = b.match(t); + if (d) { + var c = b.substring(0, d.index); + a.nodeValue = c; + (b = b.substring(d.index + d[0].length)) && a.parentNode.insertBefore(s.createTextNode(b), a.nextSibling); + h(a); + c || a.parentNode.removeChild(a) + } + } + } + } + + function h(a) { + function b(a, d) { + var e = d ? a.cloneNode(!1) : a, + f = a.parentNode; + if (f) { + var f = b(f, 1), + g = a.nextSibling; + f.appendChild(e); + for (var h = g; h; h = g) g = h.nextSibling, f.appendChild(h) + } + return e + } + for (; !a.nextSibling;) if (a = a.parentNode, !a) return; + for (var a = b(a.nextSibling, 0), e; + (e = a.parentNode) && e.nodeType === 1;) a = e; + d.push(a) + } + var k = /(?:^|\s)nocode(?:\s|$)/, + t = /\r\n?|\n/, + s = a.ownerDocument, + l; + a.currentStyle ? l = a.currentStyle.whiteSpace : window.getComputedStyle && (l = s.defaultView.getComputedStyle(a, q).getPropertyValue("white-space")); + var p = l && "pre" === l.substring(0, 3); + for (l = s.createElement("LI"); a.firstChild;) l.appendChild(a.firstChild); + for (var d = [l], g = 0; g < d.length; ++g) e(d[g]); + m === (m | 0) && d[0].setAttribute("value", m); + var r = s.createElement("OL"); + r.className = "linenums"; + for (var n = Math.max(0, m - 1 | 0) || 0, g = 0, z = d.length; g < z; ++g) l = d[g], l.className = "L" + (g + n) % 10, l.firstChild || l.appendChild(s.createTextNode("\xa0")), r.appendChild(l); + a.appendChild(r) + } + + function k(a, m) { + for (var e = m.length; --e >= 0;) { + var h = m[e]; + A.hasOwnProperty(h) ? window.console && console.warn("cannot override language handler %s", h) : A[h] = a + } + } + + function C(a, m) { + if (!a || !A.hasOwnProperty(a)) a = /^\s*= o && (h += 2); + e >= c && (a += 2) + } + } catch (w) { + "console" in window && console.log(w && w.stack ? w.stack : w) + } + } + var v = ["break,continue,do,else,for,if,return,while"], + w = [ + [v, "auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"], + F = [w, "alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"], + G = [w, "abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], + H = [G, "as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"], + w = [w, "debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"], + I = [v, "and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], + J = [v, "alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"], + v = [v, "case,done,elif,esac,eval,fi,function,in,local,set,then,until"], + K = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/, + N = /\S/, + O = u({ + keywords: [F, H, w, "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END" + I, J, v], + hashComments: !0, + cStyleComments: !0, + multiLineStrings: !0, + regexLiterals: !0 + }), + A = {}; + k(O, ["default-code"]); + k(x([], [ + ["pln", /^[^]*(?:>|$)/], + ["com", /^<\!--[\S\s]*?(?:--\>|$)/], + ["lang-", /^<\?([\S\s]+?)(?:\?>|$)/], + ["lang-", /^<%([\S\s]+?)(?:%>|$)/], + ["pun", /^(?:<[%?]|[%?]>)/], + ["lang-", /^]*>([\S\s]+?)<\/xmp\b[^>]*>/i], + ["lang-js", /^]*>([\S\s]*?)(<\/script\b[^>]*>)/i], + ["lang-css", /^]*>([\S\s]*?)(<\/style\b[^>]*>)/i], + ["lang-in.tag", /^(<\/?[a-z][^<>]*>)/i] + ]), ["default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl"]); + k(x([ + ["pln", /^\s+/, q, " \t\r\n"], + ["atv", /^(?:"[^"]*"?|'[^']*'?)/, q, "\"'"] + ], [ + ["tag", /^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i], + ["atn", /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i], + ["lang-uq.val", /^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/], + ["pun", /^[/<->]+/], + ["lang-js", /^on\w+\s*=\s*"([^"]+)"/i], + ["lang-js", /^on\w+\s*=\s*'([^']+)'/i], + ["lang-js", /^on\w+\s*=\s*([^\s"'>]+)/i], + ["lang-css", /^style\s*=\s*"([^"]+)"/i], + ["lang-css", /^style\s*=\s*'([^']+)'/i], + ["lang-css", /^style\s*=\s*([^\s"'>]+)/i] + ]), ["in.tag"]); + k(x([], [ + ["atv", /^[\S\s]+/] + ]), ["uq.val"]); + k(u({ + keywords: F, + hashComments: !0, + cStyleComments: !0, + types: K + }), ["c", "cc", "cpp", "cxx", "cyc", "m"]); + k(u({ + keywords: "null,true,false" + }), ["json"]); + k(u({ + keywords: H, + hashComments: !0, + cStyleComments: !0, + verbatimStrings: !0, + types: K + }), ["cs"]); + k(u({ + keywords: G, + cStyleComments: !0 + }), ["java"]); + k(u({ + keywords: v, + hashComments: !0, + multiLineStrings: !0 + }), ["bsh", "csh", "sh"]); + k(u({ + keywords: I, + hashComments: !0, + multiLineStrings: !0, + tripleQuotedStrings: !0 + }), ["cv", "py"]); + k(u({ + keywords: "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END", + hashComments: !0, + multiLineStrings: !0, + regexLiterals: !0 + }), ["perl", "pl", "pm"]); + k(u({ + keywords: J, + hashComments: !0, + multiLineStrings: !0, + regexLiterals: !0 + }), ["rb"]); + k(u({ + keywords: w, + cStyleComments: !0, + regexLiterals: !0 + }), ["js"]); + k(u({ + keywords: "all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", + hashComments: 3, + cStyleComments: !0, + multilineStrings: !0, + tripleQuotedStrings: !0, + regexLiterals: !0 + }), ["coffee"]); + k(x([], [ + ["str", /^[\S\s]+/] + ]), ["regex"]); + window.prettyPrintOne = function(a, m, e) { + var h = document.createElement("PRE"); + h.innerHTML = a; + e && D(h, e); + E({ + g: m, + i: e, + h: h + }); + return h.innerHTML + }; + window.prettyPrint = function(a) { + function m() { + for (var e = window.PR_SHOULD_USE_CONTINUATION ? l.now() + 250 : Infinity; p < h.length && l.now() < e; p++) { + var n = h[p], + k = n.className; + if (k.indexOf("prettyprint") >= 0) { + var k = k.match(g), + f, b; + if (b = !k) { + b = n; + for (var o = void 0, c = b.firstChild; c; c = c.nextSibling) var i = c.nodeType, + o = i === 1 ? o ? b : c : i === 3 ? N.test(c.nodeValue) ? b : o : o; + b = (f = o === b ? void 0 : o) && "CODE" === f.tagName + } + b && (k = f.className.match(g)); + k && (k = k[1]); + b = !1; + for (o = n.parentNode; o; o = o.parentNode) if ((o.tagName === "pre" || o.tagName === "code" || o.tagName === "xmp") && o.className && o.className.indexOf("prettyprint") >= 0) { + b = !0; + break + } + b || ((b = (b = n.className.match(/\blinenums\b(?::(\d+))?/)) ? b[1] && b[1].length ? +b[1] : !0 : !1) && D(n, b), d = { + g: k, + h: n, + i: b + }, E(d)) + } + } + p < h.length ? setTimeout(m, 250) : a && a() + } + for (var e = [document.getElementsByTagName("pre"), document.getElementsByTagName("code"), document.getElementsByTagName("xmp")], h = [], k = 0; k < e.length; ++k) for (var t = 0, s = e[k].length; t < s; ++t) h.push(e[k][t]); + var e = q, + l = Date; + l.now || (l = { + now: function() { + return +new Date + } + }); + var p = 0, + d, g = /\blang(?:uage)?-([\w.]+)(?!\S)/; + m() + }; + window.PR = { + createSimpleLexer: x, + registerLangHandler: k, + sourceDecorator: u, + PR_ATTRIB_NAME: "atn", + PR_ATTRIB_VALUE: "atv", + PR_COMMENT: "com", + PR_DECLARATION: "dec", + PR_KEYWORD: "kwd", + PR_LITERAL: "lit", + PR_NOCODE: "nocode", + PR_PLAIN: "pln", + PR_PUNCTUATION: "pun", + PR_SOURCE: "src", + PR_STRING: "str", + PR_TAG: "tag", + PR_TYPE: "typ" + } +})(); \ No newline at end of file diff --git a/src/animation/Animation.js b/src/animation/Animation.js index 99059953..735bedfa 100644 --- a/src/animation/Animation.js +++ b/src/animation/Animation.js @@ -339,6 +339,7 @@ Object.defineProperty(Phaser.Animation.prototype, "paused", { /** * @name Phaser.Animation#frameTotal * @property {number} frameTotal - The total number of frames in the currently loaded FrameData, or -1 if no FrameData is loaded. +* @readonly */ Object.defineProperty(Phaser.Animation.prototype, "frameTotal", { diff --git a/src/animation/AnimationManager.js b/src/animation/AnimationManager.js index 99d1c6d4..7769f077 100644 --- a/src/animation/AnimationManager.js +++ b/src/animation/AnimationManager.js @@ -259,6 +259,7 @@ Phaser.AnimationManager.prototype = { /** * @name Phaser.AnimationManager#frameData * @property {Phaser.Animation.FrameData} frameData - The current animations FrameData. +* @readonly */ Object.defineProperty(Phaser.AnimationManager.prototype, "frameData", { @@ -271,6 +272,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameData", { /** * @name Phaser.AnimationManager#frameTotal * @property {number} frameTotal - The total number of frames in the currently loaded FrameData, or -1 if no FrameData is loaded. +* @readonly */ Object.defineProperty(Phaser.AnimationManager.prototype, "frameTotal", { diff --git a/src/animation/FrameData.js b/src/animation/FrameData.js index 7c656457..47dafd2b 100644 --- a/src/animation/FrameData.js +++ b/src/animation/FrameData.js @@ -223,6 +223,7 @@ Phaser.Animation.FrameData.prototype = { /** * @name Phaser.Animation.FrameData#total * @property {number} total - The total number of frames in this FrameData set. +* @readonly */ Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", { diff --git a/src/core/Group.js b/src/core/Group.js index 2b456dfe..3bfed58f 100644 --- a/src/core/Group.js +++ b/src/core/Group.js @@ -1057,6 +1057,7 @@ Phaser.Group.prototype = { /** * @name Phaser.Group#length * @property {number} length - The number of children in this Group. +* @readonly */ Object.defineProperty(Phaser.Group.prototype, "length", { diff --git a/src/core/Stage.js b/src/core/Stage.js index a20df7a8..76133cbb 100644 --- a/src/core/Stage.js +++ b/src/core/Stage.js @@ -2,15 +2,13 @@ * @author Richard Davey * @copyright 2013 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} -* @module Phaser.Stage */ /** -* * The Stage controls the canvas on which everything is displayed. It handles display within the browser, * focus handling, game resizing, scaling and the pause, boot and orientation screens. * -* @class Stage +* @class Phaser.Stage * @constructor * @param {Phaser.Game} game - Game reference to the currently running game. * @param {number} width - Width of the canvas element. @@ -69,7 +67,8 @@ Phaser.Stage.prototype = { /** * Initialises the stage and adds the event listeners. - * @method boot + * @method Phaser.Stage#boot + * @private */ boot: function () { @@ -98,7 +97,7 @@ Phaser.Stage.prototype = { /** * This method is called when the document visibility is changed. - * @method visibilityChange + * @method Phaser.Stage#visibilityChange * @param {Event} event - Its type will be used to decide whether the game should be paused or not. */ visibilityChange: function (event) { @@ -110,12 +109,10 @@ Phaser.Stage.prototype = { if (event.type == 'pagehide' || event.type == 'blur' || document['hidden'] == true || document['webkitHidden'] == true) { - // console.log('visibilityChange - hidden', event); this.game.paused = true; } else { - // console.log('visibilityChange - shown', event); this.game.paused = false; } @@ -124,11 +121,8 @@ Phaser.Stage.prototype = { }; /** -* Get -* @returns {string} Returns the background color of the stage. -*//** -* Set -* @param {string} The background color you want the stage to have +* @name Phaser.Stage#backgroundColor +* @property {number|string} paused - Gets and sets the background color of the stage. The color can be given as a number: 0xff0000 or a hex string: '#ff0000' */ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", { diff --git a/src/core/State.js b/src/core/State.js index 26ef2fb9..e202c949 100644 --- a/src/core/State.js +++ b/src/core/State.js @@ -2,10 +2,8 @@ * @author Richard Davey * @copyright 2013 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} -* @module Phaser.State */ - /** * This is a base State class which can be extended if you are creating your own game. * It provides quick access to common functions such as the camera, cache, input, match, sound and more. @@ -15,13 +13,14 @@ */ Phaser.State = function () { + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = null; /** - * @property {Description} add - Description. + * @property {Phaser.GameObjectFactory} add - Reference to the GameObjectFactory. * @default */ this.add = null; @@ -106,7 +105,7 @@ Phaser.State.prototype = { * Override this method to add some load operations. * If you need to use the loader, you may need to use them here. * - * @method preload + * @method Phaser.State#preload */ preload: function () { }, @@ -114,7 +113,7 @@ Phaser.State.prototype = { /** * Put update logic here. * - * @method loadUpdate + * @method Phaser.State#loadUpdate */ loadUpdate: function () { }, @@ -122,7 +121,7 @@ Phaser.State.prototype = { /** * Put render operations here. * - * @method loadRender + * @method Phaser.State#loadRender */ loadRender: function () { }, @@ -131,7 +130,7 @@ Phaser.State.prototype = { * This method is called after the game engine successfully switches states. * Feel free to add any setup code here (do not load anything here, override preload() instead). * - * @method create + * @method Phaser.State#create */ create: function () { }, @@ -139,7 +138,7 @@ Phaser.State.prototype = { /** * Put update logic here. * - * @method update + * @method Phaser.State#update */ update: function () { }, @@ -147,7 +146,7 @@ Phaser.State.prototype = { /** * Put render operations here. * - * @method render + * @method Phaser.State#render */ render: function () { }, @@ -155,14 +154,14 @@ Phaser.State.prototype = { /** * This method will be called when game paused. * - * @method paused + * @method Phaser.State#paused */ paused: function () { }, /** - * This method will be called when the state is destroyed.# - * @method destroy + * This method will be called when the state is destroyed. + * @method Phaser.State#destroy */ destroy: function () { } diff --git a/src/core/StateManager.js b/src/core/StateManager.js index bacadd3b..d589d6b8 100644 --- a/src/core/StateManager.js +++ b/src/core/StateManager.js @@ -2,16 +2,15 @@ * @author Richard Davey * @copyright 2013 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} -* @module Phaser.StateManager */ /** -* Description. +* The State Manager is responsible for loading, setting up and switching game states. * * @class Phaser.StateManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. -* @param {Description} pendingState - Description. +* @param {Phaser.State|Object} [pendingState=null] - A State object to seed the manager with. */ Phaser.StateManager = function (game, pendingState) { @@ -130,7 +129,8 @@ Phaser.StateManager.prototype = { /** * Description. - * @method boot + * @method Phaser.StateManager#boot + * @private */ boot: function () { @@ -157,7 +157,7 @@ Phaser.StateManager.prototype = { /** * Add a new State. - * @method add + * @method Phaser.StateManager#add * @param key {string} - A unique key you use to reference this state, i.e. "MainMenu", "Level1". * @param state {State} - The state you want to switch to. * @param autoStart {boolean} - Start the state immediately after creating it? (default true) @@ -211,7 +211,7 @@ Phaser.StateManager.prototype = { /** * Delete the given state. - * @method remove + * @method Phaser.StateManager#remove * @param {string} key - A unique key you use to reference this state, i.e. "MainMenu", "Level1". */ remove: function (key) { @@ -239,7 +239,7 @@ Phaser.StateManager.prototype = { /** * Start the given state - * @method start + * @method Phaser.StateManager#start * @param {string} key - The key of the state you want to start. * @param {boolean} [clearWorld] - clear everything in the world? (Default to true) * @param {boolean} [clearCache] - clear asset cache? (Default to false and ONLY available when clearWorld=true) @@ -317,7 +317,7 @@ Phaser.StateManager.prototype = { /** * Used by onInit and onShutdown when those functions don't exist on the state - * @method dummy + * @method Phaser.StateManager#dummy * @private */ dummy: function () { @@ -325,7 +325,7 @@ Phaser.StateManager.prototype = { /** * Description. - * @method checkState + * @method Phaser.StateManager#checkState * @param {string} key - The key of the state you want to check. * @return {boolean} Description. */ @@ -362,9 +362,10 @@ Phaser.StateManager.prototype = { }, /** - * Description. - * @method link - * @param {string} key - Description. + * Links game properties to the State given by the key. + * @method Phaser.StateManager#link + * @param {string} key - State key. + * @protected */ link: function (key) { @@ -388,9 +389,10 @@ Phaser.StateManager.prototype = { }, /** - * Description. - * @method setCurrentState - * @param {string} key - Description. + * Sets the current State. Should not be called directly (use StateManager.start) + * @method Phaser.StateManager#setCurrentState + * @param {string} key - State key. + * @protected */ setCurrentState: function (key) { @@ -421,8 +423,8 @@ Phaser.StateManager.prototype = { }, /** - * Description. - * @method loadComplete + * @method Phaser.StateManager#loadComplete + * @protected */ loadComplete: function () { @@ -442,8 +444,8 @@ Phaser.StateManager.prototype = { }, /** - * Description. - * @method update + * @method Phaser.StateManager#update + * @protected */ update: function () { @@ -462,8 +464,8 @@ Phaser.StateManager.prototype = { }, /** - * Description. - * @method preRender + * @method Phaser.StateManager#preRender + * @protected */ preRender: function () { @@ -475,8 +477,8 @@ Phaser.StateManager.prototype = { }, /** - * Description. - * @method render + * @method Phaser.StateManager#render + * @protected */ render: function () { @@ -496,7 +498,7 @@ Phaser.StateManager.prototype = { /** * Nuke the entire game from orbit - * @method destroy + * @method Phaser.StateManager#destroy */ destroy: function () { diff --git a/src/core/World.js b/src/core/World.js index efa8d25a..9f964afb 100644 --- a/src/core/World.js +++ b/src/core/World.js @@ -2,11 +2,9 @@ * @author Richard Davey * @copyright 2013 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} -* @module Phaser.World */ /** - * * "This world is but a canvas to our imagination." - Henry David Thoreau *

    * A game has only one world. The world is an abstract place in which all game objects live. It is not bound @@ -51,7 +49,8 @@ Phaser.World.prototype = { /** * Initialises the game world. * - * @method boot + * @method Phaser.World#boot + * @protected */ boot: function () { @@ -66,7 +65,7 @@ Phaser.World.prototype = { /** * This is called automatically every frame, and is where main logic happens. * - * @method update + * @method Phaser.World#update */ update: function () { @@ -99,7 +98,7 @@ Phaser.World.prototype = { /** * This is called automatically every frame, and is where main logic happens. - * @method update + * @method Phaser.World#postUpdate */ postUpdate: function () { @@ -123,7 +122,7 @@ Phaser.World.prototype = { /** * Updates the size of this world. - * @method setSize + * @method Phaser.World#setSize * @param {number} width - New width of the world. * @param {number} height - New height of the world. */ @@ -143,7 +142,7 @@ Phaser.World.prototype = { /** * Destroyer of worlds. - * @method destroy + * @method Phaser.World#destroy */ destroy: function () { @@ -158,28 +157,16 @@ Phaser.World.prototype = { }; -// Getters / Setters /** -* Get -* @returns {Description} -*//** -* Set -* @param {Description} value - Description +* @name Phaser.World#width +* @property {number} width - Gets or sets the current width of the game world. */ Object.defineProperty(Phaser.World.prototype, "width", { - /** - * @method width - * @return {number} The current width of the game world - */ get: function () { return this.bounds.width; }, - /** - * @method width - * @return {number} Sets the width of the game world - */ set: function (value) { this.bounds.width = value; } @@ -187,11 +174,8 @@ Object.defineProperty(Phaser.World.prototype, "width", { }); /** -* Get -* @returns {number} The current height of the game world. -*//** -* Sets the width of the game world. -* @param {Description} value - Height of the game world. +* @name Phaser.World#height +* @property {number} height - Gets or sets the current height of the game world. */ Object.defineProperty(Phaser.World.prototype, "height", { @@ -206,8 +190,9 @@ Object.defineProperty(Phaser.World.prototype, "height", { }); /** -* Get -* @returns {number} return the X position of the center point of the world +* @name Phaser.World#centerX +* @property {number} centerX - Gets the X position corresponding to the center point of the world. +* @readonly */ Object.defineProperty(Phaser.World.prototype, "centerX", { @@ -218,8 +203,9 @@ Object.defineProperty(Phaser.World.prototype, "centerX", { }); /** -* Get -* @returns {number} return the Y position of the center point of the world +* @name Phaser.World#centerY +* @property {number} centerY - Gets the Y position corresponding to the center point of the world. +* @readonly */ Object.defineProperty(Phaser.World.prototype, "centerY", { @@ -230,8 +216,9 @@ Object.defineProperty(Phaser.World.prototype, "centerY", { }); /** -* Get -* @returns {number} a random integer which is lesser or equal to the current width of the game world +* @name Phaser.World#randomX +* @property {number} randomX - Gets a random integer which is lesser than or equal to the current width of the game world. +* @readonly */ Object.defineProperty(Phaser.World.prototype, "randomX", { @@ -242,8 +229,9 @@ Object.defineProperty(Phaser.World.prototype, "randomX", { }); /** -* Get -* @returns {number} a random integer which is lesser or equal to the current height of the game world +* @name Phaser.World#randomY +* @property {number} randomY - Gets a random integer which is lesser than or equal to the current height of the game world. +* @readonly */ Object.defineProperty(Phaser.World.prototype, "randomY", { diff --git a/src/geom/Circle.js b/src/geom/Circle.js index 9e4752cc..cbb736f1 100644 --- a/src/geom/Circle.js +++ b/src/geom/Circle.js @@ -2,7 +2,6 @@ * @author Richard Davey * @copyright 2013 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} -* @module Phaser.Circle */ /** @@ -56,7 +55,7 @@ Phaser.Circle.prototype = { /** * The circumference of the circle. - * @method circumference + * @method Phaser.Circle#circumference * @return {number} **/ circumference: function () { @@ -65,7 +64,7 @@ Phaser.Circle.prototype = { /** * Sets the members of Circle to the specified values. - * @method setTo + * @method Phaser.Circle#setTo * @param {number} x - The x coordinate of the center of the circle. * @param {number} y - The y coordinate of the center of the circle. * @param {number} diameter - The diameter of the circle in pixels. @@ -81,7 +80,7 @@ Phaser.Circle.prototype = { /** * Copies the x, y and diameter properties from any given object to this Circle. - * @method copyFrom + * @method Phaser.Circle#copyFrom * @param {any} source - The object to copy from. * @return {Circle} This Circle object. **/ @@ -91,7 +90,7 @@ Phaser.Circle.prototype = { /** * Copies the x, y and diameter properties from this Circle to any given object. - * @method copyTo + * @method Phaser.Circle#copyTo * @param {any} dest - The object to copy to. * @return {Object} This dest object. **/ @@ -105,7 +104,7 @@ Phaser.Circle.prototype = { /** * Returns the distance from the center of the Circle object to the given object * (can be Circle, Point or anything with x/y properties) - * @method distance + * @method Phaser.Circle#distance * @param {object} dest - The target object. Must have visible x and y properties that represent the center of the object. * @param {boolean} [round] - Round the distance to the nearest integer (default false). * @return {number} The distance between this Point object and the destination Point object. @@ -127,7 +126,7 @@ Phaser.Circle.prototype = { /** * Returns a new Circle object with the same values for the x, y, width, and height properties as this Circle object. - * @method clone + * @method Phaser.Circle#clone * @param {Phaser.Circle} out - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned. * @return {Phaser.Circle} The cloned Circle object. */ @@ -141,7 +140,7 @@ Phaser.Circle.prototype = { /** * Return true if the given x/y coordinates are within this Circle object. - * @method contains + * @method Phaser.Circle#contains * @param {number} x - The X value of the coordinate to test. * @param {number} y - The Y value of the coordinate to test. * @return {boolean} True if the coordinates are within this circle, otherwise false. @@ -152,7 +151,7 @@ Phaser.Circle.prototype = { /** * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle. - * @method circumferencePoint + * @method Phaser.Circle#circumferencePoint * @param {number} angle - The angle in radians (unless asDegrees is true) to return the point from. * @param {boolean} asDegrees - Is the given angle in radians (false) or degrees (true)? * @param {Phaser.Point} [out] - An optional Point object to put the result in to. If none specified a new Point object will be created. @@ -164,7 +163,7 @@ Phaser.Circle.prototype = { /** * Adjusts the location of the Circle object, as determined by its center coordinate, by the specified amounts. - * @method offset + * @method Phaser.Circle#offset * @param {number} dx - Moves the x value of the Circle object by this amount. * @param {number} dy - Moves the y value of the Circle object by this amount. * @return {Circle} This Circle object. @@ -177,7 +176,7 @@ Phaser.Circle.prototype = { /** * Adjusts the location of the Circle object using a Point object as a parameter. This method is similar to the Circle.offset() method, except that it takes a Point object as a parameter. - * @method offsetPoint + * @method Phaser.Circle#offsetPoint * @param {Point} point A Point object to use to offset this Circle object (or any valid object with exposed x and y properties). * @return {Circle} This Circle object. **/ @@ -187,7 +186,7 @@ Phaser.Circle.prototype = { /** * Returns a string representation of this object. - * @method toString + * @method Phaser.Circle#toString * @return {string} a string representation of the instance. **/ toString: function () { @@ -196,14 +195,10 @@ Phaser.Circle.prototype = { }; -// Getters / Setters - /** -* Get the diameter of the circle. The largest distance between any two points on the circle. The same as the radius * 2. -* @return {number} -*//** -* Set the diameter of the circle. The largest distance between any two points on the circle. The same as the radius * 2. -* @param {number} value - The diameter of the circle. +* The largest distance between any two points on the circle. The same as the radius * 2. +* @name Phaser.Circle#diameter +* @property {number} diameter - Gets or sets the diameter of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "diameter", { @@ -211,11 +206,6 @@ Object.defineProperty(Phaser.Circle.prototype, "diameter", { return this._diameter; }, - /** - * The diameter of the circle. The largest distance between any two points on the circle. The same as the radius * 2. - * @method diameter - * @param {number} The diameter of the circle. - **/ set: function (value) { if (value > 0) { this._diameter = value; @@ -226,11 +216,9 @@ Object.defineProperty(Phaser.Circle.prototype, "diameter", { }); /** -* Get the radius of the circle. The length of a line extending from the center of the circle to any point on the circle itself. The same as half the diameter. -* @return {number} -*//** -* Set -* @param {number} value - The radius of the circle. The length of a line extending from the center of the circle to any point on the circle itself. The same as half the diameter. +* The length of a line extending from the center of the circle to any point on the circle itself. The same as half the diameter. +* @name Phaser.Circle#radius +* @property {number} radius - Gets or sets the radius of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "radius", { @@ -248,11 +236,9 @@ Object.defineProperty(Phaser.Circle.prototype, "radius", { }); /** -* Get the x coordinate of the leftmost point of the circle. Changing the left property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. -* @return {number} The x coordinate of the leftmost point of the circle. -*//** -* Set the x coordinate of the leftmost point of the circle. Changing the left property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. -* @param {number} value - The value to adjust the position of the leftmost point of the circle by. +* The x coordinate of the leftmost point of the circle. Changing the left property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. +* @name Phaser.Circle#left +* @propety {number} left - Gets or sets the value of the leftmost point of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "left", { @@ -272,11 +258,9 @@ Object.defineProperty(Phaser.Circle.prototype, "left", { }); /** -* Get the x coordinate of the rightmost point of the circle. Changing the right property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. -* @return {number} The x coordinate of the rightmost point of the circle. -*//** -* Set the x coordinate of the rightmost point of the circle. Changing the right property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. -* @param {number} value - The amount to adjust the diameter of the circle by. +* The x coordinate of the rightmost point of the circle. Changing the right property of a Circle object has no effect on the x and y properties. However it does affect the diameter, whereas changing the x value does not affect the diameter property. +* @name Phaser.Circle#right +* @property {number} right - Gets or sets the value of the rightmost point of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "right", { @@ -296,11 +280,9 @@ Object.defineProperty(Phaser.Circle.prototype, "right", { }); /** -* Get the sum of the y minus the radius property. Changing the top property of a Circle object has no effect on the x and y properties, but does change the diameter. -* @return {number} -*//** * The sum of the y minus the radius property. Changing the top property of a Circle object has no effect on the x and y properties, but does change the diameter. -* @param {number} value - The amount to adjust the height of the circle by. +* @name Phaser.Circle#top +* @property {number} top - Gets or sets the top of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "top", { @@ -320,11 +302,9 @@ Object.defineProperty(Phaser.Circle.prototype, "top", { }); /** -* Get the sum of the y and radius properties. Changing the bottom property of a Circle object has no effect on the x and y properties, but does change the diameter. -* @return {number} -*//** -* Set the sum of the y and radius properties. Changing the bottom property of a Circle object has no effect on the x and y properties, but does change the diameter. -* @param {number} value - The value to adjust the height of the circle by. +* The sum of the y and radius properties. Changing the bottom property of a Circle object has no effect on the x and y properties, but does change the diameter. +* @name Phaser.Circle#bottom +* @property {number} bottom - Gets or sets the bottom of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "bottom", { @@ -345,8 +325,10 @@ Object.defineProperty(Phaser.Circle.prototype, "bottom", { }); /** -* Gets the area of this Circle. -* @return {number} This area of this circle. +* The area of this Circle. +* @name Phaser.Circle#area +* @property {number} area - The area of this circle. +* @readonly */ Object.defineProperty(Phaser.Circle.prototype, "area", { @@ -361,11 +343,10 @@ Object.defineProperty(Phaser.Circle.prototype, "area", { }); /** -* Determines whether or not this Circle object is empty. -* @return {boolean} A value of true if the Circle objects diameter is less than or equal to 0; otherwise false. -*//** -* Sets all of the Circle objects properties to 0. A Circle object is empty if its diameter is less than or equal to 0. -* @param {Description} value - Description. +* Determines whether or not this Circle object is empty. Will return a value of true if the Circle objects diameter is less than or equal to 0; otherwise false. +* If set to true it will reset all of the Circle objects properties to 0. A Circle object is empty if its diameter is less than or equal to 0. +* @name Phaser.Circle#empty +* @property {boolean} empty - Gets or sets the empty state of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "empty", { @@ -373,22 +354,15 @@ Object.defineProperty(Phaser.Circle.prototype, "empty", { return (this._diameter == 0); }, - /** - * - * @method setEmpty - * @return {Circle} This Circle object - **/ set: function (value) { this.setTo(0, 0, 0); } }); -// Statics - /** * Return true if the given x/y coordinates are within the Circle object. -* @method contains +* @method Phaser.Circle.contains * @param {Phaser.Circle} a - The Circle to be checked. * @param {number} x - The X value of the coordinate to test. * @param {number} y - The Y value of the coordinate to test. @@ -412,7 +386,7 @@ Phaser.Circle.contains = function (a, x, y) { /** * Determines whether the two Circle objects match. This method compares the x, y and diameter properties. -* @method equals +* @method Phaser.Circle.equals * @param {Phaser.Circle} a - The first Circle object. * @param {Phaser.Circle} b - The second Circle object. * @return {boolean} A value of true if the object has exactly the same values for the x, y and diameter properties as this Circle object; otherwise false. @@ -424,7 +398,7 @@ Phaser.Circle.equals = function (a, b) { /** * Determines whether the two Circle objects intersect. * This method checks the radius distances between the two Circle objects to see if they intersect. -* @method intersects +* @method Phaser.Circle.intersects * @param {Phaser.Circle} a - The first Circle object. * @param {Phaser.Circle} b - The second Circle object. * @return {boolean} A value of true if the specified object intersects with this Circle object; otherwise false. @@ -435,7 +409,7 @@ Phaser.Circle.intersects = function (a, b) { /** * Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle. -* @method circumferencePoint +* @method Phaser.Circle.circumferencePoint * @param {Phaser.Circle} a - The first Circle object. * @param {number} angle - The angle in radians (unless asDegrees is true) to return the point from. * @param {boolean} asDegrees - Is the given angle in radians (false) or degrees (true)? @@ -460,7 +434,7 @@ Phaser.Circle.circumferencePoint = function (a, angle, asDegrees, out) { /** * Checks if the given Circle and Rectangle objects intersect. -* @method intersectsRectangle +* @method Phaser.Circle.intersectsRectangle * @param {Phaser.Circle} c - The Circle object to test. * @param {Phaser.Rectangle} r - The Rectangle object to test. * @return {boolean} True if the two objects intersect, otherwise false. diff --git a/src/geom/Point.js b/src/geom/Point.js index 79384f99..83363811 100644 --- a/src/geom/Point.js +++ b/src/geom/Point.js @@ -2,12 +2,11 @@ * @author Richard Davey * @copyright 2013 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} -* @module Phaser.Point */ /** * Creates a new Point. If you pass no parameters a Point is created set to (0,0). -* @class Point +* @class Phaser.Point * @classdesc The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. * @constructor * @param {number} x The horizontal position of this Point (default 0) @@ -34,7 +33,7 @@ Phaser.Point.prototype = { /** * Copies the x and y properties from any given object to this Point. - * @method copyFrom + * @method Phaser.Point#copyFrom * @param {any} source - The object to copy from. * @return {Point} This Point object. **/ @@ -44,7 +43,7 @@ Phaser.Point.prototype = { /** * Inverts the x and y values of this Point - * @method invert + * @method Phaser.Point#invert * @return {Point} This Point object. **/ invert: function () { @@ -53,7 +52,7 @@ Phaser.Point.prototype = { /** * Sets the x and y values of this Point object to the given coordinates. - * @method setTo + * @method Phaser.Point#setTo * @param {number} x - The horizontal position of this point. * @param {number} y - The vertical position of this point. * @return {Point} This Point object. Useful for chaining method calls. @@ -64,6 +63,13 @@ Phaser.Point.prototype = { return this; }, + /** + * Adds the given x and y values to this Point. + * @method Phaser.Point#add + * @param {number} x - The value to add to Point.x. + * @param {number} y - The value to add to Point.y. + * @return {Phaser.Point} This Point object. Useful for chaining method calls. + **/ add: function (x, y) { this.x += x; @@ -72,6 +78,13 @@ Phaser.Point.prototype = { }, + /** + * Subtracts the given x and y values from this Point. + * @method Phaser.Point#subtract + * @param {number} x - The value to subtract from Point.x. + * @param {number} y - The value to subtract from Point.y. + * @return {Phaser.Point} This Point object. Useful for chaining method calls. + **/ subtract: function (x, y) { this.x -= x; @@ -80,6 +93,13 @@ Phaser.Point.prototype = { }, + /** + * Multiplies Point.x and Point.y by the given x and y values. + * @method Phaser.Point#multiply + * @param {number} x - The value to multiply Point.x by. + * @param {number} y - The value to multiply Point.x by. + * @return {Phaser.Point} This Point object. Useful for chaining method calls. + **/ multiply: function (x, y) { this.x *= x; @@ -88,6 +108,13 @@ Phaser.Point.prototype = { }, + /** + * Divides Point.x and Point.y by the given x and y values. + * @method Phaser.Point#divide + * @param {number} x - The value to divide Point.x by. + * @param {number} y - The value to divide Point.x by. + * @return {Phaser.Point} This Point object. Useful for chaining method calls. + **/ divide: function (x, y) { this.x /= x; @@ -98,7 +125,7 @@ Phaser.Point.prototype = { /** * Clamps the x value of this Point to be between the given min and max. - * @method clampX + * @method Phaser.Point#clampX * @param {number} min - The minimum value to clamp this Point to. * @param {number} max - The maximum value to clamp this Point to. * @return {Phaser.Point} This Point object. @@ -112,7 +139,7 @@ Phaser.Point.prototype = { /** * Clamps the y value of this Point to be between the given min and max - * @method clampY + * @method Phaser.Point#clampY * @param {number} min - The minimum value to clamp this Point to. * @param {number} max - The maximum value to clamp this Point to. * @return {Phaser.Point} This Point object. @@ -126,7 +153,7 @@ Phaser.Point.prototype = { /** * Clamps this Point object values to be between the given min and max. - * @method clamp + * @method Phaser.Point#clamp * @param {number} min - The minimum value to clamp this Point to. * @param {number} max - The maximum value to clamp this Point to. * @return {Phaser.Point} This Point object. @@ -141,7 +168,7 @@ Phaser.Point.prototype = { /** * Creates a copy of the given Point. - * @method clone + * @method Phaser.Point#clone * @param {Phaser.Point} [output] Optional Point object. If given the values will be set into this object, otherwise a brand new Point object will be created and returned. * @return {Phaser.Point} The new Point object. */ @@ -155,7 +182,7 @@ Phaser.Point.prototype = { /** * Copies the x and y properties from any given object to this Point. - * @method copyFrom + * @method Phaser.Point#copyFrom * @param {any} source - The object to copy from. * @return {Point} This Point object. **/ @@ -165,7 +192,7 @@ Phaser.Point.prototype = { /** * Copies the x and y properties from this Point to any given object. - * @method copyTo + * @method Phaser.Point#copyTo * @param {any} dest - The object to copy to. * @return {Object} The dest object. **/ @@ -180,7 +207,7 @@ Phaser.Point.prototype = { /** * Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x/y properties) - * @method distance + * @method Phaser.Point#distance * @param {object} dest - The target object. Must have visible x and y properties that represent the center of the object. * @param {boolean} [round] - Round the distance to the nearest integer (default false). * @return {number} The distance between this Point object and the destination Point object. @@ -193,7 +220,7 @@ Phaser.Point.prototype = { /** * Determines whether the given objects x/y values are equal to this Point object. - * @method equals + * @method Phaser.Point#equals * @param {Phaser.Point} a - The first object to compare. * @return {boolean} A value of true if the Points are equal, otherwise false. */ @@ -203,7 +230,7 @@ Phaser.Point.prototype = { /** * Rotates this Point around the x/y coordinates given to the desired angle. - * @method rotate + * @method Phaser.Point#rotate * @param {number} x - The x coordinate of the anchor point * @param {number} y - The y coordinate of the anchor point * @param {number} angle - The angle in radians (unless asDegrees is true) to rotate the Point to. @@ -217,7 +244,7 @@ Phaser.Point.prototype = { /** * Returns a string representation of this object. - * @method toString + * @method Phaser.Point#toString * @return {string} A string representation of the instance. **/ toString: function () { @@ -226,11 +253,9 @@ Phaser.Point.prototype = { }; -// Statics - /** * Adds the coordinates of two points together to create a new point. -* @method add +* @method Phaser.Point.add * @param {Phaser.Point} a - The first Point object. * @param {Phaser.Point} b - The second Point object. * @param {Phaser.Point} [out] - Optional Point to store the value in, if not supplied a new Point object will be created. @@ -249,7 +274,7 @@ Phaser.Point.add = function (a, b, out) { /** * Subtracts the coordinates of two points to create a new point. -* @method subtract +* @method Phaser.Point.subtract * @param {Phaser.Point} a - The first Point object. * @param {Phaser.Point} b - The second Point object. * @param {Phaser.Point} [out] - Optional Point to store the value in, if not supplied a new Point object will be created. @@ -268,7 +293,7 @@ Phaser.Point.subtract = function (a, b, out) { /** * Multiplies the coordinates of two points to create a new point. -* @method subtract +* @method Phaser.Point.multiply * @param {Phaser.Point} a - The first Point object. * @param {Phaser.Point} b - The second Point object. * @param {Phaser.Point} [out] - Optional Point to store the value in, if not supplied a new Point object will be created. @@ -287,7 +312,7 @@ Phaser.Point.multiply = function (a, b, out) { /** * Divides the coordinates of two points to create a new point. -* @method subtract +* @method Phaser.Point.divide * @param {Phaser.Point} a - The first Point object. * @param {Phaser.Point} b - The second Point object. * @param {Phaser.Point} [out] - Optional Point to store the value in, if not supplied a new Point object will be created. @@ -306,7 +331,7 @@ Phaser.Point.divide = function (a, b, out) { /** * Determines whether the two given Point objects are equal. They are considered equal if they have the same x and y values. -* @method equals +* @method Phaser.Point.equals * @param {Phaser.Point} a - The first Point object. * @param {Phaser.Point} b - The second Point object. * @return {boolean} A value of true if the Points are equal, otherwise false. @@ -317,7 +342,7 @@ Phaser.Point.equals = function (a, b) { /** * Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x/y properties). -* @method distance +* @method Phaser.Point.distance * @param {object} a - The target object. Must have visible x and y properties that represent the center of the object. * @param {object} b - The target object. Must have visible x and y properties that represent the center of the object. * @param {boolean} [round] - Round the distance to the nearest integer (default false). @@ -340,7 +365,7 @@ Phaser.Point.distance = function (a, b, round) { /** * Rotates a Point around the x/y coordinates given to the desired angle. -* @method rotate +* @method Phaser.Point.rotate * @param {Phaser.Point} a - The Point object to rotate. * @param {number} x - The x coordinate of the anchor point * @param {number} y - The y coordinate of the anchor point @@ -368,5 +393,3 @@ Phaser.Point.rotate = function (a, x, y, angle, asDegrees, distance) { return a.setTo(x + distance * Math.cos(angle), y + distance * Math.sin(angle)); }; - - diff --git a/src/geom/Rectangle.js b/src/geom/Rectangle.js index fe499fb6..44b6d3f6 100644 --- a/src/geom/Rectangle.js +++ b/src/geom/Rectangle.js @@ -2,10 +2,8 @@ * @author Richard Davey * @copyright 2013 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} -* @module Phaser.Rectangle */ - /** * Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified width and height parameters. If you call this function without parameters, a Rectangle with x, y, width, and height properties set to 0 is created. * @@ -50,7 +48,7 @@ Phaser.Rectangle.prototype = { /** * Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts. - * @method offset + * @method Phaser.Rectangle#offset * @param {number} dx - Moves the x value of the Rectangle object by this amount. * @param {number} dy - Moves the y value of the Rectangle object by this amount. * @return {Rectangle} This Rectangle object. @@ -66,7 +64,7 @@ Phaser.Rectangle.prototype = { /** * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter. - * @method offsetPoint + * @method Phaser.Rectangle#offsetPoint * @param {Point} point - A Point object to use to offset this Rectangle object. * @return {Rectangle} This Rectangle object. **/ @@ -76,7 +74,7 @@ Phaser.Rectangle.prototype = { /** * Sets the members of Rectangle to the specified values. - * @method setTo + * @method Phaser.Rectangle#setTo * @param {number} x - The x coordinate of the top-left corner of the Rectangle. * @param {number} y - The y coordinate of the top-left corner of the Rectangle. * @param {number} width - The width of the Rectangle in pixels. @@ -96,7 +94,7 @@ Phaser.Rectangle.prototype = { /** * Runs Math.floor() on both the x and y values of this Rectangle. - * @method floor + * @method Phaser.Rectangle#floor **/ floor: function () { @@ -107,7 +105,7 @@ Phaser.Rectangle.prototype = { /** * Copies the x, y, width and height properties from any given object to this Rectangle. - * @method copyFrom + * @method Phaser.Rectangle#copyFrom * @param {any} source - The object to copy from. * @return {Rectangle} This Rectangle object. **/ @@ -117,7 +115,7 @@ Phaser.Rectangle.prototype = { /** * Copies the x, y, width and height properties from this Rectangle to any given object. - * @method copyTo + * @method Phaser.Rectangle#copyTo * @param {any} source - The object to copy to. * @return {object} This object. **/ @@ -134,7 +132,7 @@ Phaser.Rectangle.prototype = { /** * Increases the size of the Rectangle object by the specified amounts. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value. - * @method inflate + * @method Phaser.Rectangle#inflate * @param {number} dx - The amount to be added to the left side of the Rectangle. * @param {number} dy - The amount to be added to the bottom side of the Rectangle. * @return {Phaser.Rectangle} This Rectangle object. @@ -145,7 +143,7 @@ Phaser.Rectangle.prototype = { /** * The size of the Rectangle object, expressed as a Point object with the values of the width and height properties. - * @method size + * @method Phaser.Rectangle#size * @param {Phaser.Point} [output] - Optional Point object. If given the values will be set into the object, otherwise a brand new Point object will be created and returned. * @return {Phaser.Point} The size of the Rectangle object. */ @@ -155,7 +153,7 @@ Phaser.Rectangle.prototype = { /** * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object. - * @method clone + * @method Phaser.Rectangle#clone * @param {Phaser.Rectangle} [output] - Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned. * @return {Phaser.Rectangle} */ @@ -165,7 +163,7 @@ Phaser.Rectangle.prototype = { /** * Determines whether the specified coordinates are contained within the region defined by this Rectangle object. - * @method contains + * @method Phaser.Rectangle#contains * @param {number} x - The x coordinate of the point to test. * @param {number} y - The y coordinate of the point to test. * @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false. @@ -177,7 +175,7 @@ Phaser.Rectangle.prototype = { /** * Determines whether the first Rectangle object is fully contained within the second Rectangle object. * A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first. - * @method containsRect + * @method Phaser.Rectangle#containsRect * @param {Phaser.Rectangle} b - The second Rectangle object. * @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false. */ @@ -188,7 +186,7 @@ Phaser.Rectangle.prototype = { /** * Determines whether the two Rectangles are equal. * This method compares the x, y, width and height properties of each Rectangle. - * @method equals + * @method Phaser.Rectangle#equals * @param {Phaser.Rectangle} b - The second Rectangle object. * @return {boolean} A value of true if the two Rectangles have exactly the same values for the x, y, width and height properties; otherwise false. */ @@ -198,7 +196,7 @@ Phaser.Rectangle.prototype = { /** * If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the Rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0. - * @method intersection + * @method Phaser.Rectangle#intersection * @param {Phaser.Rectangle} b - The second Rectangle object. * @param {Phaser.Rectangle} out - Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned. * @return {Phaser.Rectangle} A Rectangle object that equals the area of intersection. If the Rectangles do not intersect, this method returns an empty Rectangle object; that is, a Rectangle with its x, y, width, and height properties set to 0. @@ -210,7 +208,7 @@ Phaser.Rectangle.prototype = { /** * Determines whether the two Rectangles intersect with each other. * This method checks the x, y, width, and height properties of the Rectangles. - * @method intersects + * @method Phaser.Rectangle#intersects * @param {Phaser.Rectangle} b - The second Rectangle object. * @param {number} tolerance - A tolerance value to allow for an intersection test with padding, default to 0. * @return {boolean} A value of true if the specified object intersects with this Rectangle object; otherwise false. @@ -221,7 +219,7 @@ Phaser.Rectangle.prototype = { /** * Determines whether the object specified intersects (overlaps) with the given values. - * @method intersectsRaw + * @method Phaser.Rectangle#intersectsRaw * @param {number} left - Description. * @param {number} right - Description. * @param {number} top - Description. @@ -235,7 +233,7 @@ Phaser.Rectangle.prototype = { /** * Adds two Rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two Rectangles. - * @method union + * @method Phaser.Rectangle#union * @param {Phaser.Rectangle} b - The second Rectangle object. * @param {Phaser.Rectangle} [out] - Optional Rectangle object. If given the new values will be set into this object, otherwise a brand new Rectangle object will be created and returned. * @return {Phaser.Rectangle} A Rectangle object that is the union of the two Rectangles. @@ -246,7 +244,7 @@ Phaser.Rectangle.prototype = { /** * Returns a string representation of this object. - * @method toString + * @method Phaser.Rectangle#toString * @return {string} A string representation of the instance. **/ toString: function () { @@ -255,11 +253,10 @@ Phaser.Rectangle.prototype = { }; -// Getters / Setters - /** -* Get half of the width of the Rectangle. -* @return {number} +* @name Phaser.Rectangle#halfWidth +* @property {number} halfWidth - Half of the width of the Rectangle. +* @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "halfWidth", { @@ -270,8 +267,9 @@ Object.defineProperty(Phaser.Rectangle.prototype, "halfWidth", { }); /** -* Get galf of the height of the Rectangle. -* @return {number} +* @name Phaser.Rectangle#halfHeight +* @property {number} halfHeight - Half of the height of the Rectangle. +* @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "halfHeight", { @@ -283,10 +281,8 @@ Object.defineProperty(Phaser.Rectangle.prototype, "halfHeight", { /** * 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. -* @return {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. -* @param {number} value +* @name Phaser.Rectangle#bottom +* @property {number} bottom - The sum of the y and height properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { @@ -305,11 +301,9 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { }); /** -* Get the location of the Rectangles bottom right corner as a Point object. -* @return {Phaser.Point} -*//** -* Sets the bottom-right corner of the Rectangle, determined by the values of the given Point object. -* @param {Phaser.Point} value +* The location of the Rectangles bottom right corner as a Point object. +* @name Phaser.Rectangle#bottom +* @property {Phaser.Point} bottomRight - Gets or sets the location of the Rectangles bottom right corner as a Point object. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { @@ -326,10 +320,8 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { /** * The x coordinate of the left of the Rectangle. Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. -* @return {number} -*//** -* The x coordinate of the left of the Rectangle. Changing the left property of a Rectangle object has no effect on the y and height properties.* However it does affect the width, whereas changing the x value does not affect the width property. -* @param {number} value +* @name Phaser.Rectangle#left +* @property {number} left - The x coordinate of the left of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "left", { @@ -349,13 +341,9 @@ Object.defineProperty(Phaser.Rectangle.prototype, "left", { }); /** -* 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. -* @return {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. -* @param {number} value +* 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. +* @name Phaser.Rectangle#right +* @property {number} right - The sum of the x and width properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "right", { @@ -375,7 +363,9 @@ Object.defineProperty(Phaser.Rectangle.prototype, "right", { /** * The volume of the Rectangle derived from width * height. -* @return {number} +* @name Phaser.Rectangle#volume +* @property {number} volume - The volume of the Rectangle derived from width * height. +* @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { @@ -387,7 +377,9 @@ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { /** * The perimeter size of the Rectangle. This is the sum of all 4 sides. -* @return {number} +* @name Phaser.Rectangle#perimeter +* @property {number} perimeter - The perimeter size of the Rectangle. This is the sum of all 4 sides. +* @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { @@ -399,10 +391,8 @@ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { /** * The x coordinate of the center of the Rectangle. -* @return {number} -*//** -* The x coordinate of the center of the Rectangle. -* @param {number} value +* @name Phaser.Rectangle#centerX +* @property {number} centerX - The x coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { @@ -418,10 +408,8 @@ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { /** * The y coordinate of the center of the Rectangle. -* @return {number} -*//** -* The y coordinate of the center of the Rectangle. -* @param {number} value +* @name Phaser.Rectangle#centerY +* @property {number} centerY - The y coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { @@ -438,11 +426,8 @@ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { /** * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. * However it does affect the height property, whereas changing the y value does not affect the height property. -* @return {number} -*//** -* The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. -* @param {number} value +* @name Phaser.Rectangle#top +* @property {number} top - The y coordinate of the top of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "top", { @@ -462,11 +447,9 @@ Object.defineProperty(Phaser.Rectangle.prototype, "top", { }); /** -* Get the location of the Rectangles top left corner as a Point object. -* @return {Phaser.Point} -*//** -* The location of the Rectangles top-left corner, determined by the x and y coordinates of the Point. -* @param {Phaser.Point} value - Description. +* The location of the Rectangles top left corner as a Point object. +* @name Phaser.Rectangle#topLeft +* @property {Phaser.Point} topLeft - The location of the Rectangles top left corner as a Point object. */ Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", { @@ -482,11 +465,10 @@ Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", { }); /** -* Determines whether or not this Rectangle object is empty. -* @return {boolean} -*//** -* Sets all of the Rectangle object's properties to 0. A Rectangle object is empty if its width or height is less than or equal to 0. -* @param {Description} value +* Determines whether or not this Rectangle object is empty. A Rectangle object is empty if its width or height is less than or equal to 0. +* If set to true then all of the Rectangle properties are set to 0. +* @name Phaser.Rectangle#empty +* @property {boolean} empty - Gets or sets the Rectangles empty state. */ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { @@ -500,11 +482,9 @@ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { }); -// Statics - /** * Increases the size of the Rectangle object by the specified amounts. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value. -* @method inflate +* @method Phaser.Rectangle.inflate * @param {Phaser.Rectangle} a - The Rectangle object. * @param {number} dx - The amount to be added to the left side of the Rectangle. * @param {number} dy - The amount to be added to the bottom side of the Rectangle. @@ -520,7 +500,7 @@ Phaser.Rectangle.inflate = function (a, dx, dy) { /** * Increases the size of the Rectangle object. This method is similar to the Rectangle.inflate() method except it takes a Point object as a parameter. -* @method inflatePoint +* @method Phaser.Rectangle.inflatePoint * @param {Phaser.Rectangle} a - The Rectangle object. * @param {Phaser.Point} point - The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object. * @return {Phaser.Rectangle} The Rectangle object. @@ -531,7 +511,7 @@ Phaser.Rectangle.inflatePoint = function (a, point) { /** * The size of the Rectangle object, expressed as a Point object with the values of the width and height properties. -* @method size +* @method Phaser.Rectangle.size * @param {Phaser.Rectangle} a - The Rectangle object. * @param {Phaser.Point} [output] - Optional Point object. If given the values will be set into the object, otherwise a brand new Point object will be created and returned. * @return {Phaser.Point} The size of the Rectangle object @@ -543,7 +523,7 @@ Phaser.Rectangle.size = function (a, output) { /** * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object. -* @method clone +* @method Phaser.Rectangle.clone * @param {Phaser.Rectangle} a - The Rectangle object. * @param {Phaser.Rectangle} [output] - Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned. * @return {Phaser.Rectangle} @@ -555,7 +535,7 @@ Phaser.Rectangle.clone = function (a, output) { /** * Determines whether the specified coordinates are contained within the region defined by this Rectangle object. -* @method contains +* @method Phaser.Rectangle.contains * @param {Phaser.Rectangle} a - The Rectangle object. * @param {number} x - The x coordinate of the point to test. * @param {number} y - The y coordinate of the point to test. @@ -567,7 +547,7 @@ Phaser.Rectangle.contains = function (a, x, y) { /** * 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 containsPoint +* @method Phaser.Rectangle.containsPoint * @param {Phaser.Rectangle} a - The Rectangle object. * @param {Phaser.Point} point - The point object being checked. Can be Point or any object with .x and .y values. * @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false. @@ -579,7 +559,7 @@ Phaser.Rectangle.containsPoint = function (a, point) { /** * Determines whether the first Rectangle object is fully contained within the second Rectangle object. * A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first. -* @method containsRect +* @method Phaser.Rectangle.containsRect * @param {Phaser.Rectangle} a - The first Rectangle object. * @param {Phaser.Rectangle} b - The second Rectangle object. * @return {boolean} A value of true if the Rectangle object contains the specified point; otherwise false. @@ -599,7 +579,7 @@ Phaser.Rectangle.containsRect = function (a, b) { /** * Determines whether the two Rectangles are equal. * This method compares the x, y, width and height properties of each Rectangle. -* @method equals +* @method Phaser.Rectangle.equals * @param {Phaser.Rectangle} a - The first Rectangle object. * @param {Phaser.Rectangle} b - The second Rectangle object. * @return {boolean} A value of true if the two Rectangles have exactly the same values for the x, y, width and height properties; otherwise false. @@ -610,7 +590,7 @@ Phaser.Rectangle.equals = function (a, b) { /** * If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the Rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0. -* @method intersection +* @method Phaser.Rectangle.intersection * @param {Phaser.Rectangle} a - The first Rectangle object. * @param {Phaser.Rectangle} b - The second Rectangle object. * @param {Phaser.Rectangle} [out] - Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned. @@ -635,7 +615,7 @@ Phaser.Rectangle.intersection = function (a, b, out) { /** * Determines whether the two Rectangles intersect with each other. * This method checks the x, y, width, and height properties of the Rectangles. -* @method intersects +* @method Phaser.Rectangle.intersects * @param {Phaser.Rectangle} a - The first Rectangle object. * @param {Phaser.Rectangle} b - The second Rectangle object. * @param {number} tolerance - A tolerance value to allow for an intersection test with padding, default to 0 @@ -651,7 +631,7 @@ Phaser.Rectangle.intersects = function (a, b, tolerance) { /** * Determines whether the object specified intersects (overlaps) with the given values. -* @method intersectsRaw +* @method Phaser.Rectangle.intersectsRaw * @param {number} left - Description. * @param {number} right - Description. * @param {number} top - Description. @@ -669,7 +649,7 @@ Phaser.Rectangle.intersectsRaw = function (a, left, right, top, bottom, toleranc /** * Adds two Rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two Rectangles. -* @method union +* @method Phaser.Rectangle.union * @param {Phaser.Rectangle} a - The first Rectangle object. * @param {Phaser.Rectangle} b - The second Rectangle object. * @param {Phaser.Rectangle} [out] - Optional Rectangle object. If given the new values will be set into this object, otherwise a brand new Rectangle object will be created and returned.