Updated documentation.

This commit is contained in:
photonstorm
2013-11-28 15:57:09 +00:00
parent 8da9b67c18
commit f22159e257
193 changed files with 68905 additions and 93104 deletions
-1
View File
@@ -70,7 +70,6 @@ Phaser.Filter.prototype = {
/**
* Should be over-ridden.
* @method Phaser.Filter#init
* @param {...}
*/
init: function () {
// This should be over-ridden. Will receive a variable number of arguments.
+7 -7
View File
@@ -13,13 +13,13 @@
Phaser.Signal = function () {
/**
* @property {Array.<Phaser.SignalBinding>} _bindings - Description.
* @property {Array.<Phaser.SignalBinding>} _bindings - Internal variable.
* @private
*/
this._bindings = [];
/**
* @property {Description} _prevParams - Description.
* @property {any} _prevParams - Internal variable.
* @private
*/
this._prevParams = null;
@@ -28,7 +28,7 @@ Phaser.Signal = function () {
var self = this;
/**
* @property {Description} dispatch - Description.
* @property {function} dispatch - The dispatch function is what sends the Signal out.
*/
this.dispatch = function(){
Phaser.Signal.prototype.dispatch.apply(self, arguments);
@@ -63,7 +63,7 @@ Phaser.Signal.prototype = {
/**
* @method Phaser.Signal#validateListener
* @param {function} listener - Signal handler function.
* @param {Description} fnName - Description.
* @param {string} fnName - Function name.
* @private
*/
validateListener: function (listener, fnName) {
@@ -222,7 +222,7 @@ Phaser.Signal.prototype = {
/**
* 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>
* IMPORTANT: should be called only during signal dispatch, calling it before/after dispatch won't affect signal broadcast.
* @see Signal.prototype.disable
*
* @method Phaser.Signal#halt
@@ -235,7 +235,7 @@ Phaser.Signal.prototype = {
* Dispatch/Broadcast Signal to all listeners added to the queue.
*
* @method Phaser.Signal#dispatch
* @param {...} [params] - Parameters that should be passed to each handler.
* @param {any} [params] - Parameters that should be passed to each handler.
*/
dispatch: function () {
@@ -280,7 +280,7 @@ Phaser.Signal.prototype = {
/**
* 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>
* IMPORTANT: calling any method on the signal instance after calling dispose will throw errors.
*
* @method Phaser.Signal#dispose
*/
+7 -7
View File
@@ -8,15 +8,15 @@
* 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.
* This is an internal constructor and shouldn't be called by regular users.
* Inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
*
* @class Phaser.SignalBinding
* @name SignalBinding
* @author Miller Medeiros http://millermedeiros.github.com/js-signals/
* @constructor
* @inner
* @param {Signal} signal - Reference to Signal object that listener is currently bound to.
* @param {Phaser.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).
@@ -43,7 +43,7 @@ Phaser.SignalBinding = function (signal, listener, isOnce, listenerContext, prio
this.context = listenerContext;
/**
* @property {Signal} _signal - Reference to Signal object that listener is currently bound to.
* @property {Phaser.Signal} _signal - Reference to Signal object that listener is currently bound to.
* @private
*/
this._signal = signal;
@@ -74,10 +74,10 @@ Phaser.SignalBinding.prototype = {
/**
* 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>
* If binding was added using `Signal.addOnce()` it will be automatically removed from signal dispatch queue, this method is used internally for the signal dispatch.
* @method Phaser.SignalBinding#execute
* @param {array} [paramsArr] - Array of parameters that should be passed to the listener.
* @return {Description} Value returned by the listener.
* @return {any} Value returned by the listener.
*/
execute: function (paramsArr) {
@@ -100,7 +100,7 @@ Phaser.SignalBinding.prototype = {
/**
* Detach binding from signal.
* <p>alias to: @see mySignal.remove(myBinding.getListener());
* 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.
*/
+54 -47
View File
@@ -5,9 +5,16 @@
*/
/**
* Creates a new `BitmapData` object.
* Creates a new BitmapData object.
*
* @class Phaser.BitmapData
*
* @classdesc Note: This object is still experimental and likely to change.
*
* A BitmapData object can be thought of as a blank canvas onto which you can perform graphics operations as you would on a normal canvas,
* such as drawing lines, circles, arcs, fills and copying and setting blocks of pixel data. A single BitmapData can be used as the texture
* for multiple Sprites. So if you need to dynamically create a Sprite texture then they are a good choice. It supports the EaselJS Tiny API.
*
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {number} [width=256] - The width of the BitmapData in pixels.
@@ -99,7 +106,7 @@ Phaser.BitmapData.prototype = {
/**
* Updates the given Sprite so that it uses this BitmapData as its texture.
* @method Phaser.BitmapData.add
* @method Phaser.BitmapData#add
* @param {Phaser.Sprite} sprite - The sprite to apply this texture to.
*/
add: function (sprite) {
@@ -110,7 +117,7 @@ Phaser.BitmapData.prototype = {
/**
* Given an array of Sprites it will update each of them so that their Textures reference this BitmapData.
* @method Phaser.BitmapData.addTo
* @method Phaser.BitmapData#addTo
* @param {Phaser.Sprite[]} sprites - An array of Sprites to apply this texture to.
*/
addTo: function (sprites) {
@@ -127,7 +134,7 @@ Phaser.BitmapData.prototype = {
/**
* Clears the BitmapData.
* @method Phaser.BitmapData.clear
* @method Phaser.BitmapData#clear
*/
clear: function () {
@@ -149,7 +156,7 @@ Phaser.BitmapData.prototype = {
/**
* Sets the color of the given pixel to the specified red, green, blue and alpha values.
* @method Phaser.BitmapData.setPixel32
* @method Phaser.BitmapData#setPixel32
* @param {number} x - The X coordinate of the pixel to be set.
* @param {number} y - The Y coordinate of the pixel to be set.
* @param {number} red - The red color value, between 0 and 0xFF (255).
@@ -185,7 +192,7 @@ Phaser.BitmapData.prototype = {
/**
* Sets the color of the given pixel to the specified red, green and blue values.
* @method Phaser.BitmapData.setPixel
* @method Phaser.BitmapData#setPixel
* @param {number} x - The X coordinate of the pixel to be set.
* @param {number} y - The Y coordinate of the pixel to be set.
* @param {number} red - The red color value (between 0 and 255)
@@ -242,7 +249,7 @@ Phaser.BitmapData.prototype = {
/**
* Adds an arc to the path which is centered at (x, y) position with radius r starting at startAngle and ending at endAngle
* going in the given direction by anticlockwise (defaulting to clockwise).
* @method Phaser.BitmapData.arc
* @method Phaser.BitmapData#arc
* @param {number} x - The x axis of the coordinate for the arc's center
* @param {number} y - The y axis of the coordinate for the arc's center
* @param {number} radius - The arc's radius
@@ -263,7 +270,7 @@ Phaser.BitmapData.prototype = {
/**
* Adds an arc with the given control points and radius, connected to the previous point by a straight line.
* @method Phaser.BitmapData.arcTo
* @method Phaser.BitmapData#arcTo
* @param {number} x1
* @param {number} y1
* @param {number} x2
@@ -281,7 +288,7 @@ Phaser.BitmapData.prototype = {
/**
* Begins a fill with the specified color. This ends the current sub-path.
* @method Phaser.BitmapData.beginFill
* @method Phaser.BitmapData#beginFill
* @param {string} color - A CSS compatible color value (ex. "red", "#FF0000", or "rgba(255,0,0,0.5)"). Setting to null will result in no fill.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -299,7 +306,7 @@ Phaser.BitmapData.prototype = {
*
* ```myGraphics.beginLinearGradientFill(["#000","#FFF"], [0, 1], 0, 20, 0, 120).rect(20, 20, 120, 120);```
*
* @method Phaser.BitmapData.beginLinearGradientFill
* @method Phaser.BitmapData#beginLinearGradientFill
* @param {Array} colors - An array of CSS compatible color values. For example, ["#F00","#00F"] would define a gradient drawing from red to blue.
* @param {Array} ratios - An array of gradient positions which correspond to the colors. For example, [0.1, 0.9] would draw the first color to 10% then interpolating to the second color at 90%.
* @param {number} x0 - The position of the first point defining the line that defines the gradient direction and size.
@@ -330,7 +337,7 @@ Phaser.BitmapData.prototype = {
*
* ```myGraphics.setStrokeStyle(10).beginLinearGradientStroke(["#000","#FFF"], [0, 1], 0, 20, 0, 120).drawRect(20, 20, 120, 120);```
*
* @method Phaser.BitmapData.beginLinearGradientStroke
* @method Phaser.BitmapData#beginLinearGradientStroke
* @param {Array} colors - An array of CSS compatible color values. For example, ["#F00","#00F"] would define a gradient drawing from red to blue.
* @param {Array} ratios - An array of gradient positions which correspond to the colors. For example, [0.1, 0.9] would draw the first color to 10% then interpolating to the second color at 90%.
* @param {number} x0 - The position of the first point defining the line that defines the gradient direction and size.
@@ -362,7 +369,7 @@ Phaser.BitmapData.prototype = {
* .beginRadialGradientStroke(["#F00","#00F"], [0, 1], 100, 100, 0, 100, 100, 50)
* .drawRect(50, 90, 150, 110);
*
* @method Phaser.BitmapData.beginRadialGradientStroke
* @method Phaser.BitmapData#beginRadialGradientStroke
* @param {Array} colors - An array of CSS compatible color values. For example, ["#F00","#00F"] would define a gradient drawing from red to blue.
* @param {Array} ratios - An array of gradient positions which correspond to the colors. For example, [0.1, 0.9] would draw the first color to 10% then interpolating to the second color at 90%.
* @param {number} x0 - Center position of the inner circle that defines the gradient.
@@ -390,7 +397,7 @@ Phaser.BitmapData.prototype = {
/**
* Starts a new path by resetting the list of sub-paths. Call this method when you want to create a new path.
* @method Phaser.BitmapData.beginPath
* @method Phaser.BitmapData#beginPath
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
beginPath: function () {
@@ -402,7 +409,7 @@ Phaser.BitmapData.prototype = {
/**
* Begins a stroke with the specified color. This ends the current sub-path.
* @method Phaser.BitmapData.beginStroke
* @method Phaser.BitmapData#beginStroke
* @param {String} color A CSS compatible color value (ex. "#FF0000", "red", or "rgba(255,0,0,0.5)"). Setting to null will result in no stroke.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -415,7 +422,7 @@ Phaser.BitmapData.prototype = {
/**
* Adds a bezier curve from the current context point to (x, y) using the control points (cp1x, cp1y) and (cp2x, cp2y).
* @method Phaser.BitmapData.bezierCurveTo
* @method Phaser.BitmapData#bezierCurveTo
* @param {number} cp1x - The x axis of control point 1.
* @param {number} cp1y - The y axis of control point 1.
* @param {number} cp2x - The x axis of control point 2.
@@ -434,7 +441,7 @@ Phaser.BitmapData.prototype = {
/**
* Draws a circle with the specified radius at (x, y).
* @method Phaser.BitmapData.circle
* @method Phaser.BitmapData#circle
* @param {number} x - x coordinate center point of circle.
* @param {number} y - y coordinate center point of circle.
* @param {number} radius - Radius of circle in radians.
@@ -449,7 +456,7 @@ Phaser.BitmapData.prototype = {
/**
* Sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black.
* @method Phaser.BitmapData.clearRect
* @method Phaser.BitmapData#clearRect
* @param {number} x - The x axis of the coordinate for the rectangle starting point.
* @param {number} y - The y axis of the coordinate for the rectangle starting point.
* @param {number} width - The rectangles width.
@@ -466,7 +473,7 @@ Phaser.BitmapData.prototype = {
/**
* Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the clipping path only.
* @method Phaser.BitmapData.clip
* @method Phaser.BitmapData#clip
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
clip: function () {
@@ -479,7 +486,7 @@ Phaser.BitmapData.prototype = {
/**
* Tries to draw a straight line from the current point to the start. If the shape has already been closed or has only one point, this function does nothing.
* @method Phaser.BitmapData.closePath
* @method Phaser.BitmapData#closePath
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
closePath: function () {
@@ -493,7 +500,7 @@ Phaser.BitmapData.prototype = {
/**
* Creates a linear gradient with defined by an imaginary line which implies the direction of the gradient.
* Once the gradient is created colors can be inserted using the addColorStop method.
* @method Phaser.BitmapData.createLinearGradient
* @method Phaser.BitmapData#createLinearGradient
* @param {number} x - The x axis of the coordinate for the gradients starting point.
* @param {number} y - The y axis of the coordinate for the gradients starting point.
* @param {number} width - The width of the gradient.
@@ -510,7 +517,7 @@ Phaser.BitmapData.prototype = {
/**
* Creates a radial gradient.
* @method Phaser.BitmapData.createRadialGradient
* @method Phaser.BitmapData#createRadialGradient
* @param {number} x0
* @param {number} y0
* @param {number} r0
@@ -530,7 +537,7 @@ Phaser.BitmapData.prototype = {
/**
* Draws an ellipse (oval) with a specified width (w) and height (h).
* @method Phaser.BitmapData.ellipse
* @method Phaser.BitmapData#ellipse
* @param {number} x - x coordinate center point of ellipse.
* @param {number} y - y coordinate center point of ellipse.
* @param {number} w - height (horizontal diameter) of ellipse. The horizontal radius will be half of this number.
@@ -559,7 +566,7 @@ Phaser.BitmapData.prototype = {
/**
* Fills the subpaths with the current fill style.
* @method Phaser.BitmapData.fill
* @method Phaser.BitmapData#fill
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
fill: function () {
@@ -572,7 +579,7 @@ Phaser.BitmapData.prototype = {
/**
* Draws a filled rectangle at (x, y) position whose size is determined by width and height.
* @method Phaser.BitmapData.fillRect
* @method Phaser.BitmapData#fillRect
* @param {number} x - The x axis of the coordinate for the rectangle starting point.
* @param {number} y - The y axis of the coordinate for the rectangle starting point.
* @param {number} width - The rectangles width.
@@ -589,7 +596,7 @@ Phaser.BitmapData.prototype = {
/**
* Sets the fill style.
* @method Phaser.BitmapData.fillStyle
* @method Phaser.BitmapData#fillStyle
* @param {string} color - The fill color value in CSS format: #RRGGBB or rgba(r,g,b,a)
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -604,7 +611,7 @@ Phaser.BitmapData.prototype = {
/**
* Sets the font.
* @method Phaser.BitmapData.font
* @method Phaser.BitmapData#font
* @param {DOMString} font - The font to be used for any text rendering. Default value 10px sans-serif.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -617,7 +624,7 @@ Phaser.BitmapData.prototype = {
/**
* Alpha value that is applied to shapes and images before they are composited onto the canvas. Default 1.0 (opaque).
* @method Phaser.BitmapData.globalAlpha
* @method Phaser.BitmapData#globalAlpha
* @param {number} alpha - Alpha value that is applied to shapes and images before they are composited onto the canvas. Default 1.0 (opaque).
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -631,7 +638,7 @@ Phaser.BitmapData.prototype = {
/**
* With globalAlpha applied this sets how shapes and images are drawn onto the existing bitmap. Possible values: source-atop, source-in, source-out,
* source-over (default), destination-atop, destination-in, destination-out, destination-over, lighter, darker, copy and xor.
* @method Phaser.BitmapData.globalCompositeOperation
* @method Phaser.BitmapData#globalCompositeOperation
* @param {DOMString} operation - The composite operation to apply.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -644,7 +651,7 @@ Phaser.BitmapData.prototype = {
/**
* Type of endings on the end of lines. Possible values: butt (default), round, square.
* @method Phaser.BitmapData.lineCap
* @method Phaser.BitmapData#lineCap
* @param {DOMString} style - Possible values: butt (default), round, square
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -657,7 +664,7 @@ Phaser.BitmapData.prototype = {
/**
* Specifies where to start a dasharray on a line.
* @method Phaser.BitmapData.lineDashOffset
* @method Phaser.BitmapData#lineDashOffset
* @param {number} offset - Specifies where to start a dasharray on a line.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -670,7 +677,7 @@ Phaser.BitmapData.prototype = {
/**
* Defines the type of corners where two lines meet. Possible values: round, bevel, miter (default)
* @method Phaser.BitmapData.lineJoin
* @method Phaser.BitmapData#lineJoin
* @param {DOMString} join - Possible values: round, bevel, miter (default)
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -683,7 +690,7 @@ Phaser.BitmapData.prototype = {
/**
* Width of lines. Default 1.0
* @method Phaser.BitmapData.lineWidth
* @method Phaser.BitmapData#lineWidth
* @param {number} width - Width of lines. Default 1.0
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -696,7 +703,7 @@ Phaser.BitmapData.prototype = {
/**
* Default 10.
* @method Phaser.BitmapData.miterLimit
* @method Phaser.BitmapData#miterLimit
* @param {number} limit - Default 10.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -714,7 +721,7 @@ Phaser.BitmapData.prototype = {
/**
* Connects the last point in the subpath to the x, y coordinates with a straight line.
* @method Phaser.BitmapData.lineTo
* @method Phaser.BitmapData#lineTo
* @param {number} x - The x axis of the coordinate for the end of the line.
* @param {number} y - The y axis of the coordinate for the end of the line.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
@@ -731,7 +738,7 @@ Phaser.BitmapData.prototype = {
/**
* Moves the starting point of a new subpath to the (x, y) coordinates.
* @method Phaser.BitmapData.moveTo
* @method Phaser.BitmapData#moveTo
* @param {number} x - The x axis of the point.
* @param {number} y - The y axis of the point.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
@@ -747,7 +754,7 @@ Phaser.BitmapData.prototype = {
/**
* Draws a quadratic curve from the current drawing point to (x, y) using the control point (cpx, cpy).
* @method Phaser.BitmapData.quadraticCurveTo
* @method Phaser.BitmapData#quadraticCurveTo
* @param {Number} cpx - The x axis of the control point.
* @param {Number} cpy - The y axis of the control point.
* @param {Number} x - The x axis of the ending point.
@@ -764,7 +771,7 @@ Phaser.BitmapData.prototype = {
/**
* Draws a rectangle at (x, y) position whose size is determined by width and height.
* @method Phaser.BitmapData.rect
* @method Phaser.BitmapData#rect
* @param {number} x - The x axis of the coordinate for the rectangle starting point.
* @param {number} y - The y axis of the coordinate for the rectangle starting point.
* @param {number} width - The rectangles width.
@@ -781,7 +788,7 @@ Phaser.BitmapData.prototype = {
/**
* Restores the drawing style state to the last element on the 'state stack' saved by save().
* @method Phaser.BitmapData.restore
* @method Phaser.BitmapData#restore
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
restore: function () {
@@ -794,7 +801,7 @@ Phaser.BitmapData.prototype = {
/**
* Rotates the drawing context values by r radians.
* @method Phaser.BitmapData.rotate
* @method Phaser.BitmapData#rotate
* @param {number} angle - The angle of rotation given in radians.
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -812,7 +819,7 @@ Phaser.BitmapData.prototype = {
*
* ```myGraphics.setStrokeStyle(8,"round").beginStroke("#F00");```
*
* @method Phaser.BitmapData.setStrokeStyle
* @method Phaser.BitmapData#setStrokeStyle
* @param {number} thickness - The width of the stroke.
* @param {string|number} [caps=0] - Indicates the type of caps to use at the end of lines. One of butt, round, or square. Defaults to "butt". Also accepts the values 0 (butt), 1 (round), and 2 (square) for use with he tiny API.
* @param {string|number} [joints=0] Specifies the type of joints that should be used where two lines meet. One of bevel, round, or miter. Defaults to "miter". Also accepts the values 0 (miter), 1 (round), and 2 (bevel) for use with the tiny API.
@@ -841,7 +848,7 @@ Phaser.BitmapData.prototype = {
/**
* Saves the current drawing style state using a stack so you can revert any change you make to it using restore().
* @method Phaser.BitmapData.save
* @method Phaser.BitmapData#save
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
save: function () {
@@ -854,7 +861,7 @@ Phaser.BitmapData.prototype = {
/**
* Scales the current drawing context.
* @method Phaser.BitmapData.scale
* @method Phaser.BitmapData#scale
* @param {number} x
* @param {number} y
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
@@ -869,7 +876,7 @@ Phaser.BitmapData.prototype = {
/**
*
* @method Phaser.BitmapData.scrollPathIntoView
* @method Phaser.BitmapData#scrollPathIntoView
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
scrollPathIntoView: function () {
@@ -885,7 +892,7 @@ Phaser.BitmapData.prototype = {
/**
* Strokes the subpaths with the current stroke style.
* @method Phaser.BitmapData.stroke
* @method Phaser.BitmapData#stroke
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
stroke: function () {
@@ -898,7 +905,7 @@ Phaser.BitmapData.prototype = {
/**
* Paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style.
* @method Phaser.BitmapData.strokeRect
* @method Phaser.BitmapData#strokeRect
* @param {number} x - The x axis for the starting point of the rectangle.
* @param {number} y - The y axis for the starting point of the rectangle.
* @param {number} width - The rectangles width.
@@ -915,7 +922,7 @@ Phaser.BitmapData.prototype = {
/**
* Color or style to use for the lines around shapes. Default #000 (black).
* @method Phaser.BitmapData.strokeStyle
* @method Phaser.BitmapData#strokeStyle
* @param {string} style - Color or style to use for the lines around shapes. Default #000 (black).
* @return {Phaser.BitmapData} The BitmapData instance this method was called on.
*/
@@ -933,7 +940,7 @@ Phaser.BitmapData.prototype = {
/**
* If the game is running in WebGL this will push the texture up to the GPU if it's dirty.
* This is called automatically if the BitmapData is being used by a Sprite, otherwise you need to remember to call it in your render function.
* @method Phaser.BitmapData.render
* @method Phaser.BitmapData#render
*/
render: function () {
+8 -3
View File
@@ -5,11 +5,16 @@
*/
/**
* Creates a new `BitmapText` object. BitmapText work by taking a texture file and an XML file that describes the font layout.
* On Windows you can use the free app BMFont: http://www.angelcode.com/products/bmfont/
* On OS X we recommend Glyph Designer: http://www.71squared.com/en/glyphdesigner
* Creates a new BitmapText object.
*
* @class Phaser.BitmapText
*
* @classdesc BitmapText objects work by taking a texture file and an XML file that describes the font layout.
*
* On Windows you can use the free app BMFont: http://www.angelcode.com/products/bmfont/
*
* On OS X we recommend Glyph Designer: http://www.71squared.com/en/glyphdesigner
*
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {number} x - X position of the new bitmapText object.
+9 -6
View File
@@ -5,14 +5,17 @@
*/
/**
* Create a new `Button` object. A Button is a special type of Sprite that is set-up to handle Pointer events automatically. The four states a Button responds to are:
* 'Over' - when the Pointer moves over the Button. This is also commonly known as 'hover'.
* 'Out' - when the Pointer that was previously over the Button moves out of it.
* 'Down' - when the Pointer is pressed down on the Button. I.e. touched on a touch enabled device or clicked with the mouse.
* 'Up' - when the Pointer that was pressed down on the Button is released again.
* @class Phaser.Button
*
* @classdesc Create a new `Button` object. A Button is a special type of Sprite that is set-up to handle Pointer events automatically. The four states a Button responds to are:
*
* * 'Over' - when the Pointer moves over the Button. This is also commonly known as 'hover'.
* * 'Out' - when the Pointer that was previously over the Button moves out of it.
* * 'Down' - when the Pointer is pressed down on the Button. I.e. touched on a touch enabled device or clicked with the mouse.
* * 'Up' - when the Pointer that was pressed down on the Button is released again.
*
* You can set a unique texture frame and Sound for any of these states.
*
* @class Phaser.Button
* @constructor
*
* @param {Phaser.Game} game Current game instance.
+11 -2
View File
@@ -5,9 +5,18 @@
*/
/**
* The Events component is a collection of events fired by the parent game object and its components.
*
* @class Phaser.Events
*
* @classdesc The Events component is a collection of events fired by the parent game object.
*
* For example to tell when a Sprite has been added to a new group:
*
* ```sprite.events.onAddedToGroup.add(yourFunction, this);```
*
* Where `yourFunction` is the function you want called when this event occurs.
*
* Note that the Input related events only exist if the Sprite has had `inputEnabled` set to `true`.
*
* @constructor
*
* @param {Phaser.Sprite} sprite - A reference to Description.
+5 -5
View File
@@ -295,19 +295,19 @@ Phaser.GameObjectFactory.prototype = {
* A WebGL shader/filter that can be applied to Sprites.
*
* @method Phaser.GameObjectFactory#filter
* @param {string} filter - The name of the filter you wish to create, for example "HueRotate" or "SineWave"
* @param {...} - Whatever parameters are needed to be passed to the filter init function.
* @param {string} filter - The name of the filter you wish to create, for example HueRotate or SineWave.
* @param {any} - Whatever parameters are needed to be passed to the filter init function.
* @return {Phaser.Filter} The newly created Phaser.Filter object.
*/
filter: function (filter) {
var args = Array.prototype.splice.call(arguments, 1);
var f = new Phaser.Filter[filter](this.game);
var filter = new Phaser.Filter[filter](this.game);
f.init.apply(f, args);
filter.init.apply(filter, args);
return f;
return filter;
}
+4 -2
View File
@@ -5,12 +5,14 @@
*/
/**
* Create a new `Sprite` object. Sprites are the lifeblood of your game, used for nearly everything visual.
* @class Phaser.Sprite
*
* @classdesc Create a new `Sprite` object. Sprites are the lifeblood of your game, used for nearly everything visual.
*
* At its most basic a Sprite consists of a set of coordinates and a texture that is rendered to the canvas.
* They also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input),
* events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases.
*
* @class Phaser.Sprite
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
* @param {number} x - The x coordinate (in world space) to position the Sprite at.
+2 -1
View File
@@ -934,9 +934,10 @@ Phaser.Loader.prototype = {
return;
}
this._fileList[index].loaded = true;
var file = this._fileList[index];
file.loaded = true;
var loadNext = true;
var _this = this;
-1
View File
@@ -2,7 +2,6 @@
* @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.Tile
*/
/**