diff --git a/Gruntfile.js b/Gruntfile.js index 17b86ec47..64646566b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -86,6 +86,7 @@ module.exports = function (grunt) { 'src/gameobjects/Events.js', 'src/gameobjects/GameObjectFactory.js', + 'src/gameobjects/GameObjectCreator.js', 'src/gameobjects/BitmapData.js', 'src/gameobjects/Sprite.js', 'src/gameobjects/Image.js', diff --git a/README.md b/README.md index 4e5daaae3..d0bc9c1f1 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ Significant API changes: * Cache.getImageKeys and similar has been removed, please use Cache.getKeys(Phaser.Cache.IMAGE) instead, this now supports all 10 Cache data types. * After defining tiles that collide on a Tilemap, you need to call Tilemap.generateCollisionData(layer) to populate the physics world with the data required. * Phaser.QuadTree has been removed from core and moved to a plugin. It's no longer required, nor works with the physics system. +* Phaser.Animation.frame now returns the frame of the current animation, rather than the global frame from the sprite sheet / atlas. +* When adding a Group if the parent value is `null` the Group won't be added to the World, so you can add it when ready. If parent is `undefined` it's added to World by default. New features: @@ -120,6 +122,9 @@ New features: * fixedToCamera now works across all display objects. When enabled it will fix at its current x/y coordinate, but can be changed via cameraOffset. * fixedToCamrea now works for Groups as well :) You can fix a Group to the camera and it will influence its children. * Tilemap.createCollisionObjects will parse Tiled data for objectgroups and convert polyline instances into physics objects you can collide with in the world. +* Loader can now load JSON files specifically (game.load.json) and they are parsed and stored in the Game.Cache. Retrieve with game.cache.getJSON(key). +* TileSprites can now receive full Input events, dragging, etc and be positioned in-world and fixed to cameras. +* The StateManager now looks for a function called 'resumed' which is called when a game un-pauses. Updates: @@ -133,6 +138,11 @@ Updates: * World.reset now calls Camera.reset which sends the camera back to 0,0 and un-follows any object it may have been tracking. * Added hostname: '*' to the grunt-connect in Gruntfile.js (fixes #426) * Device, Canvas and GamePad classes all updated for better CocoonJS support (thanks Videlais) +* BitmapData.alphaMask will draw the given image onto a BitmapData using an image as an alpha mask. +* The new GameObjectCreator (which you access via game.make or State.make) lets you easily create an object but NOT add it to the display list. +* TilemapParser will now throw a warning if the tileset image isn't the right size for the tile dimensions. +* We now force IE11 into Canvas mode to avoid a Pixi bug with pre-multiplied alpha. Will remove once that is fixed, sorry, but it's better than no game at all, right? :( +* Loader.setPreloadSprite() will now set sprite.visible = true once the crop has been applied. Should help avoid issues (#430) on super-slow connections. Bug Fixes: @@ -149,6 +159,9 @@ Bug Fixes: * Fixed bug in Math.angleBetween where it was using the coordinates in the wrong order. * Previously using a Pixel Perfect check didn't work if the Sprite was rotated or had a non-zero anchor point, now works under all conditions + atlas frames. * If pixelPerfect Input Sprites overlapped each other the pixel check wasn't taken into consieration in the Pointer move method. +* Updated Input.Mouse to use event.button not event.which, so the const reference from input.mouse.button is correct (thanks grimor) +* Text that was fixedToCamera would 'jitter' if the world scrolled. Now works as expected across all fixed objects. + TO DO: diff --git a/build/config.php b/build/config.php index de9615d2e..52ee0cc03 100644 --- a/build/config.php +++ b/build/config.php @@ -131,6 +131,7 @@ + diff --git a/build/p2.js b/build/p2.js index 8835ae426..e3d50ce4e 100644 --- a/build/p2.js +++ b/build/p2.js @@ -1614,12 +1614,22 @@ Broadphase.aabbCheck = function(bodyA, bodyB){ * @return {Boolean} */ Broadphase.canCollide = function(bodyA, bodyB){ + // Cannot collide static bodies - if(bodyA.motionState & Body.STATIC && bodyB.motionState & Body.STATIC) + if(bodyA.motionState == Body.STATIC && bodyB.motionState == Body.STATIC) return false; - // Cannot collide sleeping bodies - if(bodyA.sleepState & Body.SLEEPING && bodyB.sleepState & Body.SLEEPING) + // Cannot collide static vs kinematic bodies + if( (bodyA.motionState == Body.KINEMATIC && bodyB.motionState == Body.STATIC) || + (bodyA.motionState == Body.STATIC && bodyB.motionState == Body.KINEMATIC)) + return false; + + // Cannot collide kinematic vs kinematic + if(bodyA.motionState == Body.KINEMATIC && bodyB.motionState == Body.KINEMATIC) + return false; + + // Cannot collide both sleeping bodies + if(bodyA.sleepState == Body.SLEEPING && bodyB.sleepState == Body.SLEEPING) return false; return true; @@ -2027,9 +2037,9 @@ Narrowphase.prototype.createContactEquation = function(bodyA,bodyB,shapeA,shapeB c.firstImpact = !this.collidedLastStep(bodyA,bodyB); c.enabled = true; - if(bodyA.allowSleep && (bodyA.motionState & Body.DYNAMIC) && !(bodyB.motionState & Body.STATIC || bodyB.sleepState === Body.SLEEPY)) + if(bodyA.allowSleep && (bodyA.motionState == Body.DYNAMIC) && !(bodyB.motionState == Body.STATIC || bodyB.sleepState === Body.SLEEPY)) bodyA.wakeUp(); - if(bodyB.allowSleep && (bodyB.motionState & Body.DYNAMIC) && !(bodyA.motionState & Body.STATIC || bodyA.sleepState === Body.SLEEPY)) + if(bodyB.allowSleep && (bodyB.motionState == Body.DYNAMIC) && !(bodyA.motionState == Body.STATIC || bodyA.sleepState === Body.SLEEPY)) bodyB.wakeUp(); return c; @@ -4111,9 +4121,11 @@ SAPBroadphase.prototype.getCollisionPairs = function(world){ break; // add pair to preliminary list - var key = bi.id < bj.id ? bi.id+' '+bj.id : bj.id+' '+bi.id; - preliminaryList[key] = true; - preliminaryList.keys.push(key); + if(Broadphase.canCollide(bi,bj)){ + var key = bi.id < bj.id ? bi.id+' '+bj.id : bj.id+' '+bi.id; + preliminaryList[key] = true; + preliminaryList.keys.push(key); + } } } @@ -4128,9 +4140,11 @@ SAPBroadphase.prototype.getCollisionPairs = function(world){ break; // If in preliminary list, add to final result - var key = bi.id < bj.id ? bi.id+' '+bj.id : bj.id+' '+bi.id; - if(preliminaryList[key] && Broadphase.boundingRadiusCheck(bi,bj)) - result.push(bi,bj); + if(Broadphase.canCollide(bi,bj)){ + var key = bi.id < bj.id ? bi.id+' '+bj.id : bj.id+' '+bi.id; + if(preliminaryList[key] && Broadphase.boundingRadiusCheck(bi,bj)) + result.push(bi,bj); + } } } @@ -6793,6 +6807,12 @@ function Body(options){ */ this.sleepTimeLimit = 1; + /** + * Gravity scaling factor. If you want the body to ignore gravity, set this to zero. If you want to reverse gravity, set it to -1. + * @property {Number} gravityScale + */ + this.gravityScale = 1; + this.timeLastSleepy = 0; this.concavePath = null; @@ -7040,6 +7060,7 @@ Body.prototype.fromPolygon = function(path,options){ var p = new decomp.Polygon(); p.vertices = path; + // Make it counter-clockwise p.makeCCW(); @@ -7174,7 +7195,7 @@ Body.prototype.addConstraintVelocity = function(){ * @param {number} dt Current time step */ Body.prototype.applyDamping = function(dt){ - if(this.motionState & Body.DYNAMIC){ // Only for dynamic bodies + if(this.motionState == Body.DYNAMIC){ // Only for dynamic bodies // Since Math.pow generates garbage we check if we can reuse the scaling coefficient from last step if(dt != this.lastDampingTimeStep){ @@ -8619,7 +8640,7 @@ function getUnvisitedNode(nodes){ var Nnodes = nodes.length; for(var i=0; i!==Nnodes; i++){ var node = nodes[i]; - if(!node.visited && !(node.body.motionState & STATIC)){ // correct? + if(!node.visited && !(node.body.motionState == STATIC)){ // correct? return node; } } @@ -9401,7 +9422,7 @@ World.prototype.internalStep = function(dt){ for(var i=0; i!==Nbodies; i++){ var b = bodies[i], fi = b.force; - vec2.scale(mg,g,b.mass); // F=m*g + vec2.scale(mg,g,b.mass*b.gravityScale); // F=m*g add(fi,fi,mg); } } @@ -9417,7 +9438,8 @@ World.prototype.internalStep = function(dt){ if(this.applyDamping){ for(var i=0; i!==Nbodies; i++){ var b = bodies[i]; - b.applyDamping(dt); + if(b.motionState == Body.DYNAMIC) + b.applyDamping(dt); } } @@ -9466,13 +9488,14 @@ World.prototype.internalStep = function(dt){ // Emit shape end overlap events var last = this.overlappingShapesLastState; - for(var i=0; i0){ + if(body.sleepState !== Body.SLEEPING && body.motionState!=Body.STATIC){ World.integrateBody(body,dt); } } diff --git a/docs/Animation.js.html b/docs/Animation.js.html index 6339bf6e7..87ceb7ce5 100644 --- a/docs/Animation.js.html +++ b/docs/Animation.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -871,7 +907,7 @@ Object.defineProperty(Phaser.Animation.prototype, 'frame', { set: function (value) { - this.currentFrame = this._frameData.getFrame(value); + this.currentFrame = this._frameData.getFrame(this._frames[value]); if (this.currentFrame !== null) { @@ -965,7 +1001,7 @@ Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zer Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/AnimationManager.js.html b/docs/AnimationManager.js.html index 589f1fe45..00442b057 100644 --- a/docs/AnimationManager.js.html +++ b/docs/AnimationManager.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -923,7 +959,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/AnimationParser.js.html b/docs/AnimationParser.js.html index 4901a322e..a39ea9fa4 100644 --- a/docs/AnimationParser.js.html +++ b/docs/AnimationParser.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -789,7 +825,7 @@ Phaser.AnimationParser = { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/ArcadePhysics.js.html b/docs/ArcadePhysics.js.html index 913fc6468..4c797fafd 100644 --- a/docs/ArcadePhysics.js.html +++ b/docs/ArcadePhysics.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1891,7 +1927,7 @@ Phaser.Physics.Arcade.prototype.constructor = Phaser.Physics.Arcade; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/BitmapData.js.html b/docs/BitmapData.js.html index e44b9b710..ca4ed830c 100644 --- a/docs/BitmapData.js.html +++ b/docs/BitmapData.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -563,7 +599,7 @@ Phaser.BitmapData = function (game, key, width, height) { Phaser.BitmapData.prototype = { /** - * Updates the given objects so that they use this BitmapData as their texture. + * Updates the given objects so that they use this BitmapData as their texture. This will replace any texture they will currently have set. * * @method Phaser.BitmapData#add * @param {Phaser.Sprite|Phaser.Sprite[]|Phaser.Image|Phaser.Image[]} object - Either a single Sprite/Image or an Array of Sprites/Images. @@ -672,6 +708,7 @@ Phaser.BitmapData.prototype = { /** * Sets the color of the given pixel to the specified red, green and blue values. + * * @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. @@ -686,7 +723,8 @@ Phaser.BitmapData.prototype = { }, /** - * Get a color of a specific pixel. + * Get the color of a specific pixel. + * * @param {number} x - The X coordinate of the pixel to get. * @param {number} y - The Y coordinate of the pixel to get. * @return {number} A native color value integer (format: 0xRRGGBB) @@ -701,7 +739,8 @@ Phaser.BitmapData.prototype = { }, /** - * Get a color of a specific pixel (including alpha value). + * Get the color of a specific pixel including its alpha value. + * * @param {number} x - The X coordinate of the pixel to get. * @param {number} y - The Y coordinate of the pixel to get. * @return {number} A native color value integer (format: 0xAARRGGBB) @@ -716,8 +755,9 @@ Phaser.BitmapData.prototype = { }, /** - * Get pixels in array in a specific Rectangle. - * @param rect {Rectangle} The specific Rectangle. + * Gets all the pixels from the region specified by the given Rectangle object. + * + * @param {Phaser.Rectangle} rect - The Rectangle region to get. * @return {array} CanvasPixelArray. */ getPixels: function (rect) { @@ -726,15 +766,89 @@ Phaser.BitmapData.prototype = { }, + /** + * Copies the pixels from the source image to this BitmapData based on the given area and destination. + * + * @param {HTMLImage|string} source - The Image to draw. If you give a key it will try and find the Image in the Game.Cache. + * @param {Phaser.Rectangle} area - The Rectangle region to copy from the source image. + * @param {number} destX - The destination x coordinate to copy the image to. + * @param {number} destY - The destination y coordinate to copy the image to. + */ copyPixels: function (source, area, destX, destY) { - this.context.drawImage(source, area.x, area.y, area.width, area.height, destX, destY, area.width, area.height); + if (typeof source === 'string') + { + source = this.game.cache.getImage(source); + } + + if (source) + { + this.context.drawImage(source, area.x, area.y, area.width, area.height, destX, destY, area.width, area.height); + } + + }, + + /** + * Draws the given image to this BitmapData at the coordinates specified. If you need to only draw a part of the image use BitmapData.copyPixels instead. + * + * @param {HTMLImage|string} source - The Image to draw. If you give a key it will try and find the Image in the Game.Cache. + * @param {number} destX - The destination x coordinate to draw the image to. + * @param {number} destY - The destination y coordinate to draw the image to. + */ + draw: function (source, destX, destY) { + + if (typeof source === 'string') + { + source = this.game.cache.getImage(source); + } + + if (source) + { + this.context.drawImage(source, 0, 0, source.width, source.height, destX, destY, source.width, source.height); + } + + }, + + /** + * Draws the given image onto this BitmapData using an image as an alpha mask. + * + * @param {HTMLImage|string} source - The Image to draw. If you give a key it will try and find the Image in the Game.Cache. + * @param {HTMLImage|string} mask - The Image to use as the alpha mask. If you give a key it will try and find the Image in the Game.Cache. + */ + alphaMask: function (source, mask) { + + var temp = this.context.globalCompositeOperation; + + if (typeof mask === 'string') + { + mask = this.game.cache.getImage(mask); + } + + if (mask) + { + this.context.drawImage(mask, 0, 0); + } + + this.context.globalCompositeOperation = 'source-atop'; + + if (typeof source === 'string') + { + source = this.game.cache.getImage(source); + } + + if (source) + { + this.context.drawImage(source, 0, 0); + } + + this.context.globalCompositeOperation = temp; }, /** * 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 */ render: function () { @@ -776,7 +890,7 @@ Phaser.BitmapData.prototype.constructor = Phaser.BitmapData; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/BitmapFont.js.html b/docs/BitmapFont.js.html index 2e8756191..72b4be78f 100644 --- a/docs/BitmapFont.js.html +++ b/docs/BitmapFont.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1046,7 +1082,7 @@ Object.defineProperty(Phaser.BitmapFont.prototype, "text", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/BitmapText.js.html b/docs/BitmapText.js.html index fed0d413d..d6b83f32e 100644 --- a/docs/BitmapText.js.html +++ b/docs/BitmapText.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -584,7 +620,7 @@ Phaser.BitmapText.prototype = Object.create(PIXI.BitmapText.prototype); Phaser.BitmapText.prototype.constructor = Phaser.BitmapText; /** -* @method setStyle +* @method Phaser.BitmapText.prototype.setStyle * @private */ Phaser.BitmapText.prototype.setStyle = function() { @@ -632,8 +668,7 @@ Phaser.BitmapText.prototype.preUpdate = function () { /** * Override and use this function in your own custom objects to handle any update requirements you may have. * -* @method Phaser.BitmapText#update -* @memberof Phaser.BitmapText +* @method Phaser.BitmapText.prototype.update */ Phaser.BitmapText.prototype.update = function() { @@ -655,34 +690,30 @@ Phaser.BitmapText.prototype.postUpdate = function () { } /** +* Destroy this BitmapText instance. This will remove any filters and un-parent any children. * @method Phaser.BitmapText.prototype.destroy */ Phaser.BitmapText.prototype.destroy = function() { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); } + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; - if (this.children.length > 0) - { - do - { - this.removeChild(this.children[0]); - } - while (this.children.length > 0); - } - } /** @@ -906,7 +937,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, "fixedToCamera", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Body.js.html b/docs/Body.js.html index 0d4fb6678..7ede3a261 100644 --- a/docs/Body.js.html +++ b/docs/Body.js.html @@ -3,7 +3,7 @@ - Phaser Source: physics/arcade/Body.js + Phaser Source: physics/Body.js + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: physics/CollisionGroup.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2014 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* Collision Group
    +*
    +* @class Phaser.Physics.CollisionGroup
    +* @classdesc Physics Collision Group Constructor
    +* @constructor
    +*/
    +Phaser.Physics.CollisionGroup = function (bitmask) {
    +
    +    /**
    +    * @property {number} mask - The CollisionGroup bitmask.
    +    */
    +    this.mask = bitmask;
    +
    +}
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Color.js.html b/docs/Color.js.html index 4689f41d0..c6740e77c 100644 --- a/docs/Color.js.html +++ b/docs/Color.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -825,7 +861,7 @@ Phaser.Color = { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/ContactMaterial.js.html b/docs/ContactMaterial.js.html new file mode 100644 index 000000000..52828ca6e --- /dev/null +++ b/docs/ContactMaterial.js.html @@ -0,0 +1,617 @@ + + + + + + Phaser Source: physics/ContactMaterial.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: physics/ContactMaterial.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2014 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* Defines a physics material
    +*
    +* @class Phaser.Physics.ContactMaterial
    +* @classdesc Physics ContactMaterial Constructor
    +* @constructor
    +* @param {Phaser.Physics.Material} materialA
    +* @param {Phaser.Physics.Material} materialB
    +* @param {object} [options]
    +*/
    +Phaser.Physics.ContactMaterial = function (materialA, materialB, options) {
    +
    +	/**
    +	* @property {number} id - The contact material identifier.
    +	*/
    +
    +	/**
    +	* @property {Phaser.Physics.Material} materialA - First material participating in the contact material.
    +	*/
    +
    +	/**
    +	* @property {Phaser.Physics.Material} materialB - First second participating in the contact material.
    +	*/
    +
    +	/**
    +	* @property {number} [friction=0.3] - Friction to use in the contact of these two materials.
    +	*/
    +
    +	/**
    +	* @property {number} [restitution=0.0] - Restitution to use in the contact of these two materials.
    +	*/
    +
    +	/**
    +	* @property {number} [stiffness=1e7] - Stiffness of the resulting ContactEquation that this ContactMaterial generate.
    +	*/
    +
    +	/**
    +	* @property {number} [relaxation=3] - Relaxation of the resulting ContactEquation that this ContactMaterial generate.
    +	*/
    +
    +	/**
    +	* @property {number} [frictionStiffness=1e7] - Stiffness of the resulting FrictionEquation that this ContactMaterial generate.
    +	*/
    +
    +	/**
    +	* @property {number} [frictionRelaxation=3] - Relaxation of the resulting FrictionEquation that this ContactMaterial generate.
    +	*/
    +
    +	/**
    +	* @property {number} [surfaceVelocity=0] - Will add surface velocity to this material. If bodyA rests on top if bodyB, and the surface velocity is positive, bodyA will slide to the right.
    +	*/
    +
    +    p2.ContactMaterial.call(this, materialA, materialB, options);
    +
    +}
    +
    +Phaser.Physics.ContactMaterial.prototype = Object.create(p2.ContactMaterial.prototype);
    +Phaser.Physics.ContactMaterial.prototype.constructor = Phaser.Physics.ContactMaterial;
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Debug.js.html b/docs/Debug.js.html index 0c1392c69..c8275034c 100644 --- a/docs/Debug.js.html +++ b/docs/Debug.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -532,7 +568,7 @@ Phaser.Utils.Debug.prototype = { */ start: function (x, y, color, columnWidth) { - if (this.context == null) + if (this.context === null) { return; } @@ -577,7 +613,7 @@ Phaser.Utils.Debug.prototype = { */ line: function (text, x, y) { - if (this.context == null) + if (this.context === null) { return; } @@ -604,7 +640,7 @@ Phaser.Utils.Debug.prototype = { */ splitline: function (text) { - if (this.context == null) + if (this.context === null) { return; } @@ -629,46 +665,6 @@ Phaser.Utils.Debug.prototype = { }, - /** - * Visually renders a QuadTree to the display. - * @method Phaser.Utils.Debug#renderQuadTree - * @param {Phaser.QuadTree} quadtree - The quadtree to render. - * @param {string} color - The color of the lines in the quadtree. - */ - renderQuadTree: function (quadtree, color) { - - color = color || 'rgba(255,0,0,0.3)'; - - this.start(); - - var bounds = quadtree.bounds; - - if (quadtree.nodes.length === 0) - { - this.context.strokeStyle = color; - this.context.strokeRect(bounds.x, bounds.y, bounds.width, bounds.height); - this.renderText(quadtree.ID + ' / ' + quadtree.objects.length, bounds.x + 4, bounds.y + 16, 'rgb(0,200,0)', '12px Courier'); - - this.context.strokeStyle = 'rgb(0,255,0)'; - - // children - for (var i = 0; i < quadtree.objects.length; i++) - { - this.context.strokeRect(quadtree.objects[i].x, quadtree.objects[i].y, quadtree.objects[i].width, quadtree.objects[i].height); - } - } - else - { - for (var i = 0; i < quadtree.nodes.length; i++) - { - this.renderQuadTree(quadtree.nodes[i]); - } - } - - this.stop(); - - }, - /** * Render Sound information, including decoded state, duration, volume and more. * @method Phaser.Utils.Debug#renderSoundInfo @@ -679,7 +675,7 @@ Phaser.Utils.Debug.prototype = { */ renderSoundInfo: function (sound, x, y, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -716,7 +712,7 @@ Phaser.Utils.Debug.prototype = { */ renderCameraInfo: function (camera, x, y, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -743,7 +739,7 @@ Phaser.Utils.Debug.prototype = { */ renderPointer: function (pointer, hideIfUp, downColor, upColor, color) { - if (this.context == null || pointer == null) + if (this.context === null || pointer == null) { return; } @@ -802,6 +798,11 @@ Phaser.Utils.Debug.prototype = { */ renderSpriteInputInfo: function (sprite, x, y, color) { + if (this.context === null) + { + return; + } + color = color || 'rgb(255,255,255)'; this.start(x, y, color); @@ -823,7 +824,7 @@ Phaser.Utils.Debug.prototype = { */ renderInputInfo: function (x, y, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -840,6 +841,21 @@ Phaser.Utils.Debug.prototype = { }, + /** + * Renders the Sprites bounds. Note: This is really expensive as it has to calculate the bounds every time you call it! + * @method Phaser.Utils.Debug#renderSpriteBounds + * @param {Phaser.Sprite} sprite - Description. + * @param {string} [color] - Color of the debug info to be rendered (format is css color string). + * @param {boolean} [filled=true] - Render the rectangle as a fillRect (default, true) or a strokeRect (false) + */ + renderSpriteBounds: function (sprite, color, filled) { + + var bounds = sprite.getBounds(); + + this.renderRectangle(bounds, color, filled); + + }, + /** * Render debug infos (including name, bounds info, position and some other properties) about the Sprite. * @method Phaser.Utils.Debug#renderSpriteInfo @@ -850,7 +866,7 @@ Phaser.Utils.Debug.prototype = { */ renderSpriteInfo: function (sprite, x, y, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -897,7 +913,7 @@ Phaser.Utils.Debug.prototype = { */ renderSpriteCoords: function (sprite, x, y, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -927,7 +943,7 @@ Phaser.Utils.Debug.prototype = { */ renderLine: function (line, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -955,7 +971,7 @@ Phaser.Utils.Debug.prototype = { */ renderLineInfo: function (line, x, y, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -980,7 +996,7 @@ Phaser.Utils.Debug.prototype = { */ renderPointInfo: function (point, x, y, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -1002,7 +1018,7 @@ Phaser.Utils.Debug.prototype = { */ renderPixel: function (x, y, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -1024,7 +1040,7 @@ Phaser.Utils.Debug.prototype = { */ renderPoint: function (point, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -1047,7 +1063,7 @@ Phaser.Utils.Debug.prototype = { */ renderRectangle: function (rect, color, filled) { - if (this.context == null) + if (this.context === null) { return; } @@ -1081,7 +1097,7 @@ Phaser.Utils.Debug.prototype = { */ renderCircle: function (circle, color) { - if (this.context == null) + if (this.context === null) { return; } @@ -1109,7 +1125,7 @@ Phaser.Utils.Debug.prototype = { */ renderText: function (text, x, y, color, font) { - if (this.context == null) + if (this.context === null) { return; } @@ -1135,6 +1151,11 @@ Phaser.Utils.Debug.prototype = { */ renderBodyInfo: function (sprite, x, y, color) { + if (this.context === null) + { + return; + } + color = color || 'rgb(255,255,255)'; this.start(x, y, color, 210); @@ -1153,12 +1174,12 @@ Phaser.Utils.Debug.prototype = { /** * @method Phaser.Utils.Debug#renderPhysicsBody - * @param {Phaser.Body} body - The Phaser.Body instance to render all shapes from. + * @param {Phaser.Physics.Body} body - The Phaser.Physics.Body instance to render all shapes from. * @param {string} [color='rgb(255,255,255)'] - The color the polygon is stroked in. */ - renderPhysicsBody: function (body, color, context) { + renderPhysicsBody: function (body, color) { - if (this.context === null && context === null) + if (this.context === null) { return; } @@ -1172,8 +1193,8 @@ Phaser.Utils.Debug.prototype = { var shapeAngles = body.data.shapeAngles; var i = shapes.length; - var x = this.game.math.p2px(body.data.position[0]) - this.game.camera.view.x; - var y = this.game.math.p2px(body.data.position[1]) - this.game.camera.view.y; + var x = this.game.math.p2pxi(body.data.position[0]) - this.game.camera.view.x; + var y = this.game.math.p2pxi(body.data.position[1]) - this.game.camera.view.y; var angle = body.data.angle; while (i--) @@ -1186,11 +1207,14 @@ Phaser.Utils.Debug.prototype = { { this.renderShapeLine(x, y, angle, shapes[i], shapeOffsets[i], shapeAngles[i]); } - // else if (shapes[i] instanceof p2.Convex) - else + else if (shapes[i] instanceof p2.Convex) { this.renderShapeConvex(x, y, angle, shapes[i], shapeOffsets[i], shapeAngles[i]); } + else if (shapes[i] instanceof p2.Circle) + { + this.renderShapeCircle(x, y, angle, shapes[i], shapeOffsets[i], shapeAngles[i]); + } } this.stop(); @@ -1198,11 +1222,15 @@ Phaser.Utils.Debug.prototype = { }, /** - * @method Phaser.Utils.Debug#renderShape + * Renders a p2.Rectangle shape. Do not call this directly - instead use Debug.renderPhysicsBody. + * + * @method Phaser.Utils.Debug#renderShapeRectangle + * @param {number} x - The x coordinate of the Shape to translate to. + * @param {number} y - The y coordinate of the Shape to translate to. + * @param {number} bodyAngle - The angle of the Body to rotate to. * @param {p2.Shape} shape - The shape to render. - * @param {number} x - The x coordinate of the Body to translate to. - * @param {number} y - The y coordinate of the Body to translate to. - * @param {number} angle - The angle of the Body to rotate to. + * @param {array} offset - The shape offset vector. + * @param {number} angle - The shape angle. */ renderShapeRectangle: function (x, y, bodyAngle, shape, offset, angle) { @@ -1212,14 +1240,14 @@ Phaser.Utils.Debug.prototype = { this.context.beginPath(); this.context.save(); - this.context.translate(x + this.game.math.p2px(offset[0]), y + this.game.math.p2px(offset[1])); + this.context.translate(x + this.game.math.p2pxi(offset[0]), y + this.game.math.p2pxi(offset[1])); this.context.rotate(bodyAngle + angle); - this.context.moveTo(this.game.math.p2px(points[0][0]), this.game.math.p2px(points[0][1])); + this.context.moveTo(this.game.math.p2pxi(points[0][0]), this.game.math.p2pxi(points[0][1])); for (var i = 1; i < points.length; i++) { - this.context.lineTo(this.game.math.p2px(points[i][0]), this.game.math.p2px(points[i][1])); + this.context.lineTo(this.game.math.p2pxi(points[i][0]), this.game.math.p2pxi(points[i][1])); } this.context.closePath(); @@ -1229,12 +1257,15 @@ Phaser.Utils.Debug.prototype = { }, /** - * @method Phaser.Utils.Debug#renderShape - * @param {number} x - The x coordinate of the Body to translate to. - * @param {number} y - The y coordinate of the Body to translate to. + * Renders a p2.Line shape. Do not call this directly - instead use Debug.renderPhysicsBody. + * + * @method Phaser.Utils.Debug#renderShapeLine + * @param {number} x - The x coordinate of the Shape to translate to. + * @param {number} y - The y coordinate of the Shape to translate to. + * @param {number} bodyAngle - The angle of the Body to rotate to. * @param {p2.Shape} shape - The shape to render. - * @param {number} offset - - * @param {number} angle - + * @param {array} offset - The shape offset vector. + * @param {number} angle - The shape angle. */ renderShapeLine: function (x, y, bodyAngle, shape, offset, angle) { @@ -1252,11 +1283,15 @@ Phaser.Utils.Debug.prototype = { }, /** - * @method Phaser.Utils.Debug#renderShape + * Renders a convex shape. Do not call this directly - instead use Debug.renderPhysicsBody. + * + * @method Phaser.Utils.Debug#renderShapeConvex + * @param {number} x - The x coordinate of the Shape to translate to. + * @param {number} y - The y coordinate of the Shape to translate to. + * @param {number} bodyAngle - The angle of the Body to rotate to. * @param {p2.Shape} shape - The shape to render. - * @param {number} x - The x coordinate of the Body to translate to. - * @param {number} y - The y coordinate of the Body to translate to. - * @param {number} angle - The angle of the Body to rotate to. + * @param {array} offset - The shape offset vector. + * @param {number} angle - The shape angle. */ renderShapeConvex: function (x, y, bodyAngle, shape, offset, angle) { @@ -1264,16 +1299,41 @@ Phaser.Utils.Debug.prototype = { this.context.beginPath(); this.context.save(); - this.context.translate(x + this.game.math.p2px(offset[0]), y + this.game.math.p2px(offset[1])); + this.context.translate(x + this.game.math.p2pxi(offset[0]), y + this.game.math.p2pxi(offset[1])); this.context.rotate(bodyAngle + angle); - this.context.moveTo(this.game.math.p2px(points[0][0]), this.game.math.p2px(points[0][1])); + this.context.moveTo(this.game.math.p2pxi(points[0][0]), this.game.math.p2pxi(points[0][1])); for (var i = 1; i < points.length; i++) { - this.context.lineTo(this.game.math.p2px(points[i][0]), this.game.math.p2px(points[i][1])); + this.context.lineTo(this.game.math.p2pxi(points[i][0]), this.game.math.p2pxi(points[i][1])); } + // this.context.arc(0, 0, this.game.math.p2px(shape.radius) , 0, Math.PI * 2); + + this.context.closePath(); + this.context.stroke(); + this.context.restore(); + + }, + + /** + * Renders a p2.Circle shape. Do not call this directly - instead use Debug.renderPhysicsBody. + * + * @method Phaser.Utils.Debug#renderShapeCircle + * @param {number} x - The x coordinate of the Shape to translate to. + * @param {number} y - The y coordinate of the Shape to translate to. + * @param {number} bodyAngle - The angle of the Body to rotate to. + * @param {p2.Shape} shape - The shape to render. + * @param {array} offset - The shape offset vector. + * @param {number} angle - The shape angle. + */ + renderShapeCircle: function (x, y, bodyAngle, shape, offset, angle) { + + this.context.beginPath(); + this.context.save(); + this.context.translate(x + this.game.math.p2pxi(offset[0]), y + this.game.math.p2pxi(offset[1])); + this.context.arc(0, 0, this.game.math.p2px(shape.radius) , 0, Math.PI * 2); this.context.closePath(); this.context.stroke(); this.context.restore(); @@ -1304,7 +1364,7 @@ Phaser.Utils.Debug.prototype.constructor = Phaser.Utils.Debug; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Device.js.html b/docs/Device.js.html index b8ced9deb..0c9d8eecc 100644 --- a/docs/Device.js.html +++ b/docs/Device.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1154,7 +1190,7 @@ Phaser.Device.prototype.constructor = Phaser.Device; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Easing.js.html b/docs/Easing.js.html index 773b7129b..97fddabaa 100644 --- a/docs/Easing.js.html +++ b/docs/Easing.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1037,7 +1073,7 @@ Phaser.Easing = { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Ellipse.js.html b/docs/Ellipse.js.html index 9dd723502..a00cc84c3 100644 --- a/docs/Ellipse.js.html +++ b/docs/Ellipse.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -770,7 +806,7 @@ PIXI.Ellipse = Phaser.Ellipse; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Emitter.js.html b/docs/Emitter.js.html index d2affe54d..b439b7248 100644 --- a/docs/Emitter.js.html +++ b/docs/Emitter.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1108,7 +1144,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Events.js.html b/docs/Events.js.html index b3d079aa3..17dcf6317 100644 --- a/docs/Events.js.html +++ b/docs/Events.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -553,7 +589,7 @@ Phaser.Events.prototype.constructor = Phaser.Events; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Filter.js.html b/docs/Filter.js.html index 490a836ba..7aabecfda 100644 --- a/docs/Filter.js.html +++ b/docs/Filter.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -639,7 +675,7 @@ Object.defineProperty(Phaser.Filter.prototype, 'height', { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Frame.js.html b/docs/Frame.js.html index 5aea4a10a..89fd7663a 100644 --- a/docs/Frame.js.html +++ b/docs/Frame.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -658,7 +694,7 @@ Phaser.Frame.prototype.constructor = Phaser.Frame; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/FrameData.js.html b/docs/FrameData.js.html index 66555f89a..1d3f82e24 100644 --- a/docs/FrameData.js.html +++ b/docs/FrameData.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -713,7 +749,7 @@ Object.defineProperty(Phaser.FrameData.prototype, "total", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Game.js.html b/docs/Game.js.html index fd295084f..ab063cb31 100644 --- a/docs/Game.js.html +++ b/docs/Game.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -573,10 +609,15 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant this.raf = null; /** - * @property {Phaser.GameObjectFactory} add - Reference to the GameObject Factory. + * @property {Phaser.GameObjectFactory} add - Reference to the Phaser.GameObjectFactory. */ this.add = null; + /** + * @property {Phaser.GameObjectCreator} make - Reference to the GameObject Creator. + */ + this.make = null; + /** * @property {Phaser.Cache} cache - Reference to the assets cache. * @default @@ -895,6 +936,7 @@ Phaser.Game.prototype = { this.world = new Phaser.World(this); this.add = new Phaser.GameObjectFactory(this); + this.make = new Phaser.GameObjectCreator(this); this.cache = new Phaser.Cache(this); this.load = new Phaser.Loader(this); this.time = new Phaser.Time(this); @@ -921,7 +963,15 @@ Phaser.Game.prototype = { this.isRunning = true; this._loadComplete = false; - this.raf = new Phaser.RequestAnimationFrame(this); + if (this.config && this.config['forceSetTimeOut']) + { + this.raf = new Phaser.RequestAnimationFrame(this, this.config['forceSetTimeOut']); + } + else + { + this.raf = new Phaser.RequestAnimationFrame(this, false); + } + this.raf.start(); } @@ -981,14 +1031,6 @@ Phaser.Game.prototype = { */ setUpRenderer: function () { - /* - if (this.device.trident) - { - // Pixi WebGL renderer on IE11 doesn't work correctly with masks, if you need them you may want to comment this block out - this.renderType = Phaser.CANVAS; - } - */ - if (this.renderType === Phaser.HEADLESS || this.renderType === Phaser.CANVAS || (this.renderType === Phaser.AUTO && this.device.webGL === false)) { if (this.device.canvas) @@ -1000,7 +1042,6 @@ Phaser.Game.prototype = { this.renderer = new PIXI.CanvasRenderer(this.width, this.height, this.canvas, this.transparent); Phaser.Canvas.setSmoothingEnabled(this.renderer.context, this.antialias); - // this.canvas = this.renderer.view; this.context = this.renderer.context; } else @@ -1013,13 +1054,9 @@ Phaser.Game.prototype = { // They requested WebGL, and their browser supports it this.renderType = Phaser.WEBGL; this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.canvas, this.transparent, this.antialias); - // this.canvas = this.renderer.view; this.context = null; } - // Phaser.Canvas.addToDOM(this.renderer.view, this.parent, true); - // Phaser.Canvas.setTouchAction(this.renderer.view); - Phaser.Canvas.addToDOM(this.canvas, this.parent, true); Phaser.Canvas.setTouchAction(this.canvas); @@ -1220,7 +1257,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/GameObjectCreator.js.html b/docs/GameObjectCreator.js.html new file mode 100644 index 000000000..9595f7697 --- /dev/null +++ b/docs/GameObjectCreator.js.html @@ -0,0 +1,913 @@ + + + + + + Phaser Source: gameobjects/GameObjectCreator.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: gameobjects/GameObjectCreator.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2014 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* The Game Object Creator is a quick way to create all of the different sorts of core objects that Phaser uses, but not add them to the game world.
    +* Use the GameObjectFactory to create and add the objects into the world.
    +*
    +* @class Phaser.GameObjectCreator
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the currently running game.
    +*/
    +Phaser.GameObjectCreator = function (game) {
    +
    +    /**
    +    * @property {Phaser.Game} game - A reference to the currently running Game.
    +    */
    +    this.game = game;
    +    
    +    /**
    +    * @property {Phaser.World} world - A reference to the game world.
    +    */
    +    this.world = this.game.world;
    +
    +};
    +
    +Phaser.GameObjectCreator.prototype = {
    +
    +    /**
    +    * Create a new `Image` object. An Image is a light-weight object you can use to display anything that doesn't need physics or animation.
    +    * It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics.
    +    *
    +    * @method Phaser.GameObjectCreator#image
    +    * @param {number} x - X position of the image.
    +    * @param {number} y - Y position of the image.
    +    * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +    * @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
    +    * @returns {Phaser.Sprite} the newly created sprite object.
    +    */
    +    image: function (x, y, key, frame) {
    +
    +        return new Phaser.Image(this.game, x, y, key, frame);
    +
    +    },
    +
    +    /**
    +    * Create a new Sprite with specific position and sprite sheet key.
    +    *
    +    * @method Phaser.GameObjectCreator#sprite
    +    * @param {number} x - X position of the new sprite.
    +    * @param {number} y - Y position of the new sprite.
    +    * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +    * @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
    +    * @returns {Phaser.Sprite} the newly created sprite object.
    +    */
    +    sprite: function (x, y, key, frame) {
    +
    +        return new Phaser.Sprite(this.game, x, y, key, frame);
    +
    +    },
    +
    +    /**
    +    * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.
    +    *
    +    * @method Phaser.GameObjectCreator#tween
    +    * @param {object} obj - Object the tween will be run on.
    +    * @return {Phaser.Tween} Description.
    +    */
    +    tween: function (obj) {
    +
    +        return this.game.tweens.create(obj);
    +
    +    },
    +
    +    /**
    +    * A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
    +    *
    +    * @method Phaser.GameObjectCreator#group
    +    * @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.
    +    * @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
    +    * @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
    +    * @return {Phaser.Group} The newly created group.
    +    */
    +    group: function (parent, name, addToStage) {
    +
    +        if (typeof name === 'undefined') { name = 'group'; }
    +        if (typeof addToStage === 'undefined') { addToStage = false; }
    +
    +        return new Phaser.Group(this.game, parent, name, addToStage);
    +
    +    },
    +
    +    /**
    +    * A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
    +    *
    +    * @method Phaser.GameObjectCreator#spriteBatch
    +    * @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
    +    * @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
    +    * @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
    +    * @return {Phaser.Group} The newly created group.
    +    */
    +    spriteBatch: function (parent, name, addToStage) {
    +
    +        if (typeof name === 'undefined') { name = 'group'; }
    +        if (typeof addToStage === 'undefined') { addToStage = false; }
    +
    +        return new Phaser.SpriteBatch(this.game, parent, name, addToStage);
    +
    +    },
    +
    +    /**
    +    * Creates a new Sound object.
    +    *
    +    * @method Phaser.GameObjectCreator#audio
    +    * @param {string} key - The Game.cache key of the sound that this object will use.
    +    * @param {number} [volume=1] - The volume at which the sound will be played.
    +    * @param {boolean} [loop=false] - Whether or not the sound will loop.
    +    * @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.
    +    * @return {Phaser.Sound} The newly created text object.
    +    */
    +    audio: function (key, volume, loop, connect) {
    +
    +        return this.game.sound.add(key, volume, loop, connect);
    +        
    +    },
    +
    +    /**
    +    * Creates a new Sound object.
    +    *
    +    * @method Phaser.GameObjectCreator#sound
    +    * @param {string} key - The Game.cache key of the sound that this object will use.
    +    * @param {number} [volume=1] - The volume at which the sound will be played.
    +    * @param {boolean} [loop=false] - Whether or not the sound will loop.
    +    * @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.
    +    * @return {Phaser.Sound} The newly created text object.
    +    */
    +    sound: function (key, volume, loop, connect) {
    +
    +        return this.game.sound.add(key, volume, loop, connect);
    +        
    +    },
    +
    +    /**
    +    * Creates a new TileSprite object.
    +    *
    +    * @method Phaser.GameObjectCreator#tileSprite
    +    * @param {number} x - The x coordinate (in world space) to position the TileSprite at.
    +    * @param {number} y - The y coordinate (in world space) to position the TileSprite at.
    +    * @param {number} width - The width of the TileSprite.
    +    * @param {number} height - The height of the TileSprite.
    +    * @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the TileSprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    +    * @param {string|number} frame - If this TileSprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
    +    * @return {Phaser.TileSprite} The newly created tileSprite object.
    +    */
    +    tileSprite: function (x, y, width, height, key, frame) {
    +
    +        return new Phaser.TileSprite(this.game, x, y, width, height, key, frame);
    +
    +    },
    +
    +    /**
    +    * Creates a new Text object.
    +    *
    +    * @method Phaser.GameObjectCreator#text
    +    * @param {number} x - X position of the new text object.
    +    * @param {number} y - Y position of the new text object.
    +    * @param {string} text - The actual text that will be written.
    +    * @param {object} style - The style object containing style attributes like font, font size , etc.
    +    * @return {Phaser.Text} The newly created text object.
    +    */
    +    text: function (x, y, text, style, group) {
    +
    +        return new Phaser.Text(this.game, x, y, text, style);
    +
    +    },
    +
    +    /**
    +    * Creates a new Button object.
    +    *
    +    * @method Phaser.GameObjectCreator#button
    +    * @param {number} [x] X position of the new button object.
    +    * @param {number} [y] Y position of the new button object.
    +    * @param {string} [key] The image key as defined in the Game.Cache to use as the texture for this button.
    +    * @param {function} [callback] The function to call when this button is pressed
    +    * @param {object} [callbackContext] The context in which the callback will be called (usually 'this')
    +    * @param {string|number} [overFrame] This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.
    +    * @param {string|number} [outFrame] This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.
    +    * @param {string|number} [downFrame] This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
    +    * @param {string|number} [upFrame] This is the frame or frameName that will be set when this button is in an up state. Give either a number to use a frame ID or a string for a frame name.
    +    * @return {Phaser.Button} The newly created button object.
    +    */
    +    button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame, group) {
    +
    +        return new Phaser.Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame);
    +
    +    },
    +
    +    /**
    +    * Creates a new Graphics object.
    +    *
    +    * @method Phaser.GameObjectCreator#graphics
    +    * @param {number} x - X position of the new graphics object.
    +    * @param {number} y - Y position of the new graphics object.
    +    * @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
    +    * @return {Phaser.Graphics} The newly created graphics object.
    +    */
    +    graphics: function (x, y, group) {
    +
    +        return new Phaser.Graphics(this.game, x, y);
    +
    +    },
    +
    +    /**
    +    * Emitter is a lightweight particle emitter. It can be used for one-time explosions or for
    +    * continuous effects like rain and fire. All it really does is launch Particle objects out
    +    * at set intervals, and fixes their positions and velocities accorindgly.
    +    *
    +    * @method Phaser.GameObjectCreator#emitter
    +    * @param {number} [x=0] - The x coordinate within the Emitter that the particles are emitted from.
    +    * @param {number} [y=0] - The y coordinate within the Emitter that the particles are emitted from.
    +    * @param {number} [maxParticles=50] - The total number of particles in this emitter.
    +    * @return {Phaser.Emitter} The newly created emitter object.
    +    */
    +    emitter: function (x, y, maxParticles) {
    +
    +        return new Phaser.Particles.Arcade.Emitter(this.game, x, y, maxParticles);
    +
    +    },
    +
    +    /**
    +    * Create a new BitmapFont object to be used as a texture for an Image or Sprite and optionally add it to the Cache.
    +    * The texture can be asssigned or one or multiple images/sprites, but note that the text the BitmapFont uses will be shared across them all, 
    +    * i.e. if you need each Image to have different text in it, then you need to create multiple BitmapFont objects.
    +    *
    +    * @method Phaser.GameObjectCreator#bitmapFont
    +    * @param {string} font - The key of the image in the Game.Cache that the BitmapFont will use.
    +    * @param {number} characterWidth - The width of each character in the font set.
    +    * @param {number} characterHeight - The height of each character in the font set.
    +    * @param {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.
    +    * @param {number} charsPerRow - The number of characters per row in the font set.
    +    * @param {number} [xSpacing=0] - If the characters in the font set have horizontal spacing between them set the required amount here.
    +    * @param {number} [ySpacing=0] - If the characters in the font set have vertical spacing between them set the required amount here.
    +    * @param {number} [xOffset=0] - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.
    +    * @param {number} [yOffset=0] - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.
    +    * @return {Phaser.BitmapFont} The newly created BitmapFont texture which can be applied to an Image or Sprite.
    +    */
    +    bitmapFont: function (font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset) {
    +
    +        return new Phaser.BitmapFont(this.game, font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset);
    +
    +    },
    +
    +    /**
    +    * Create a new BitmapText object.
    +    *
    +    * @method Phaser.GameObjectCreator#bitmapText
    +    * @param {number} x - X position of the new bitmapText object.
    +    * @param {number} y - Y position of the new bitmapText object.
    +    * @param {string} font - The key of the BitmapText font as stored in Game.Cache.
    +    * @param {string} [text] - The actual text that will be rendered. Can be set later via BitmapText.text.
    +    * @param {number} [size] - The size the font will be rendered in, in pixels.
    +    * @return {Phaser.BitmapText} The newly created bitmapText object.
    +    */
    +    bitmapText: function (x, y, font, text, size, group) {
    +
    +        return new Phaser.BitmapText(this.game, x, y, font, text, size);
    +
    +    },
    +
    +    /**
    +    * Creates a new Tilemap object.
    +    *
    +    * @method Phaser.GameObjectCreator#tilemap
    +    * @param {string} key - Asset key for the JSON or CSV map data in the cache.
    +    * @param {object|string} tilesets - An object mapping Cache.tileset keys with the tileset names in the JSON file. If a string is provided that will be used.
    +    * @return {Phaser.Tilemap} The newly created tilemap object.
    +    */
    +    tilemap: function (key, tilesets) {
    +
    +        return new Phaser.Tilemap(this.game, key, tilesets);
    +
    +    },
    +
    +    /**
    +    * A dynamic initially blank canvas to which images can be drawn.
    +    *
    +    * @method Phaser.GameObjectCreator#renderTexture
    +    * @param {number} [width=100] - the width of the RenderTexture.
    +    * @param {number} [height=100] - the height of the RenderTexture.
    +    * @param {string} [key=''] - Asset key for the RenderTexture when stored in the Cache (see addToCache parameter).
    +    * @param {boolean} [addToCache=false] - Should this RenderTexture be added to the Game.Cache? If so you can retrieve it with Cache.getTexture(key)
    +    * @return {Phaser.RenderTexture} The newly created RenderTexture object.
    +    */
    +    renderTexture: function (width, height, key, addToCache) {
    +
    +        if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); }
    +        if (typeof addToCache === 'undefined') { addToCache = false; }
    +
    +        var texture = new Phaser.RenderTexture(this.game, width, height, key);
    +
    +        if (addToCache)
    +        {
    +            this.game.cache.addRenderTexture(key, texture);
    +        }
    +
    +        return texture;
    +
    +    },
    +
    +    /**
    +    * A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites.
    +    *
    +    * @method Phaser.GameObjectCreator#bitmapData
    +    * @param {number} [width=100] - The width of the BitmapData in pixels.
    +    * @param {number} [height=100] - The height of the BitmapData in pixels.
    +    * @param {string} [key=''] - Asset key for the BitmapData when stored in the Cache (see addToCache parameter).
    +    * @param {boolean} [addToCache=false] - Should this BitmapData be added to the Game.Cache? If so you can retrieve it with Cache.getBitmapData(key)
    +    * @return {Phaser.BitmapData} The newly created BitmapData object.
    +    */
    +    bitmapData: function (width, height, addToCache) {
    +
    +        if (typeof addToCache === 'undefined') { addToCache = false; }
    +        if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); }
    +
    +        var texture = new Phaser.BitmapData(this.game, key, width, height);
    +
    +        if (addToCache)
    +        {
    +            this.game.cache.addBitmapData(key, texture);
    +        }
    +
    +        return texture;
    +
    +    },
    +
    +    /**
    +    * A WebGL shader/filter that can be applied to Sprites.
    +    *
    +    * @method Phaser.GameObjectCreator#filter
    +    * @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 filter = new Phaser.Filter[filter](this.game);
    +
    +        filter.init.apply(filter, args);
    +
    +        return filter;
    +
    +    }
    +
    +};
    +
    +Phaser.GameObjectCreator.prototype.constructor = Phaser.GameObjectCreator;
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/GameObjectFactory.js.html b/docs/GameObjectFactory.js.html index 8ec199336..4be9f92ab 100644 --- a/docs/GameObjectFactory.js.html +++ b/docs/GameObjectFactory.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -538,7 +574,7 @@ Phaser.GameObjectFactory.prototype = { * * @method Phaser.GameObjectFactory#tween * @param {object} obj - Object the tween will be run on. - * @return {Phaser.Tween} Description. + * @return {Phaser.Tween} The newly created Phaser.Tween object. */ tween: function (obj) { @@ -550,7 +586,7 @@ Phaser.GameObjectFactory.prototype = { * A Group is a container for display objects that allows for fast pooling, recycling and collision checks. * * @method Phaser.GameObjectFactory#group - * @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any. + * @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default. * @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging. * @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World. * @return {Phaser.Group} The newly created group. @@ -865,7 +901,7 @@ Phaser.GameObjectFactory.prototype.constructor = Phaser.GameObjectFactory; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Gamepad.js.html b/docs/Gamepad.js.html index 0372625be..f91ec7410 100644 --- a/docs/Gamepad.js.html +++ b/docs/Gamepad.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1052,7 +1088,7 @@ Phaser.Gamepad.XBOX360_STICK_RIGHT_Y = 3; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/GamepadButton.js.html b/docs/GamepadButton.js.html index 0f18f110f..95ab22415 100644 --- a/docs/GamepadButton.js.html +++ b/docs/GamepadButton.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -649,7 +685,7 @@ Phaser.GamepadButton.prototype.constructor = Phaser.GamepadButton; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Graphics.js.html b/docs/Graphics.js.html index 45f6bcadb..5b335934d 100644 --- a/docs/Graphics.js.html +++ b/docs/Graphics.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -592,7 +628,7 @@ Phaser.Graphics.prototype.postUpdate = function () { /** * Destroy this Graphics instance. * -* @method Phaser.Sprite.prototype.destroy +* @method Phaser.Graphics.prototype.destroy */ Phaser.Graphics.prototype.destroy = function() { @@ -613,7 +649,7 @@ Phaser.Graphics.prototype.destroy = function() { /* * Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled * -* @method Phaser.Sprite.prototype.drawPolygon +* @method Phaser.Graphics.prototype.drawPolygon */ Phaser.Graphics.prototype.drawPolygon = function (poly) { @@ -698,7 +734,7 @@ Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Group.js.html b/docs/Group.js.html index a4af10e40..cb6dbd757 100644 --- a/docs/Group.js.html +++ b/docs/Group.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -465,18 +501,20 @@ * @classdesc A Group is a container for display objects that allows for fast pooling and object recycling. Groups can be nested within other Groups and have their own local transforms. * @constructor * @param {Phaser.Game} game - A reference to the currently running game. -* @param {Phaser.Group|Phaser.Sprite} parent - The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If undefined or null it will use game.world. +* @param {Phaser.Group|Phaser.Sprite|null} parent - The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If undefined it will use game.world. If null it won't be added to anything. * @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging. * @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World. */ Phaser.Group = function (game, parent, name, addToStage) { + if (typeof addToStage === 'undefined') { addToStage = false; } + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - if (typeof parent === 'undefined' || parent === null) + if (typeof parent === 'undefined') { parent = game.world; } @@ -488,20 +526,16 @@ Phaser.Group = function (game, parent, name, addToStage) { PIXI.DisplayObjectContainer.call(this); - if (typeof addToStage === 'undefined' || addToStage === false) + if (addToStage) + { + this.game.stage.addChild(this); + } + else { if (parent) { parent.addChild(this); } - else - { - this.game.stage.addChild(this); - } - } - else - { - this.game.stage.addChild(this); } /** @@ -1272,11 +1306,11 @@ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExist } /** -* Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. +* Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. -* For example: Group.forEachAlive(causeDamage, this, 500) +* For example: Group.forEachExists(causeDamage, this, 500) * -* @method Phaser.Group#forEachAlive +* @method Phaser.Group#forEachExists * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). */ @@ -1602,7 +1636,7 @@ Phaser.Group.prototype.destroy = function (destroyChildren) { { do { - if (this.children[0].group) + if (this.children[0].parent) { this.children[0].destroy(); } @@ -1757,7 +1791,7 @@ Object.defineProperty(Phaser.Group.prototype, "fixedToCamera", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Image.js.html b/docs/Image.js.html index 2155d293a..9a66294a0 100644 --- a/docs/Image.js.html +++ b/docs/Image.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -824,11 +860,6 @@ Phaser.Image.prototype.kill = function() { */ Phaser.Image.prototype.destroy = function() { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); @@ -844,10 +875,19 @@ Phaser.Image.prototype.destroy = function() { this.input.destroy(); } + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.alive = false; this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; } @@ -1170,7 +1210,7 @@ Object.defineProperty(Phaser.Image.prototype, "fixedToCamera", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Input.js.html b/docs/Input.js.html index 6e41bd8c8..ffb168cf2 100644 --- a/docs/Input.js.html +++ b/docs/Input.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1350,7 +1386,7 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/InputHandler.js.html b/docs/InputHandler.js.html index 1255fb6d4..89a7aab2f 100644 --- a/docs/InputHandler.js.html +++ b/docs/InputHandler.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -945,9 +981,9 @@ Phaser.InputHandler.prototype = { /** * Is this sprite being dragged by the mouse or not? - * @method Phaser.InputHandler#pointerTimeOut + * @method Phaser.InputHandler#pointerDragged * @param {Phaser.Pointer} pointer - * @return {number} + * @return {boolean} True if the pointer is dragging an object, otherwise false. */ pointerDragged: function (pointer) { @@ -961,7 +997,7 @@ Phaser.InputHandler.prototype = { * Checks if the given pointer is over this Sprite and can click it. * @method Phaser.InputHandler#checkPointerDown * @param {Phaser.Pointer} pointer - * @return {boolean} + * @return {boolean} True if the pointer is down, otherwise false. */ checkPointerDown: function (pointer) { @@ -1083,7 +1119,7 @@ Phaser.InputHandler.prototype = { return; } - if (this.enabled === false || this.sprite.visible === false || (this.sprite.group && this.sprite.group.visible === false)) + if (!this.enabled || !this.sprite.visible || !this.sprite.parent.visible) { this._pointerOutHandler(pointer); return false; @@ -1758,7 +1794,7 @@ Phaser.InputHandler.prototype.constructor = Phaser.InputHandler; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/InversePointProxy.js.html b/docs/InversePointProxy.js.html new file mode 100644 index 000000000..1d2676cb7 --- /dev/null +++ b/docs/InversePointProxy.js.html @@ -0,0 +1,616 @@ + + + + + + Phaser Source: physics/InversePointProxy.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: physics/InversePointProxy.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2014 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* A InversePointProxy is an internal class that allows for direct getter/setter style property access to Arrays and TypedArrays but inverses the values on set.
    +*
    +* @class Phaser.Physics.InversePointProxy
    +* @classdesc InversePointProxy
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the Phaser.Game instance.
    +* @param {any} destination - The object to bind to.
    +*/
    +Phaser.Physics.InversePointProxy = function (game, destination) {
    +
    +    this.game = game;
    +	this.destination = destination;
    +
    +};
    +
    +Phaser.Physics.InversePointProxy.prototype.constructor = Phaser.Physics.InversePointProxy;
    +
    +/**
    +* @name Phaser.Physics.InversePointProxy#x
    +* @property {number} x - The x property of this InversePointProxy.
    +*/
    +Object.defineProperty(Phaser.Physics.InversePointProxy.prototype, "x", {
    +    
    +    get: function () {
    +
    +        return this.destination[0];
    +
    +    },
    +
    +    set: function (value) {
    +
    +        this.destination[0] = this.game.math.px2p(-value);
    +
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.Physics.InversePointProxy#y
    +* @property {number} y - The y property of this InversePointProxy.
    +*/
    +Object.defineProperty(Phaser.Physics.InversePointProxy.prototype, "y", {
    +    
    +    get: function () {
    +
    +        return this.destination[1];
    +
    +    },
    +
    +    set: function (value) {
    +
    +        this.destination[1] = this.game.math.px2p(-value);
    +
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Key.js.html b/docs/Key.js.html index 4b513938f..228cda7a4 100644 --- a/docs/Key.js.html +++ b/docs/Key.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -647,7 +683,7 @@ Phaser.Key.prototype.constructor = Phaser.Key; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Keyboard.js.html b/docs/Keyboard.js.html index e9cee97f6..672751ff5 100644 --- a/docs/Keyboard.js.html +++ b/docs/Keyboard.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -971,7 +1007,7 @@ Phaser.Keyboard.NUM_LOCK = 144; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Line.js.html b/docs/Line.js.html index 9bac1d752..38f812aaa 100644 --- a/docs/Line.js.html +++ b/docs/Line.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -641,7 +677,7 @@ Object.defineProperty(Phaser.Line.prototype, "perpSlope", { * Returns the intersection segment of AB and EF as a Point, or null if there is no intersection. * Adapted from code by Keith Hair * -* @method Phaser.Line.intersects +* @method Phaser.Line.intersectsPoints * @param {Phaser.Point} a - The start of the first Line to be checked. * @param {Phaser.Point} b - The end of the first line to be checked. * @param {Phaser.Point} e - The start of the second Line to be checked. @@ -738,7 +774,7 @@ Phaser.Line.intersects = function (a, b, asSegment, result) { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/LinkedList.js.html b/docs/LinkedList.js.html index 534518f1f..09967842c 100644 --- a/docs/LinkedList.js.html +++ b/docs/LinkedList.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -630,7 +666,7 @@ Phaser.LinkedList.prototype.constructor = Phaser.LinkedList; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Loader.js.html b/docs/Loader.js.html index e586a57ac..68302b3c9 100644 --- a/docs/Loader.js.html +++ b/docs/Loader.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1849,7 +1885,7 @@ Phaser.Loader.prototype.constructor = Phaser.Loader; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/LoaderParser.js.html b/docs/LoaderParser.js.html index cee4d3c9d..e8f7a48d1 100644 --- a/docs/LoaderParser.js.html +++ b/docs/LoaderParser.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -558,7 +594,7 @@ Phaser.LoaderParser = { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/MSPointer.js.html b/docs/MSPointer.js.html index 9c52fbe1a..a081c04d2 100644 --- a/docs/MSPointer.js.html +++ b/docs/MSPointer.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -644,7 +680,7 @@ Phaser.MSPointer.prototype.constructor = Phaser.MSPointer; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Material.js.html b/docs/Material.js.html new file mode 100644 index 000000000..33160a2ed --- /dev/null +++ b/docs/Material.js.html @@ -0,0 +1,580 @@ + + + + + + Phaser Source: physics/Material.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: physics/Material.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2014 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* \o/ ~ "Because I'm a Material girl"
    +*
    +* @class Phaser.Physics.Material
    +* @classdesc Physics Material Constructor
    +* @constructor
    +*/
    +Phaser.Physics.Material = function (name) {
    +
    +    /**
    +    * @property {string} name - The user defined name given to this Material.
    +    * @default
    +    */
    +    this.name = name;
    +
    +    p2.Material.call(this);
    +
    +}
    +
    +Phaser.Physics.Material.prototype = Object.create(p2.Material.prototype);
    +Phaser.Physics.Material.prototype.constructor = Phaser.Physics.Material;
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Math.js.html b/docs/Math.js.html index a82f5093f..9103d3c28 100644 --- a/docs/Math.js.html +++ b/docs/Math.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -487,7 +523,7 @@ Phaser.Math = { /** * a is fuzzyLessThan b if it is less than b + ε. - * @method Phaser.Math#fuzzyEqual + * @method Phaser.Math#fuzzyLessThan * @param {number} a * @param {number} b * @param {number} epsilon @@ -1265,7 +1301,6 @@ Phaser.Math = { * @param {number} angle - The angle value to check. Must be between -180 and +180. * @param {number} min - The minimum angle that is allowed (must be -180 or greater). * @param {number} max - The maximum angle that is allowed (must be 180 or less). - * * @return {number} The new angle value, returns the same as the input angle if it was within bounds */ angleLimit: function (angle, min, max) { @@ -1754,7 +1789,9 @@ Phaser.Math = { * @return {number} The scaled value. */ p2px: function (v) { - return v *= -20; + + return v *= 20; + }, /** @@ -1765,7 +1802,35 @@ Phaser.Math = { * @return {number} The scaled value. */ px2p: function (v) { + + return v * 0.05; + + }, + + /** + * Convert p2 physics value (meters) to pixel scale and inverses it. + * + * @method Phaser.Math#p2pxi + * @param {number} v - The value to convert. + * @return {number} The scaled value. + */ + p2pxi: function (v) { + + return v *= -20; + + }, + + /** + * Convert pixel value to p2 physics scale (meters) and inverses it. + * + * @method Phaser.Math#px2pi + * @param {number} v - The value to convert. + * @return {number} The scaled value. + */ + px2pi: function (v) { + return v * -0.05; + }, /** @@ -1826,7 +1891,7 @@ Phaser.Math = { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Mouse.js.html b/docs/Mouse.js.html index 700740cf3..f153fc58e 100644 --- a/docs/Mouse.js.html +++ b/docs/Mouse.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -805,7 +841,7 @@ Phaser.Mouse.prototype.constructor = Phaser.Mouse; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Net.js.html b/docs/Net.js.html index 47ade9b0f..f0e00fcba 100644 --- a/docs/Net.js.html +++ b/docs/Net.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -640,7 +676,7 @@ Phaser.Net.prototype.constructor = Phaser.Net; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Particles.js.html b/docs/Particles.js.html index 52f52544b..51ef760a3 100644 --- a/docs/Particles.js.html +++ b/docs/Particles.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -555,7 +591,7 @@ Phaser.Particles.prototype.constructor = Phaser.Particles; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Animation.html b/docs/Phaser.Animation.html index 3a2e16102..f17dbc500 100644 --- a/docs/Phaser.Animation.html +++ b/docs/Phaser.Animation.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2950,7 +2986,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:21 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.AnimationManager.html b/docs/Phaser.AnimationManager.html index 8db1ad635..4159d7935 100644 --- a/docs/Phaser.AnimationManager.html +++ b/docs/Phaser.AnimationManager.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2997,7 +3033,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:21 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.AnimationParser.html b/docs/Phaser.AnimationParser.html index e9774482e..889c8af86 100644 --- a/docs/Phaser.AnimationParser.html +++ b/docs/Phaser.AnimationParser.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1518,7 +1554,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:21 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.BitmapData.html b/docs/Phaser.BitmapData.html index 2c2eab7a8..fda23b649 100644 --- a/docs/Phaser.BitmapData.html +++ b/docs/Phaser.BitmapData.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2074,7 +2110,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if
    -

    Updates the given objects so that they use this BitmapData as their texture.

    +

    Updates the given objects so that they use this BitmapData as their texture. This will replace any texture they will currently have set.

    @@ -2188,6 +2224,153 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if + + + + +
    +

    alphaMask(source, mask)

    + + +
    +
    + + +
    +

    Draws the given image onto this BitmapData using an image as an alpha mask.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    source + + +HTMLImage +| + +string + + + +

    The Image to draw. If you give a key it will try and find the Image in the Game.Cache.

    mask + + +HTMLImage +| + +string + + + +

    The Image to use as the alpha mask. If you give a key it will try and find the Image in the Game.Cache.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + +
    @@ -2257,6 +2440,363 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if + + + + +
    +

    copyPixels(source, area, destX, destY)

    + + +
    +
    + + +
    +

    Copies the pixels from the source image to this BitmapData based on the given area and destination.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    source + + +HTMLImage +| + +string + + + +

    The Image to draw. If you give a key it will try and find the Image in the Game.Cache.

    area + + +Phaser.Rectangle + + + +

    The Rectangle region to copy from the source image.

    destX + + +number + + + +

    The destination x coordinate to copy the image to.

    destY + + +number + + + +

    The destination y coordinate to copy the image to.

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

    draw(source, destX, destY)

    + + +
    +
    + + +
    +

    Draws the given image to this BitmapData at the coordinates specified. If you need to only draw a part of the image use BitmapData.copyPixels instead.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    source + + +HTMLImage +| + +string + + + +

    The Image to draw. If you give a key it will try and find the Image in the Game.Cache.

    destX + + +number + + + +

    The destination x coordinate to draw the image to.

    destY + + +number + + + +

    The destination y coordinate to draw the image to.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + +
    @@ -2270,7 +2810,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if
    -

    Get a color of a specific pixel.

    +

    Get the color of a specific pixel.

    @@ -2375,7 +2915,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if
    Source:
    @@ -2434,7 +2974,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if
    -

    Get a color of a specific pixel (including alpha value).

    +

    Get the color of a specific pixel including its alpha value.

    @@ -2539,7 +3079,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if
    Source:
    @@ -2598,7 +3138,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if
    -

    Get pixels in array in a specific Rectangle.

    +

    Gets all the pixels from the region specified by the given Rectangle object.

    @@ -2638,7 +3178,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if -Rectangle +Phaser.Rectangle @@ -2648,7 +3188,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if -

    The specific Rectangle.

    +

    The Rectangle region to get.

    @@ -2680,7 +3220,7 @@ A single BitmapData can be used as the texture one or many Images/Sprites. So if
    Source:
    @@ -2838,7 +3378,7 @@ This is called automatically if the BitmapData is being used by a Sprite, otherw
    Source:
    @@ -3401,7 +3941,7 @@ This is called automatically if the BitmapData is being used by a Sprite, otherw Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:22 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.BitmapFont.html b/docs/Phaser.BitmapFont.html index d0b991b58..33300a0c2 100644 --- a/docs/Phaser.BitmapFont.html +++ b/docs/Phaser.BitmapFont.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -4121,6 +4157,391 @@ Used by getLine and getMultiLine

    + + + + +
    +

    render(displayObject, position, clear)

    + + +
    +
    + + +
    +

    This function will draw the display object to the texture.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    displayObject + + +Phaser.Sprite +| + +Phaser.Image +| + +Phaser.Text +| + +Phaser.BitmapText +| + +Phaser.Group + + + +

    The display object to render to this texture.

    position + + +Phaser.Point + + + +

    A Point object containing the position to render the display object at.

    clear + + +boolean + + + +

    If true the texture will be cleared before the display object is drawn.

    + + + + +
    + + + + + + + +
    Inherited From:
    +
    + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    renderXY(displayObject, x, y, clear)

    + + +
    +
    + + +
    +

    This function will draw the display object to the texture.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    displayObject + + +Phaser.Sprite +| + +Phaser.Image +| + +Phaser.Text +| + +Phaser.BitmapText +| + +Phaser.Group + + + +

    The display object to render to this texture.

    x + + +number + + + +

    The x position to render the object at.

    y + + +number + + + +

    The y position to render the object at.

    clear + + +boolean + + + +

    If true the texture will be cleared before the display object is drawn.

    + + + + +
    + + + + + + + +
    Inherited From:
    +
    + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + +
    @@ -4721,7 +5142,7 @@ If text is wider than the width specified it will be cropped off.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:22 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.BitmapText.html b/docs/Phaser.BitmapText.html index ea2259288..3201ebe83 100644 --- a/docs/Phaser.BitmapText.html +++ b/docs/Phaser.BitmapText.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -890,7 +926,7 @@ For Web there is the great Littera: http:/
    Source:
    @@ -998,7 +1034,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -1415,7 +1451,7 @@ So if this BitmapText was in a Group that has x: 200, then this will be added to
    Source:
    @@ -1517,7 +1553,7 @@ So if this BitmapText was in a Group that has x: 200, then this will be added to
    Source:
    @@ -1619,7 +1655,7 @@ So if this BitmapText was in a Group that has x: 200, then this will be added to
    Source:
    @@ -1933,7 +1969,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2243,7 +2279,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2345,7 +2381,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2580,6 +2616,10 @@ activated for this object and it will then start to process click/touch events a
    +
    +

    Destroy this BitmapText instance. This will remove any filters and un-parent any children.

    +
    + @@ -2610,7 +2650,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2679,7 +2719,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2868,7 +2908,7 @@ activated for this object and it will then start to process click/touch events a Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:22 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Button.html b/docs/Phaser.Button.html index d9d164b31..1ed147da7 100644 --- a/docs/Phaser.Button.html +++ b/docs/Phaser.Button.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1073,7 +1109,7 @@ If you wish to work in radians instead of degrees use the property Image.rotatio
    Source:
    @@ -1407,7 +1443,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1518,7 +1554,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1629,7 +1665,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1959,7 +1995,7 @@ So if this Image was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2175,7 +2211,7 @@ So if this Image was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2282,7 +2318,7 @@ So if this Image was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2602,7 +2638,7 @@ So if this Image was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2824,7 +2860,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2935,7 +2971,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -4501,7 +4537,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -4781,7 +4817,7 @@ bought to the top of that Group, not the entire display list.

    Source:
    @@ -5359,7 +5395,7 @@ This causes a WebGL texture update, so use sparingly or in low-intensity portion
    -

    <protected> onInputOverHandler(sprite, pointer)

    +

    <protected> onInputDownHandler(sprite, pointer)

    @@ -5472,7 +5508,7 @@ This causes a WebGL texture update, so use sparingly or in low-intensity portion
    Source:
    @@ -5500,7 +5536,7 @@ This causes a WebGL texture update, so use sparingly or in low-intensity portion
    -

    <protected> onInputOverHandler(sprite, pointer)

    +

    <protected> onInputOutHandler(sprite, pointer)

    @@ -5754,7 +5790,7 @@ This causes a WebGL texture update, so use sparingly or in low-intensity portion
    Source:
    @@ -5782,7 +5818,7 @@ This causes a WebGL texture update, so use sparingly or in low-intensity portion
    -

    <protected> onInputOverHandler(sprite, pointer)

    +

    <protected> onInputUpHandler(sprite, pointer)

    @@ -6189,7 +6225,7 @@ This causes a WebGL texture update, so use sparingly or in low-intensity portion
    Source:
    @@ -7802,7 +7838,7 @@ Call this function with no parameters at all to reset all sounds on this Button. Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:22 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Cache.html b/docs/Phaser.Cache.html index 7415058b7..5eb87d316 100644 --- a/docs/Phaser.Cache.html +++ b/docs/Phaser.Cache.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -8959,7 +8995,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:22 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Camera.html b/docs/Phaser.Camera.html index 1df746286..f5f06e610 100644 --- a/docs/Phaser.Camera.html +++ b/docs/Phaser.Camera.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -3536,7 +3572,7 @@ without having to use game.camera.x and game.camera.y.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:23 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Canvas.html b/docs/Phaser.Canvas.html index 2474082f1..fa9f77b6f 100644 --- a/docs/Phaser.Canvas.html +++ b/docs/Phaser.Canvas.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2662,7 +2698,7 @@ patchy on earlier browsers, especially on mobile.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:23 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Circle.html b/docs/Phaser.Circle.html index dac06c5e9..606e11d1b 100644 --- a/docs/Phaser.Circle.html +++ b/docs/Phaser.Circle.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -4340,7 +4376,7 @@ This method checks the radius distances between the two Circle objects to see if Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:23 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Color.html b/docs/Phaser.Color.html index 99ed31148..a4f0e04ce 100644 --- a/docs/Phaser.Color.html +++ b/docs/Phaser.Color.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -3649,7 +3685,7 @@ Set the max value to restrict the maximum color used per channel.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:23 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Device.html b/docs/Phaser.Device.html index e96cb6c77..40bf86385 100644 --- a/docs/Phaser.Device.html +++ b/docs/Phaser.Device.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -6075,7 +6111,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:23 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Back.html b/docs/Phaser.Easing.Back.html index 3fc4763d6..62c314447 100644 --- a/docs/Phaser.Easing.Back.html +++ b/docs/Phaser.Easing.Back.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Bounce.html b/docs/Phaser.Easing.Bounce.html index 3e9aa7d43..6e5d55bbe 100644 --- a/docs/Phaser.Easing.Bounce.html +++ b/docs/Phaser.Easing.Bounce.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Circular.html b/docs/Phaser.Easing.Circular.html index bf5183609..00ed68f4c 100644 --- a/docs/Phaser.Easing.Circular.html +++ b/docs/Phaser.Easing.Circular.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Cubic.html b/docs/Phaser.Easing.Cubic.html index 0bc7ee123..de949020e 100644 --- a/docs/Phaser.Easing.Cubic.html +++ b/docs/Phaser.Easing.Cubic.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Elastic.html b/docs/Phaser.Easing.Elastic.html index deddec262..dd5767415 100644 --- a/docs/Phaser.Easing.Elastic.html +++ b/docs/Phaser.Easing.Elastic.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Exponential.html b/docs/Phaser.Easing.Exponential.html index 344b74578..45c14e655 100644 --- a/docs/Phaser.Easing.Exponential.html +++ b/docs/Phaser.Easing.Exponential.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Linear.html b/docs/Phaser.Easing.Linear.html index 98654d258..4e57b3d03 100644 --- a/docs/Phaser.Easing.Linear.html +++ b/docs/Phaser.Easing.Linear.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -719,7 +755,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quadratic.html b/docs/Phaser.Easing.Quadratic.html index c7a8e9b17..f78d7388d 100644 --- a/docs/Phaser.Easing.Quadratic.html +++ b/docs/Phaser.Easing.Quadratic.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quartic.html b/docs/Phaser.Easing.Quartic.html index c7f99b0f0..4a34dab2a 100644 --- a/docs/Phaser.Easing.Quartic.html +++ b/docs/Phaser.Easing.Quartic.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:24 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quintic.html b/docs/Phaser.Easing.Quintic.html index 2bc4db6d4..a81af0e9a 100644 --- a/docs/Phaser.Easing.Quintic.html +++ b/docs/Phaser.Easing.Quintic.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:25 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Sinusoidal.html b/docs/Phaser.Easing.Sinusoidal.html index 95027f03c..ff0003061 100644 --- a/docs/Phaser.Easing.Sinusoidal.html +++ b/docs/Phaser.Easing.Sinusoidal.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1001,7 +1037,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:25 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.html b/docs/Phaser.Easing.html index 42de6dfd4..cf176139d 100644 --- a/docs/Phaser.Easing.html +++ b/docs/Phaser.Easing.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -611,7 +647,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:23 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Ellipse.html b/docs/Phaser.Ellipse.html index 470766b0d..cda99152f 100644 --- a/docs/Phaser.Ellipse.html +++ b/docs/Phaser.Ellipse.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2756,7 +2792,7 @@ If set to true it will reset all of the Ellipse objects properties to 0. An Elli Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:25 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Events.html b/docs/Phaser.Events.html index d4da03b53..404b7863b 100644 --- a/docs/Phaser.Events.html +++ b/docs/Phaser.Events.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -625,7 +661,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:25 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Filter.html b/docs/Phaser.Filter.html index 3460d9bb3..f975ddf0d 100644 --- a/docs/Phaser.Filter.html +++ b/docs/Phaser.Filter.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1910,7 +1946,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:25 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Frame.html b/docs/Phaser.Frame.html index 2bd23887f..24f17f94b 100644 --- a/docs/Phaser.Frame.html +++ b/docs/Phaser.Frame.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -3139,7 +3175,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:25 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.FrameData.html b/docs/Phaser.FrameData.html index 4bea63a3c..7291c13fc 100644 --- a/docs/Phaser.FrameData.html +++ b/docs/Phaser.FrameData.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1933,7 +1969,7 @@ The frames are returned in the output array, or if none is provided in a new Arr Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:25 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Game.html b/docs/Phaser.Game.html index 949b6d3b5..7dacceb96 100644 --- a/docs/Phaser.Game.html +++ b/docs/Phaser.Game.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -959,7 +995,7 @@ providing quick access to common functions and handling the boot process. -

    Reference to the GameObject Factory.

    +

    Reference to the Phaser.GameObjectFactory.

    @@ -1198,7 +1234,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -1300,7 +1336,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -1402,7 +1438,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -1606,7 +1642,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -1708,7 +1744,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -1810,7 +1846,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -2122,7 +2158,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -2437,7 +2473,109 @@ providing quick access to common functions and handling the boot process.
    Source:
    + + + + + + + + + + + + + + + +
    +

    make

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    make + + +Phaser.GameObjectCreator + + + +

    Reference to the GameObject Creator.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -2539,7 +2677,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -2641,7 +2779,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -2845,7 +2983,7 @@ providing quick access to common functions and handling the boot process.
    Source:
    @@ -2952,7 +3090,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -3057,7 +3195,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -3120,7 +3258,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on -Phaser.Physics.World +Phaser.Physics.World @@ -3159,7 +3297,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -3669,7 +3807,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -3771,7 +3909,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -3873,7 +4011,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -3975,7 +4113,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4182,7 +4320,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4287,7 +4425,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4389,7 +4527,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4596,7 +4734,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4803,7 +4941,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4868,7 +5006,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -4937,7 +5075,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -5006,7 +5144,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
    Source:
    @@ -5076,7 +5214,7 @@ Calling step will advance the game loop by one frame. This is extremely useful t
    Source:
    @@ -5145,7 +5283,7 @@ Calling step will advance the game loop by one frame. This is extremely useful t
    Source:
    @@ -5214,7 +5352,7 @@ Calling step will advance the game loop by one frame. This is extremely useful t
    Source:
    @@ -5283,7 +5421,7 @@ Calling step will advance the game loop by one frame. This is extremely useful t
    Source:
    @@ -5352,7 +5490,7 @@ Calling step will advance the game loop by one frame. This is extremely useful t
    Source:
    @@ -5421,7 +5559,7 @@ Calling step will advance the game loop by one frame. This is extremely useful t
    Source:
    @@ -5491,7 +5629,7 @@ This is extremely useful to hard to track down errors! Use the internal stepCoun
    Source:
    @@ -5609,7 +5747,7 @@ This is extremely useful to hard to track down errors! Use the internal stepCoun
    Source:
    @@ -5660,7 +5798,7 @@ This is extremely useful to hard to track down errors! Use the internal stepCoun Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:25 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.GameObjectCreator.html b/docs/Phaser.GameObjectCreator.html new file mode 100644 index 000000000..445486d76 --- /dev/null +++ b/docs/Phaser.GameObjectCreator.html @@ -0,0 +1,5577 @@ + + + + + + Phaser Class: GameObjectCreator + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: GameObjectCreator

    +
    + +
    +

    + Phaser. + + GameObjectCreator +

    + +

    Phaser.GameObjectCreator

    + +
    + +
    +
    + + + + +
    +

    new GameObjectCreator(game)

    + + +
    +
    + + +
    +

    The Game Object Creator is a quick way to create all of the different sorts of core objects that Phaser uses, but not add them to the game world. +Use the GameObjectFactory to create and add the objects into the world.

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

    A reference to the currently running game.

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

    Members

    + +
    + +
    +

    game

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

    A reference to the currently running Game.

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

    world

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

    A reference to the game world.

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

    Methods

    + +
    + +
    +

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

    + + +
    +
    + + +
    +

    Creates a new Sound object.

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

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

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

    The volume at which the sound will be played.

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

    Whether or not the sound will loop.

    connect + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.

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

    The newly created text object.

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

    bitmapData(width, height, key, addToCache) → {Phaser.BitmapData}

    + + +
    +
    + + +
    +

    A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    width + + +number + + + + + + <optional>
    + + + + + +
    + + 100 + +

    The width of the BitmapData in pixels.

    height + + +number + + + + + + <optional>
    + + + + + +
    + + 100 + +

    The height of the BitmapData in pixels.

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

    Asset key for the BitmapData when stored in the Cache (see addToCache parameter).

    addToCache + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Should this BitmapData be added to the Game.Cache? If so you can retrieve it with Cache.getBitmapData(key)

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

    The newly created BitmapData object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.BitmapData + + +
    +
    + + + + + +
    + + + +
    +

    bitmapFont(font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset) → {Phaser.BitmapFont}

    + + +
    +
    + + +
    +

    Create a new BitmapFont object to be used as a texture for an Image or Sprite and optionally add it to the Cache. +The texture can be asssigned or one or multiple images/sprites, but note that the text the BitmapFont uses will be shared across them all, +i.e. if you need each Image to have different text in it, then you need to create multiple BitmapFont objects.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    font + + +string + + + + + + + + + + + +

    The key of the image in the Game.Cache that the BitmapFont will use.

    characterWidth + + +number + + + + + + + + + + + +

    The width of each character in the font set.

    characterHeight + + +number + + + + + + + + + + + +

    The height of each character in the font set.

    chars + + +string + + + + + + + + + + + +

    The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.

    charsPerRow + + +number + + + + + + + + + + + +

    The number of characters per row in the font set.

    xSpacing + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    If the characters in the font set have horizontal spacing between them set the required amount here.

    ySpacing + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    If the characters in the font set have vertical spacing between them set the required amount here.

    xOffset + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.

    yOffset + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.

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

    The newly created BitmapFont texture which can be applied to an Image or Sprite.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.BitmapFont + + +
    +
    + + + + + +
    + + + +
    +

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

    + + +
    +
    + + +
    +

    Create a new BitmapText object.

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

    X position of the new bitmapText object.

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

    Y position of the new bitmapText object.

    font + + +string + + + + + + + + + +

    The key of the BitmapText font as stored in Game.Cache.

    text + + +string + + + + + + <optional>
    + + + + + +

    The actual text that will be rendered. Can be set later via BitmapText.text.

    size + + +number + + + + + + <optional>
    + + + + + +

    The size the font will be rendered in, in pixels.

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

    The newly created bitmapText object.

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

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

    + + +
    +
    + + +
    +

    Creates a new Button object.

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

    X position of the new button object.

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

    Y position of the new button object.

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

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

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

    The function to call when this button is pressed

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

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

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

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

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

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

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

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

    upFrame + + +string +| + +number + + + + + + <optional>
    + + + + + +

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

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

    The newly created button object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Button + + +
    +
    + + + + + +
    + + + +
    +

    emitter(x, y, maxParticles) → {Phaser.Emitter}

    + + +
    +
    + + +
    +

    Emitter is a lightweight particle emitter. It can be used for one-time explosions or for +continuous effects like rain and fire. All it really does is launch Particle objects out +at set intervals, and fixes their positions and velocities accorindgly.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    x + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

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

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

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

    maxParticles + + +number + + + + + + <optional>
    + + + + + +
    + + 50 + +

    The total number of particles in this emitter.

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

    The newly created emitter object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Emitter + + +
    +
    + + + + + +
    + + + +
    +

    filter(filter) → {Phaser.Filter}

    + + +
    +
    + + +
    +

    A WebGL shader/filter that can be applied to Sprites.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    filter + + +string + + + +

    The name of the filter you wish to create, for example HueRotate or SineWave.

    + + +any + + + +

    Whatever parameters are needed to be passed to the filter init function.

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

    The newly created Phaser.Filter object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Filter + + +
    +
    + + + + + +
    + + + +
    +

    graphics(x, y, group) → {Phaser.Graphics}

    + + +
    +
    + + +
    +

    Creates a new Graphics object.

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

    X position of the new graphics object.

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

    Y position of the new graphics object.

    group + + +Phaser.Group + + + + + + <optional>
    + + + + + +

    Optional Group to add the object to. If not specified it will be added to the World group.

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

    The newly created graphics object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Graphics + + +
    +
    + + + + + +
    + + + +
    +

    group(parent, name, addToStage) → {Phaser.Group}

    + + +
    +
    + + +
    +

    A Group is a container for display objects that allows for fast pooling, recycling and collision checks.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    parent + + +any + + + + + + <optional>
    + + + + + +
    + +

    The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.

    name + + +string + + + + + + <optional>
    + + + + + +
    + + 'group' + +

    A name for this Group. Not used internally but useful for debugging.

    addToStage + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    If set to true this Group will be added directly to the Game.Stage instead of Game.World.

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

    The newly created group.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Group + + +
    +
    + + + + + +
    + + + +
    +

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

    + + +
    +
    + + +
    +

    Create a new Image object. An Image is a light-weight object you can use to display anything that doesn't need physics or animation. +It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics.

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

    X position of the image.

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

    Y position of the image.

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

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

    frame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.

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

    the newly created sprite object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Sprite + + +
    +
    + + + + + +
    + + + +
    +

    renderTexture(width, height, key, addToCache) → {Phaser.RenderTexture}

    + + +
    +
    + + +
    +

    A dynamic initially blank canvas to which images can be drawn.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    width + + +number + + + + + + <optional>
    + + + + + +
    + + 100 + +

    the width of the RenderTexture.

    height + + +number + + + + + + <optional>
    + + + + + +
    + + 100 + +

    the height of the RenderTexture.

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

    Asset key for the RenderTexture when stored in the Cache (see addToCache parameter).

    addToCache + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Should this RenderTexture be added to the Game.Cache? If so you can retrieve it with Cache.getTexture(key)

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

    The newly created RenderTexture object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.RenderTexture + + +
    +
    + + + + + +
    + + + +
    +

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

    + + +
    +
    + + +
    +

    Creates a new Sound object.

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

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

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

    The volume at which the sound will be played.

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

    Whether or not the sound will loop.

    connect + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.

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

    The newly created text object.

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

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

    + + +
    +
    + + +
    +

    Create a new Sprite with specific position and sprite sheet key.

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

    X position of the new sprite.

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

    Y position of the new sprite.

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

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

    frame + + +string +| + +number + + + + + + <optional>
    + + + + + +

    If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.

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

    the newly created sprite object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Sprite + + +
    +
    + + + + + +
    + + + +
    +

    spriteBatch(parent, name, addToStage) → {Phaser.Group}

    + + +
    +
    + + +
    +

    A Group is a container for display objects that allows for fast pooling, recycling and collision checks.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    parent + + +any + + + + + + + + + + + +

    The parent Group or DisplayObjectContainer that will hold this group, if any.

    name + + +string + + + + + + <optional>
    + + + + + +
    + + 'group' + +

    A name for this Group. Not used internally but useful for debugging.

    addToStage + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    If set to true this Group will be added directly to the Game.Stage instead of Game.World.

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

    The newly created group.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Group + + +
    +
    + + + + + +
    + + + +
    +

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

    + + +
    +
    + + +
    +

    Creates a new Text object.

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

    X position of the new text object.

    y + + +number + + + +

    Y position of the new text object.

    text + + +string + + + +

    The actual text that will be written.

    style + + +object + + + +

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

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

    The newly created text object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Text + + +
    +
    + + + + + +
    + + + +
    +

    tilemap(key, tilesets) → {Phaser.Tilemap}

    + + +
    +
    + + +
    +

    Creates a new Tilemap object.

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

    Asset key for the JSON or CSV map data in the cache.

    tilesets + + +object +| + +string + + + +

    An object mapping Cache.tileset keys with the tileset names in the JSON file. If a string is provided that will be used.

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

    The newly created tilemap object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Tilemap + + +
    +
    + + + + + +
    + + + +
    +

    tileSprite(x, y, width, height, key, frame) → {Phaser.TileSprite}

    + + +
    +
    + + +
    +

    Creates a new TileSprite object.

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

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

    y + + +number + + + +

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

    width + + +number + + + +

    The width of the TileSprite.

    height + + +number + + + +

    The height of the TileSprite.

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

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

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

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

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

    The newly created tileSprite object.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.TileSprite + + +
    +
    + + + + + +
    + + + +
    +

    tween(obj) → {Phaser.Tween}

    + + +
    +
    + + +
    +

    Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    obj + + +object + + + +

    Object the tween will be run on.

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

    Description.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Tween + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:27 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.GameObjectFactory.html b/docs/Phaser.GameObjectFactory.html index a1170f188..00e0947de 100644 --- a/docs/Phaser.GameObjectFactory.html +++ b/docs/Phaser.GameObjectFactory.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -3356,7 +3392,7 @@ at set intervals, and fixes their positions and velocities accorindgly.

    -

    group(parent, name, addToStage) → {Phaser.Group}

    +

    group(parent, name, addToStage) → {Phaser.Group}

    @@ -3417,6 +3453,8 @@ at set intervals, and fixes their positions and velocities accorindgly.

    + <optional>
    + @@ -3430,7 +3468,7 @@ at set intervals, and fixes their positions and velocities accorindgly.

    -

    The parent Group or DisplayObjectContainer that will hold this group, if any.

    +

    The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.

    @@ -5865,7 +5903,7 @@ It can still rotate, scale, crop and receive input events. This makes it perfect
    -

    Description.

    +

    The newly created Phaser.Tween object.

    @@ -5914,7 +5952,7 @@ It can still rotate, scale, crop and receive input events. This makes it perfect Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:26 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Gamepad.html b/docs/Phaser.Gamepad.html index e15a3919e..7659cb055 100644 --- a/docs/Phaser.Gamepad.html +++ b/docs/Phaser.Gamepad.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2420,148 +2456,6 @@ onConnectCallback, onDisconnectCallback, onDownCallback, onUpCallback, onAxisCal -
    - - - -
    -

    addCallbacks(context, callbacks)

    - - -
    -
    - - -
    -

    Add callbacks to the this Gamepad to handle connect/disconnect/button down/button up/axis change/float value buttons

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    context - - -Object - - - -

    The context under which the callbacks are run.

    callbacks - - -Object - - - -

    Object that takes six different callbak methods: -onConnectCallback, onDisconnectCallback, onDownCallback, onUpCallback, onAxisCallback, onFloatCallback

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - -
    @@ -3400,7 +3294,7 @@ This MUST be called manually before Phaser will start polling the Gamepad API. Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:26 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.GamepadButton.html b/docs/Phaser.GamepadButton.html index 6590db267..10cd7f77b 100644 --- a/docs/Phaser.GamepadButton.html +++ b/docs/Phaser.GamepadButton.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2578,7 +2614,7 @@ If the button is up it holds the duration of the previous down session.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:26 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Graphics.html b/docs/Phaser.Graphics.html index 15060ab39..90dcf7dd9 100644 --- a/docs/Phaser.Graphics.html +++ b/docs/Phaser.Graphics.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1486,6 +1522,145 @@ So if this Graphics was in a Group that has x: 200, then this will be added to t
    +
    +

    destroy()

    + + +
    +
    + + +
    +

    Destroy this Graphics instance.

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

    drawPolygon()

    + + +
    +
    + + +
    +

    /* +Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled

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

    postUpdate()

    @@ -1717,7 +1892,7 @@ So if this Graphics was in a Group that has x: 200, then this will be added to t Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:26 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Group.html b/docs/Phaser.Group.html index 395a4cb69..739cda624 100644 --- a/docs/Phaser.Group.html +++ b/docs/Phaser.Group.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -561,6 +597,9 @@ | Phaser.Sprite +| + +null @@ -582,7 +621,7 @@ -

    The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If undefined or null it will use game.world.

    +

    The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If undefined it will use game.world. If null it won't be added to anything.

    @@ -778,7 +817,7 @@
    Source:
    @@ -838,7 +877,7 @@
    Source:
    @@ -898,7 +937,7 @@
    Source:
    @@ -958,7 +997,7 @@
    Source:
    @@ -1018,7 +1057,7 @@
    Source:
    @@ -1123,7 +1162,7 @@
    Source:
    @@ -1225,7 +1264,7 @@
    Source:
    @@ -1332,7 +1371,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1434,7 +1473,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1541,7 +1580,7 @@ The cursor is set to the first child added to the Group and doesn't change unles
    Source:
    @@ -1646,7 +1685,7 @@ The cursor is set to the first child added to the Group and doesn't change unles
    Source:
    @@ -1754,7 +1793,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1856,7 +1895,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1958,7 +1997,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2060,7 +2099,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2167,7 +2206,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2269,7 +2308,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2371,7 +2410,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2473,7 +2512,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2575,7 +2614,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2682,7 +2721,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -2789,7 +2828,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -2905,7 +2944,7 @@ that then see the addAt method.

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

    Source:
    @@ -3267,7 +3306,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -3408,7 +3447,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -3642,7 +3681,7 @@ After the method parameter and context you can add as many extra parameters as y
    Source:
    @@ -3835,7 +3874,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -3999,7 +4038,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -4068,7 +4107,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -4160,7 +4199,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -4467,7 +4506,7 @@ Useful if you don't need to create the Sprite instances before-hand.

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

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

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

    Source:
    @@ -5233,7 +5272,7 @@ Note: Currently this will skip any children which are Groups themselves.

    Source:
    @@ -5376,150 +5415,7 @@ For example: Group.forEachAlive(causeDamage, this, 500)

    Source:
    - - - - - - - -
    - - - - - - - - - - - - - - - - - -
    -

    forEachAlive(callback, callbackContext)

    - - -
    -
    - - -
    -

    Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. -You can add as many parameters as you like, which will all be passed to the callback along with the child. -For example: Group.forEachAlive(causeDamage, this, 500)

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    callback - - -function - - - -

    The function that will be called. Each child of the Group will be passed to it as its first parameter.

    callbackContext - - -Object - - - -

    The context in which the function should be called (usually 'this').

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    @@ -5662,7 +5558,150 @@ For example: Group.forEachDead(bringToLife, this)

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

    forEachExists(callback, callbackContext)

    + + +
    +
    + + +
    +

    Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. +You can add as many parameters as you like, which will all be passed to the callback along with the child. +For example: Group.forEachExists(causeDamage, this, 500)

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

    The function that will be called. Each child of the Group will be passed to it as its first parameter.

    callbackContext + + +Object + + + +

    The context in which the function should be called (usually 'this').

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

    Source:
    @@ -5873,7 +5912,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -5966,7 +6005,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6107,7 +6146,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6248,7 +6287,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6412,7 +6451,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6717,7 +6756,7 @@ You can add as many callback parameters as you like, which will all be passed to
    Source:
    @@ -6928,7 +6967,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.

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

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

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

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

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

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

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

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

    Source:
    @@ -8019,7 +8058,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -8306,7 +8345,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -8549,7 +8588,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -8727,7 +8766,7 @@ For example to depth sort Sprites for Zelda-style game you might call grou
    Source:
    @@ -8915,7 +8954,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -9057,7 +9096,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
    Source:
    @@ -9126,7 +9165,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
    Source:
    @@ -9177,7 +9216,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:26 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Image.html b/docs/Phaser.Image.html index b6514b7f3..8d104257f 100644 --- a/docs/Phaser.Image.html +++ b/docs/Phaser.Image.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -795,7 +831,7 @@ If you wish to work in radians instead of degrees use the property Image.rotatio
    Source:
    @@ -1114,7 +1150,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1220,7 +1256,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1326,7 +1362,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1641,7 +1677,7 @@ So if this Image was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1743,7 +1779,7 @@ So if this Image was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1845,7 +1881,7 @@ So if this Image was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2053,7 +2089,7 @@ So if this Image was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2265,7 +2301,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2371,7 +2407,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2686,7 +2722,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2956,7 +2992,7 @@ bought to the top of that Group, not the entire display list.

    Source:
    @@ -3696,7 +3732,7 @@ This causes a WebGL texture update, so use sparingly or in low-intensity portion
    Source:
    @@ -3933,7 +3969,7 @@ It will dispatch the onRevived event, you can listen to Image.events.onRevived f Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:27 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Input.html b/docs/Phaser.Input.html index 060c0ee4c..5d60b167d 100644 --- a/docs/Phaser.Input.html +++ b/docs/Phaser.Input.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -7689,7 +7725,7 @@ to only use if you've limited input to a single pointer (i.e. mouse or touch)

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:27 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.InputHandler.html b/docs/Phaser.InputHandler.html index 16e447262..46d72ae15 100644 --- a/docs/Phaser.InputHandler.html +++ b/docs/Phaser.InputHandler.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -3504,6 +3540,10 @@ It compares the alpha value of the pixel and if >= InputHandler.pixelPerfectA
    Returns:
    +
    +

    True if the pointer is down, otherwise false.

    +
    +
    @@ -5584,6 +5624,147 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16 +
    + + + +
    +

    pointerDragged(pointer) → {boolean}

    + + +
    +
    + + +
    +

    Is this sprite being dragged by the mouse or not?

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    pointer + + +Phaser.Pointer + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    True if the pointer is dragging an object, otherwise false.

    +
    + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    + + + + +
    @@ -6143,143 +6324,6 @@ For example 16x16 as the snapX and snapY would make the sprite snap to every 16 -
    Returns:
    - - - - -
    -
    - Type -
    -
    - -number - - -
    -
    - - - - - - - - - -
    -

    pointerTimeOut(pointer) → {number}

    - - -
    -
    - - -
    -

    Is this sprite being dragged by the mouse or not?

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    pointer - - -Phaser.Pointer - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - -
    Returns:
    @@ -7994,7 +8038,7 @@ This value is only set when the pointer is over this Sprite.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:27 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Key.html b/docs/Phaser.Key.html index 167faf5c6..d2bcf38c4 100644 --- a/docs/Phaser.Key.html +++ b/docs/Phaser.Key.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2568,7 +2604,7 @@ If the key is up it holds the duration of the previous down session.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:27 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Keyboard.html b/docs/Phaser.Keyboard.html index 963d58da3..01f67f65b 100644 --- a/docs/Phaser.Keyboard.html +++ b/docs/Phaser.Keyboard.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2995,7 +3031,7 @@ This is called automatically by Phaser.Input and should not normally be invoked Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:27 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Line.html b/docs/Phaser.Line.html index 915d4ad3c..daeec541a 100644 --- a/docs/Phaser.Line.html +++ b/docs/Phaser.Line.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1382,7 +1418,279 @@
    -

    <static> intersects(a, b, e, f, asSegment, result) → {Phaser.Point}

    +

    <static> intersects(a, b, asSegment, result) → {Phaser.Point}

    + + +
    +
    + + +
    +

    Checks for intersection between two lines. +If asSegment is true it will check for segment intersection. +If asSegment is false it will check for line intersection. +Returns the intersection segment of AB and EF as a Point, or null if there is no intersection. +Adapted from code by Keith Hair

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    a + + +Phaser.Line + + + + + + + + + + + +

    The first Line to be checked.

    b + + +Phaser.Line + + + + + + + + + + + +

    The second Line to be checked.

    asSegment + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true it will check for segment intersection, otherwise full line intersection.

    result + + +Phaser.Point + + + + + + <optional>
    + + + + + +
    + +

    A Point object to store the result in, if not given a new one will be created.

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

    The intersection segment of the two lines as a Point, or null if there is no intersection.

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

    <static> intersectsPoints(a, b, e, f, asSegment, result) → {Phaser.Point}

    @@ -1693,278 +2001,6 @@ Adapted from code by Keith Hair

    -
    Returns:
    - - -
    -

    The intersection segment of the two lines as a Point, or null if there is no intersection.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Point - - -
    -
    - - - - - -
    - - - -
    -

    <static> intersects(a, b, asSegment, result) → {Phaser.Point}

    - - -
    -
    - - -
    -

    Checks for intersection between two lines. -If asSegment is true it will check for segment intersection. -If asSegment is false it will check for line intersection. -Returns the intersection segment of AB and EF as a Point, or null if there is no intersection. -Adapted from code by Keith Hair

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeArgumentDefaultDescription
    a - - -Phaser.Line - - - - - - - - - - - -

    The first Line to be checked.

    b - - -Phaser.Line - - - - - - - - - - - -

    The second Line to be checked.

    asSegment - - -boolean - - - - - - <optional>
    - - - - - -
    - - true - -

    If true it will check for segment intersection, otherwise full line intersection.

    result - - -Phaser.Point - - - - - - <optional>
    - - - - - -
    - -

    A Point object to store the result in, if not given a new one will be created.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - -
    Returns:
    @@ -3091,7 +3127,7 @@ Returns the intersection segment of AB and EF as a Point, or null if there is no Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:27 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.LinkedList.html b/docs/Phaser.LinkedList.html index b86f5ccf9..961596736 100644 --- a/docs/Phaser.LinkedList.html +++ b/docs/Phaser.LinkedList.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1487,7 +1523,7 @@ The function must exist on the member.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:28 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Loader.html b/docs/Phaser.Loader.html index c6be26c28..28c248c0b 100644 --- a/docs/Phaser.Loader.html +++ b/docs/Phaser.Loader.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -7607,7 +7643,7 @@ This allows you to easily make loading bars for games.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:28 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.LoaderParser.html b/docs/Phaser.LoaderParser.html index f0033004d..97e159ce4 100644 --- a/docs/Phaser.LoaderParser.html +++ b/docs/Phaser.LoaderParser.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -742,7 +778,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:28 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.MSPointer.html b/docs/Phaser.MSPointer.html index a4fee1c18..e01070ed2 100644 --- a/docs/Phaser.MSPointer.html +++ b/docs/Phaser.MSPointer.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1437,7 +1473,7 @@ It will work only in Internet Explorer 10 and Windows Store or Windows Phone 8 a Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:28 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Math.html b/docs/Phaser.Math.html index 039989403..42e9587ff 100644 --- a/docs/Phaser.Math.html +++ b/docs/Phaser.Math.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1309,7 +1345,7 @@
    Source:
    @@ -1469,7 +1505,7 @@
    Source:
    @@ -1698,7 +1734,7 @@
    Source:
    @@ -1858,7 +1894,7 @@
    Source:
    @@ -1995,7 +2031,7 @@
    Source:
    @@ -2507,7 +2543,7 @@ Clamp value to range <a, b>

    Source:
    @@ -2667,7 +2703,7 @@ Clamp value to range <a, b>

    Source:
    @@ -2755,7 +2791,7 @@ Clamp value to range <a, b>

    Source:
    @@ -2911,7 +2947,7 @@ Clamp value to range <a, b>

    Source:
    @@ -3117,7 +3153,7 @@ Clamp value to range <a, b>

    Source:
    @@ -3418,7 +3454,7 @@ Clamp value to range <a, b>

    Source:
    @@ -3628,7 +3664,7 @@ Clamp value to range <a, b>

    Source:
    @@ -3769,7 +3805,7 @@ Clamp value to range <a, b>

    Source:
    @@ -4341,193 +4377,6 @@ Clamp value to range <a, b>

    - - - - -
    -

    fuzzyEqual(a, b, epsilon) → {boolean}

    - - -
    -
    - - -
    -

    a is fuzzyLessThan b if it is less than b + ε.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    a - - -number - - - -
    b - - -number - - - -
    epsilon - - -number - - - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    True if a<b+ε

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - -
    @@ -4875,6 +4724,193 @@ Clamp value to range <a, b>

    + + + + +
    +

    fuzzyLessThan(a, b, epsilon) → {boolean}

    + + +
    +
    + + +
    +

    a is fuzzyLessThan b if it is less than b + ε.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    a + + +number + + + +
    b + + +number + + + +
    epsilon + + +number + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + +
    Returns:
    + + +
    +

    True if a<b+ε

    +
    + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    + + + + +
    @@ -5017,7 +5053,7 @@ Will return null if random selection is missing, or array has no entries.

    Source:
    @@ -5898,7 +5934,7 @@ Will return null if random selection is missing, or array has no entries.

    Source:
    @@ -6058,7 +6094,7 @@ Will return null if random selection is missing, or array has no entries.

    Source:
    @@ -6310,7 +6346,7 @@ Will return null if random selection is missing, or array has no entries.

    Source:
    @@ -8051,7 +8087,148 @@ It will find the lowest matching property value from the given objects.

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

    The scaled value.

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

    p2pxi(v) → {number}

    + + +
    +
    + + +
    +

    Convert p2 physics value (meters) to pixel scale and inverses it.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    v + + +number + + + +

    The value to convert.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -8261,7 +8438,148 @@ It will find the lowest matching property value from the given objects.

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

    The scaled value.

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

    px2pi(v) → {number}

    + + +
    +
    + + +
    +

    Convert pixel value to p2 physics scale (meters) and inverses it.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    v + + +number + + + +

    The value to convert.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -8353,7 +8671,7 @@ It will find the lowest matching property value from the given objects.

    Source:
    @@ -9067,7 +9385,7 @@ The original stack is modified in the process. This effectively moves the positi
    Source:
    @@ -9208,7 +9526,7 @@ The original stack is modified in the process. This effectively moves the positi
    Source:
    @@ -9350,7 +9668,7 @@ The original stack is modified in the process. This effectively moves the positi
    Source:
    @@ -9560,7 +9878,7 @@ you should get the results via getSinTable() and getCosTable(). This generator i
    Source:
    @@ -9747,7 +10065,7 @@ you should get the results via getSinTable() and getCosTable(). This generator i
    Source:
    @@ -9930,7 +10248,7 @@ you should get the results via getSinTable() and getCosTable(). This generator i
    Source:
    @@ -11065,7 +11383,7 @@ you should get the results via getSinTable() and getCosTable(). This generator i
    Source:
    @@ -11657,7 +11975,7 @@ Should be called whenever the angle is updated on the Sprite to stop it from goi Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:28 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Mouse.html b/docs/Phaser.Mouse.html index 53115ab04..315fe8fb8 100644 --- a/docs/Phaser.Mouse.html +++ b/docs/Phaser.Mouse.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2754,7 +2790,7 @@ If the browser successfully enters a locked state the event Phaser.Mouse.pointer Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:28 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Net.html b/docs/Phaser.Net.html index f953f984a..9aa65a274 100644 --- a/docs/Phaser.Net.html +++ b/docs/Phaser.Net.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1381,7 +1417,7 @@ Optionally you can redirect to the new url, or just return it as a string.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:29 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Particles.Arcade.Emitter.html b/docs/Phaser.Particles.Arcade.Emitter.html index ffc5ec994..6b69c8de7 100644 --- a/docs/Phaser.Particles.Arcade.Emitter.html +++ b/docs/Phaser.Particles.Arcade.Emitter.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -835,7 +871,7 @@ at set intervals, and fixes their positions and velocities accorindgly.

    Source:
    @@ -1062,7 +1098,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1478,7 +1514,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1590,7 +1626,7 @@ The cursor is set to the first child added to the Group and doesn't change unles
    Source:
    @@ -2024,7 +2060,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2236,7 +2272,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2655,7 +2691,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -4114,7 +4150,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -4221,7 +4257,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -4430,7 +4466,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -5287,7 +5323,7 @@ that then see the addAt method.

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

    Source:
    @@ -5659,7 +5695,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -5926,7 +5962,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -6165,7 +6201,7 @@ After the method parameter and context you can add as many extra parameters as y
    Source:
    @@ -6363,7 +6399,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -6532,7 +6568,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -6606,7 +6642,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -6703,7 +6739,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -7015,7 +7051,7 @@ Useful if you don't need to create the Sprite instances before-hand.

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

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

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

    Source:
    @@ -7870,7 +7906,7 @@ Note: Currently this will skip any children which are Groups themselves.

    Source:
    @@ -8018,155 +8054,7 @@ For example: Group.forEachAlive(causeDamage, this, 500)

    Source:
    - - - - - - - -
    - - - - - - - - - - - - - -
    - - - -
    -

    forEachAlive(callback, callbackContext)

    - - -
    -
    - - -
    -

    Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. -You can add as many parameters as you like, which will all be passed to the callback along with the child. -For example: Group.forEachAlive(causeDamage, this, 500)

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    callback - - -function - - - -

    The function that will be called. Each child of the Group will be passed to it as its first parameter.

    callbackContext - - -Object - - - -

    The context in which the function should be called (usually 'this').

    - - - - -
    - - - - - - - -
    Inherited From:
    -
    - - - - - - - - - - - - - -
    Source:
    -
    @@ -8314,7 +8202,155 @@ For example: Group.forEachDead(bringToLife, this)

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

    forEachExists(callback, callbackContext)

    + + +
    +
    + + +
    +

    Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. +You can add as many parameters as you like, which will all be passed to the callback along with the child. +For example: Group.forEachExists(causeDamage, this, 500)

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

    The function that will be called. Each child of the Group will be passed to it as its first parameter.

    callbackContext + + +Object + + + +

    The context in which the function should be called (usually 'this').

    + + + + +
    + + + + + + + +
    Inherited From:
    +
    + + + + + + + + + + + + + +
    Source:
    +
    @@ -8437,7 +8473,7 @@ For example: Group.forEachDead(bringToLife, this)

    Source:
    @@ -8535,7 +8571,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -8633,7 +8669,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -8779,7 +8815,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -8925,7 +8961,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -9094,7 +9130,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -9404,7 +9440,7 @@ You can add as many callback parameters as you like, which will all be passed to
    Source:
    @@ -10000,7 +10036,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.

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

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

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

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

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

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

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

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

    Source:
    @@ -11205,7 +11241,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -11497,7 +11533,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -11745,7 +11781,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -12600,7 +12636,7 @@ For example to depth sort Sprites for Zelda-style game you might call grou
    Source:
    @@ -13048,7 +13084,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -13195,7 +13231,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
    Source:
    @@ -13315,7 +13351,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:29 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Particles.html b/docs/Phaser.Particles.html index 24e942129..4514734af 100644 --- a/docs/Phaser.Particles.html +++ b/docs/Phaser.Particles.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1270,7 +1306,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:29 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Arcade.html b/docs/Phaser.Physics.Arcade.html index 34b8dec42..423fc9553 100644 --- a/docs/Phaser.Physics.Arcade.html +++ b/docs/Phaser.Physics.Arcade.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -8094,7 +8130,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:29 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Body.html b/docs/Phaser.Physics.Body.html new file mode 100644 index 000000000..8632030f5 --- /dev/null +++ b/docs/Phaser.Physics.Body.html @@ -0,0 +1,11896 @@ + + + + + + Phaser Class: Body + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Body

    +
    + +
    +

    + Phaser.Physics. + + Body +

    + +

    Physics Body Constructor

    + +
    + +
    +
    + + + + +
    +

    new Body(game, sprite, x, y, mass)

    + + +
    +
    + + +
    +

    The Physics Body is typically linked to a single Sprite and defines properties that determine how the physics body is simulated. +These properties affect how the body reacts to forces, what forces it generates on itself (to simulate friction), and how it reacts to collisions in the scene. +In most cases, the properties are used to simulate physical effects. Each body also has its own property values that determine exactly how it reacts to forces and collisions in the scene. +By default a single Rectangle shape is added to the Body that matches the dimensions of the parent Sprite. See addShape, removeShape, clearShapes to add extra shapes around the Body.

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

    Game reference to the currently running game.

    sprite + + +Phaser.Sprite + + + + + + <optional>
    + + + + + +
    + +

    The Sprite object this physics body belongs to.

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

    The x coordinate of this Body.

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

    The y coordinate of this Body.

    mass + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    The default mass of this Body (0 = static).

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

    Members

    + +
    + +
    +

    allowSleep

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    allowSleep + + +boolean + + + +

    -

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

    angle

    + + +
    +
    + +
    +

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

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

    The angle of this Body in degrees.

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

    angularDamping

    + + +
    +
    + +
    +

    Damping is specified as a value between 0 and 1, which is the proportion of velocity lost per second.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    angularDamping + + +number + + + +

    The angular damping acting acting on the body.

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

    angularForce

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    angularForce + + +number + + + +

    The angular force acting on the body.

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

    angularVelocity

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    angularVelocity + + +number + + + +

    The angular velocity of the body.

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

    collideWorldBounds

    + + +
    +
    + +
    +

    A Body can be set to collide against the World bounds automatically if this is set to true. Otherwise it will leave the World. +Note that this only applies if your World has bounds! The response to the collision should be managed via CollisionMaterials.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    collideWorldBounds + + +boolean + + + +

    Should the Body collide with the World bounds?

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

    damping

    + + +
    +
    + +
    +

    Damping is specified as a value between 0 and 1, which is the proportion of velocity lost per second.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    damping + + +number + + + +

    The linear damping acting on the body in the velocity direction.

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

    <protected> data

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    data + + +p2.Body + + + +

    The p2 Body data.

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

    dynamic

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    dynamic + + +boolean + + + +

    Returns true if the Body is dynamic. Setting Body.dynamic to 'false' will make it static.

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

    fixedRotation

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    fixedRotation + + +boolean + + + +

    -

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

    force

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    force + + +Phaser.InversePointProxy + + + +

    The force applied to the body.

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

    game

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

    Local reference to game.

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

    gravity

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    gravity + + +Phaser.Point + + + +

    A locally applied gravity force to the Body. Applied directly before the world step. NOTE: Not currently implemented.

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

    inertia

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    inertia + + +number + + + +

    The inertia of the body around the Z axis..

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

    kinematic

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    kinematic + + +boolean + + + +

    Returns true if the Body is kinematic. Setting Body.kinematic to 'false' will make it static.

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

    mass

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    mass + + +number + + + +

    -

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

    motionState

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    motionState + + +number + + + +

    The type of motion this body has. Should be one of: Body.STATIC (the body does not move), Body.DYNAMIC (body can move and respond to collisions) and Body.KINEMATIC (only moves according to its .velocity).

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

    offset

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

    The offset of the Physics Body from the Sprite x/y position.

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

    onImpact

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onImpact + + +Phaser.Signal + + + +

    Dispatched when the shape/s of this Body impact with another. The event will be sent 2 parameters, this Body and the impact Body.

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

    rotation

    + + +
    +
    + +
    +

    The angle of the Body in radians. +If you wish to work in degrees instead of radians use the Body.angle property instead. Working in radians is faster as it doesn't have to convert values.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    rotation + + +number + + + +

    The angle of this Body in radians.

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

    sleepSpeedLimit

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    sleepSpeedLimit + + +number + + + +

    .

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

    sprite

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    sprite + + +Phaser.Sprite + + + +

    Reference to the parent Sprite.

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

    static

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    static + + +boolean + + + +

    Returns true if the Body is static. Setting Body.static to 'false' will make it dynamic.

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

    velocity

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    velocity + + +Phaser.InversePointProxy + + + +

    The velocity of the body. Set velocity.x to a negative value to move to the left, position to the right. velocity.y negative values move up, positive move down.

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

    x

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

    The x coordinate of this Body.

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

    y

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

    The y coordinate of this Body.

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

    Methods

    + +
    + +
    +

    addCapsule(length, radius, offsetX, offsetY, rotation) → {p2.Capsule}

    + + +
    +
    + + +
    +

    Adds a Capsule shape to this Body. +You can control the offset from the center of the body and the rotation.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    length + + +number + + + + + + + + + + + +

    The distance between the end points in pixels.

    radius + + +number + + + + + + + + + + + +

    Radius of the capsule in radians.

    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    The Capsule shape that was added to the Body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Capsule + + +
    +
    + + + + + +
    + + + +
    +

    addCircle(radius, offsetX, offsetY, rotation) → {p2.Circle}

    + + +
    +
    + + +
    +

    Adds a Circle shape to this Body. You can control the offset from the center of the body and the rotation.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    radius + + +number + + + + + + + + + + + +

    The radius of this circle (in pixels)

    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    The Circle shape that was added to the Body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Circle + + +
    +
    + + + + + +
    + + + +
    +

    addLine(length, offsetX, offsetY, rotation) → {p2.Line}

    + + +
    +
    + + +
    +

    Adds a Line shape to this Body. +The line shape is along the x direction, and stretches from [-length/2, 0] to [length/2,0]. +You can control the offset from the center of the body and the rotation.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    length + + +number + + + + + + + + + + + +

    The length of this line (in pixels)

    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    The Line shape that was added to the Body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Line + + +
    +
    + + + + + +
    + + + +
    +

    addParticle(offsetX, offsetY, rotation) → {p2.Particle}

    + + +
    +
    + + +
    +

    Adds a Particle shape to this Body. You can control the offset from the center of the body and the rotation.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    The Particle shape that was added to the Body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Particle + + +
    +
    + + + + + +
    + + + +
    +

    addPlane(offsetX, offsetY, rotation) → {p2.Plane}

    + + +
    +
    + + +
    +

    Adds a Plane shape to this Body. The plane is facing in the Y direction. You can control the offset from the center of the body and the rotation.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    The Plane shape that was added to the Body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Plane + + +
    +
    + + + + + +
    + + + +
    +

    addPolygon(options, points) → {boolean}

    + + +
    +
    + + +
    +

    Reads a polygon shape path, and assembles convex shapes from that and puts them at proper offset points. The shape must be simple and without holes. +This function expects the x.y values to be given in pixels. If you want to provide them at p2 world scales then call Body.data.fromPolygon directly.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    options + + +object + + + +

    An object containing the build options:

    +
    Properties
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    optimalDecomp + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.

    skipSimpleCheck + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you already know that the path is not intersecting itself.

    removeCollinearPoints + + +boolean +| + +number + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to a number (angle threshold value) to remove collinear points, or false to keep all points.

    + +
    points + + +Array.<number> +| + +number + + + +

    An array of 2d vectors that form the convex or concave polygon. + Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + or the arguments passed can be flat x,y values e.g. setPolygon(options, x,y, x,y, x,y, ...) where x and y are numbers.

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

    True on success, else false.

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

    addRectangle(width, height, offsetX, offsetY, rotation) → {p2.Rectangle}

    + + +
    +
    + + +
    +

    Adds a Rectangle shape to this Body. You can control the offset from the center of the body and the rotation.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    width + + +number + + + + + + + + + + + +

    The width of the rectangle in pixels.

    height + + +number + + + + + + + + + + + +

    The height of the rectangle in pixels.

    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    The Rectangle shape that was added to the Body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    addShape(shape, offsetX, offsetY, rotation) → {p2.Circle|p2.Rectangle|p2.Plane|p2.Line|p2.Particle}

    + + +
    +
    + + +
    +

    Add a shape to the body. You can pass a local transform when adding a shape, so that the shape gets an offset and an angle relative to the body center of mass. +Will automatically update the mass properties and bounding radius.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    shape + + +* + + + + + + + + + + + +

    The shape to add to the body.

    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    The shape that was added to the body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Circle +| + +p2.Rectangle +| + +p2.Plane +| + +p2.Line +| + +p2.Particle + + +
    +
    + + + + + +
    + + + +
    +

    addToWorld()

    + + +
    +
    + + +
    +

    Adds this physics body to the world.

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

    adjustCenterOfMass()

    + + +
    +
    + + +
    +

    Moves the shape offsets so their center of mass becomes the body center of mass.

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

    applyDamping(dt)

    + + +
    +
    + + +
    +

    Apply damping, see http://code.google.com/p/bullet/issues/detail?id=74 for details.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    dt + + +number + + + +

    Current time step.

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

    applyForce(force, worldX, worldY)

    + + +
    +
    + + +
    +

    Apply force to a world point. This could for example be a point on the RigidBody surface. Applying force this way will add to Body.force and Body.angularForce.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    force + + +number + + + +

    The force to add.

    worldX + + +number + + + +

    The world x point to apply the force on.

    worldY + + +number + + + +

    The world y point to apply the force on.

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

    clearCollision(clearGroup, clearMask, shape)

    + + +
    +
    + + +
    +

    Clears the collision data from the shapes in this Body. Optionally clears Group and/or Mask.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    clearGroup + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    Clear the collisionGroup value from the shape/s?

    clearMask + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    Clear the collisionMask value from the shape/s?

    shape + + +p2.Shape + + + + + + <optional>
    + + + + + +
    + +

    An optional Shape. If not provided the collision data will be cleared from all Shapes in this Body.

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

    clearShapes()

    + + +
    +
    + + +
    +

    Removes all Shapes from this Body.

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

    collides(group, callback, callbackContext, shape)

    + + +
    +
    + + +
    +

    Adds the given CollisionGroup, or array of CollisionGroups, to the list of groups that this body will collide with and updates the collision masks.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    group + + +Phaser.Physics.CollisionGroup +| + +array + + + + + + + + + +

    The Collision Group or Array of Collision Groups that this Bodies shapes will collide with.

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

    Optional callback that will be triggered when this Body impacts with the given Group.

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

    The context under which the callback will be called.

    shape + + +p2.Shape + + + + + + <optional>
    + + + + + +

    An optional Shape. If not provided the collision mask will be added to all Shapes in this Body.

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

    createBodyCallback(body, callback, callbackContext)

    + + +
    +
    + + +
    +

    Sets a callback to be fired any time this Body impacts with the given Body. The impact test is performed against body.id values. +The callback will be sent 4 parameters: This body, the body that impacted, the Shape in this body and the shape in the impacting body.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body + + +Phaser.Physics.Body + + + +

    The Body to send impact events for.

    callback + + +function + + + +

    The callback to fire on impact. Set to null to clear a previously set callback.

    callbackContext + + +object + + + +

    The context under which the callback will fire.

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

    createGroupCallback(group, callback, callbackContext)

    + + +
    +
    + + +
    +

    Sets a callback to be fired any time this Body impacts with the given Group. The impact test is performed against shape.collisionGroup values. +The callback will be sent 4 parameters: This body, the body that impacted, the Shape in this body and the shape in the impacting body. +This callback will only fire if this Body has been assigned a collision group.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    group + + +Phaser.Physics.CollisionGroup + + + +

    The Group to send impact events for.

    callback + + +function + + + +

    The callback to fire on impact. Set to null to clear a previously set callback.

    callbackContext + + +object + + + +

    The context under which the callback will fire.

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

    destroy()

    + + +
    +
    + + +
    +

    Destroys this Body and all references it holds to other objects.

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

    getCollisionMask() → {number}

    + + +
    +
    + + +
    +

    Gets the collision bitmask from the groups this body collides with.

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

    The bitmask.

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

    loadPolygon(key, object, options) → {boolean}

    + + +
    +
    + + +
    +

    Reads the shape data from a physics data file stored in the Game.Cache and adds it as a polygon to this Body.

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

    The key of the Physics Data file as stored in Game.Cache.

    object + + +string + + + +

    The key of the object within the Physics data file that you wish to load the shape data from.

    options + + +object + + + +

    An object containing the build options:

    +
    Properties
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    optimalDecomp + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.

    skipSimpleCheck + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you already know that the path is not intersecting itself.

    removeCollinearPoints + + +boolean +| + +number + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to a number (angle threshold value) to remove collinear points, or false to keep all points.

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

    True on success, else false.

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

    loadPolygon(key, object, options) → {boolean}

    + + +
    +
    + + +
    +

    Reads the physics data from a physics data file stored in the Game.Cache. +It will add the shape data to this Body, as well as set the density (mass), friction and bounce (restitution) values.

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

    The key of the Physics Data file as stored in Game.Cache.

    object + + +string + + + +

    The key of the object within the Physics data file that you wish to load the shape data from.

    options + + +object + + + +

    An object containing the build options:

    +
    Properties
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    optimalDecomp + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.

    skipSimpleCheck + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you already know that the path is not intersecting itself.

    removeCollinearPoints + + +boolean +| + +number + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to a number (angle threshold value) to remove collinear points, or false to keep all points.

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

    True on success, else false.

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

    moveBackward(speed)

    + + +
    +
    + + +
    +

    Moves the Body backwards based on its current angle and the given speed. +The speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should move backwards.

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

    moveDown(speed)

    + + +
    +
    + + +
    +

    If this Body is dynamic then this will move it down by setting its y velocity to the given speed. +The speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should move down, in pixels per second.

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

    moveForward(speed)

    + + +
    +
    + + +
    +

    Moves the Body forwards based on its current angle and the given speed. +The speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should move forwards.

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

    moveLeft(speed)

    + + +
    +
    + + +
    +

    If this Body is dynamic then this will move it to the left by setting its x velocity to the given speed. +The speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should move to the left, in pixels per second.

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

    moveRight(speed)

    + + +
    +
    + + +
    +

    If this Body is dynamic then this will move it to the right by setting its x velocity to the given speed. +The speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should move to the right, in pixels per second.

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

    moveUp(speed)

    + + +
    +
    + + +
    +

    If this Body is dynamic then this will move it up by setting its y velocity to the given speed. +The speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should move up, in pixels per second.

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

    p2px(v) → {number}

    + + +
    +
    + + +
    +

    Convert p2 physics value (meters) to pixel scale.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    v + + +number + + + +

    The value to convert.

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

    The scaled value.

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

    p2pxi(v) → {number}

    + + +
    +
    + + +
    +

    Convert p2 physics value (meters) to pixel scale and inverses it.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    v + + +number + + + +

    The value to convert.

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

    The scaled value.

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

    <protected> postUpdate()

    + + +
    +
    + + +
    +

    Internal method. This is called directly before the sprites are sent to the renderer and after the update function has finished.

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

    <protected> preUpdate()

    + + +
    +
    + + +
    +

    Internal method. This is called directly before the sprites are sent to the renderer and after the update function has finished.

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

    px2p(v) → {number}

    + + +
    +
    + + +
    +

    Convert pixel value to p2 physics scale (meters).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    v + + +number + + + +

    The value to convert.

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

    The scaled value.

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

    px2pi(v) → {number}

    + + +
    +
    + + +
    +

    Convert pixel value to p2 physics scale (meters) and inverses it.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    v + + +number + + + +

    The value to convert.

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

    The scaled value.

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

    removeFromWorld()

    + + +
    +
    + + +
    +

    Removes this physics body from the world.

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

    removeShape(shape) → {boolean}

    + + +
    +
    + + +
    +

    Remove a shape from the body. Will automatically update the mass properties and bounding radius.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    shape + + +p2.Circle +| + +p2.Rectangle +| + +p2.Plane +| + +p2.Line +| + +p2.Particle + + + +

    The shape to remove from the body.

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

    True if the shape was found and removed, else false.

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

    reset(x, y, resetDamping, resetMass)

    + + +
    +
    + + +
    +

    Resets the Body force, velocity (linear and angular) and rotation. Optionally resets damping and mass.

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

    The new x position of the Body.

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

    The new x position of the Body.

    resetDamping + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Resets the linear and angular damping.

    resetMass + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Sets the Body mass back to 1.

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

    rever(speed)

    + + +
    +
    + + +
    +

    Applies a force to the Body that causes it to 'thrust' backwards (in reverse), based on its current angle and the given speed. +The speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should reverse.

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

    rotateLeft(speed)

    + + +
    +
    + + +
    +

    This will rotate the Body by the given speed to the left (counter-clockwise).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should rotate.

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

    rotateRight(speed)

    + + +
    +
    + + +
    +

    This will rotate the Body by the given speed to the left (clockwise).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should rotate.

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

    setCircle(radius, offsetX, offsetY, rotation)

    + + +
    +
    + + +
    +

    Clears any previously set shapes. Then creates a new Circle shape and adds it to this Body.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    radius + + +number + + + + + + + + + + + +

    The radius of this circle (in pixels)

    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    setCollisionGroup(group, shape)

    + + +
    +
    + + +
    +

    Sets the given CollisionGroup to be the collision group for all shapes in this Body, unless a shape is specified. +This also resets the collisionMask.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    group + + +Phaser.Physics.CollisionGroup +| + +array + + + + + + + + + +

    The Collision Group that this Bodies shapes will use.

    shape + + +p2.Shape + + + + + + <optional>
    + + + + + +

    An optional Shape. If not provided the collision group will be added to all Shapes in this Body.

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

    setMaterial(material, shape)

    + + +
    +
    + + +
    +

    Adds the given Material to all Shapes that belong to this Body. +If you only wish to apply it to a specific Shape in this Body then provide that as the 2nd parameter.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    material + + +Phaser.Physics.Material + + + + + + + + + +

    The Material that will be applied.

    shape + + +p2.Shape + + + + + + <optional>
    + + + + + +

    An optional Shape. If not provided the Material will be added to all Shapes in this Body.

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

    setRectangle(width, height, offsetX, offsetY, rotation) → {p2.Rectangle}

    + + +
    +
    + + +
    +

    Clears any previously set shapes. The creates a new Rectangle shape at the given size and offset, and adds it to this Body. +If you wish to create a Rectangle to match the size of a Sprite or Image see Body.setRectangleFromSprite.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    width + + +number + + + + + + <optional>
    + + + + + +
    + + 16 + +

    The width of the rectangle in pixels.

    height + + +number + + + + + + <optional>
    + + + + + +
    + + 16 + +

    The height of the rectangle in pixels.

    offsetX + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local horizontal offset of the shape relative to the body center of mass.

    offsetY + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local vertical offset of the shape relative to the body center of mass.

    rotation + + +number + + + + + + <optional>
    + + + + + +
    + + 0 + +

    Local rotation of the shape relative to the body center of mass, specified in radians.

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

    The Rectangle shape that was added to the Body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    setRectangleFromSprite(sprite) → {p2.Rectangle}

    + + +
    +
    + + +
    +

    Clears any previously set shapes. +Then creates a Rectangle shape sized to match the dimensions and orientation of the Sprite given. +If no Sprite is given it defaults to using the parent of this Body.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    sprite + + +Phaser.Sprite +| + +Phaser.Image + + + + + + <optional>
    + + + + + +

    The Sprite on which the Rectangle will get its dimensions.

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

    The Rectangle shape that was added to the Body.

    +
    + + + +
    +
    + Type +
    +
    + +p2.Rectangle + + +
    +
    + + + + + +
    + + + +
    +

    setZeroDamping()

    + + +
    +
    + + +
    +

    Sets the Body damping and angularDamping to zero.

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

    setZeroForce()

    + + +
    +
    + + +
    +

    Sets the force on the body to zero.

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

    setZeroRotation()

    + + +
    +
    + + +
    +

    If this Body is dynamic then this will zero its angular velocity.

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

    setZeroVelocity()

    + + +
    +
    + + +
    +

    If this Body is dynamic then this will zero its velocity on both axis.

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

    thrust(speed)

    + + +
    +
    + + +
    +

    Applies a force to the Body that causes it to 'thrust' forwards, based on its current angle and the given speed. +The speed is represented in pixels per second. So a value of 100 would move 100 pixels in 1 second (1000ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    speed + + +number + + + +

    The speed at which it should thrust.

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

    toLocalFrame(out, worldPoint)

    + + +
    +
    + + +
    +

    Transform a world point to local body frame.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    out + + +Float32Array +| + +Array + + + +

    The vector to store the result in.

    worldPoint + + +Float32Array +| + +Array + + + +

    The input world vector.

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

    toWorldFrame(out, localPoint)

    + + +
    +
    + + +
    +

    Transform a local point to world frame.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    out + + +Array + + + +

    The vector to store the result in.

    localPoint + + +Array + + + +

    The input local vector.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:30 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.CollisionGroup.html b/docs/Phaser.Physics.CollisionGroup.html new file mode 100644 index 000000000..658142af1 --- /dev/null +++ b/docs/Phaser.Physics.CollisionGroup.html @@ -0,0 +1,765 @@ + + + + + + Phaser Class: CollisionGroup + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: CollisionGroup

    +
    + +
    +

    + Phaser.Physics. + + CollisionGroup +

    + +

    Physics Collision Group Constructor

    + +
    + +
    +
    + + + + +
    +

    new CollisionGroup()

    + + +
    +
    + + +
    +

    Collision Group

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

    Members

    + +
    + +
    +

    mask

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    mask + + +number + + + +

    The CollisionGroup bitmask.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:30 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.ContactMaterial.html b/docs/Phaser.Physics.ContactMaterial.html new file mode 100644 index 000000000..c7ed12020 --- /dev/null +++ b/docs/Phaser.Physics.ContactMaterial.html @@ -0,0 +1,782 @@ + + + + + + Phaser Class: ContactMaterial + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: ContactMaterial

    +
    + +
    +

    + Phaser.Physics. + + ContactMaterial +

    + +

    Physics ContactMaterial Constructor

    + +
    + +
    +
    + + + + +
    +

    new ContactMaterial(materialA, materialB, options)

    + + +
    +
    + + +
    +

    Defines a physics material

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    materialA + + +Phaser.Physics.Material + + + + + + + + + +
    materialB + + +Phaser.Physics.Material + + + + + + + + + +
    options + + +object + + + + + + <optional>
    + + + + + +
    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:30 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.InversePointProxy.html b/docs/Phaser.Physics.InversePointProxy.html new file mode 100644 index 000000000..b15fd9584 --- /dev/null +++ b/docs/Phaser.Physics.InversePointProxy.html @@ -0,0 +1,939 @@ + + + + + + Phaser Class: InversePointProxy + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: InversePointProxy

    +
    + +
    +

    + Phaser.Physics. + + InversePointProxy +

    + +

    InversePointProxy

    + +
    + +
    +
    + + + + +
    +

    new InversePointProxy(game, destination)

    + + +
    +
    + + +
    +

    A InversePointProxy is an internal class that allows for direct getter/setter style property access to Arrays and TypedArrays but inverses the values on set.

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

    A reference to the Phaser.Game instance.

    destination + + +any + + + +

    The object to bind to.

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

    Members

    + +
    + +
    +

    x

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

    The x property of this InversePointProxy.

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

    y

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

    The y property of this InversePointProxy.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.Material.html b/docs/Phaser.Physics.Material.html new file mode 100644 index 000000000..f1df5d18f --- /dev/null +++ b/docs/Phaser.Physics.Material.html @@ -0,0 +1,768 @@ + + + + + + Phaser Class: Material + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Material

    +
    + +
    +

    + Phaser.Physics. + + Material +

    + +

    Physics Material Constructor

    + +
    + +
    +
    + + + + +
    +

    new Material()

    + + +
    +
    + + +
    +

    \o/ ~ "Because I'm a Material girl"

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

    Members

    + +
    + +
    +

    name

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

    The user defined name given to this Material.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • name
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.PointProxy.html b/docs/Phaser.Physics.PointProxy.html new file mode 100644 index 000000000..d02d81c5e --- /dev/null +++ b/docs/Phaser.Physics.PointProxy.html @@ -0,0 +1,939 @@ + + + + + + Phaser Class: PointProxy + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: PointProxy

    +
    + +
    +

    + Phaser.Physics. + + PointProxy +

    + +

    PointProxy

    + +
    + +
    +
    + + + + +
    +

    new PointProxy(game, destination)

    + + +
    +
    + + +
    +

    A PointProxy is an internal class that allows for direct getter/setter style property access to Arrays and TypedArrays.

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

    A reference to the Phaser.Game instance.

    destination + + +any + + + +

    The object to bind to.

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

    Members

    + +
    + +
    +

    x

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

    The x property of this PointProxy.

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

    y

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

    The y property of this PointProxy.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.Spring.html b/docs/Phaser.Physics.Spring.html new file mode 100644 index 000000000..9e49ed45f --- /dev/null +++ b/docs/Phaser.Physics.Spring.html @@ -0,0 +1,1165 @@ + + + + + + Phaser Class: Spring + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Spring

    +
    + +
    +

    + Phaser.Physics. + + Spring +

    + +

    Physics Spring Constructor

    + +
    + +
    +
    + + + + +
    +

    new Spring(game, bodyA, bodyB, restLength, stiffness, damping, worldA, worldB, localA, localB)

    + + +
    +
    + + +
    +

    Creates a spring, connecting two bodies.

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

    A reference to the current game.

    bodyA + + +p2.Body + + + + + + + + + + + +

    First connected body.

    bodyB + + +p2.Body + + + + + + + + + + + +

    Second connected body.

    restLength + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    Rest length of the spring. A number > 0.

    stiffness + + +number + + + + + + <optional>
    + + + + + +
    + + 100 + +

    Stiffness of the spring. A number >= 0.

    damping + + +number + + + + + + <optional>
    + + + + + +
    + + 1 + +

    Damping of the spring. A number >= 0.

    worldA + + +Array + + + + + + <optional>
    + + + + + +
    + +

    Where to hook the spring to body A, in world coordinates, i.e. [32, 32].

    worldB + + +Array + + + + + + <optional>
    + + + + + +
    + +

    Where to hook the spring to body B, in world coordinates, i.e. [32, 32].

    localA + + +Array + + + + + + <optional>
    + + + + + +
    + +

    Where to hook the spring to body A, in local body coordinates.

    localB + + +Array + + + + + + <optional>
    + + + + + +
    + +

    Where to hook the spring to body B, in local body coordinates.

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

    Members

    + +
    + +
    +

    game

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

    Local reference to game.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + +
    + + + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.World.html b/docs/Phaser.Physics.World.html new file mode 100644 index 000000000..1d1c5eb9c --- /dev/null +++ b/docs/Phaser.Physics.World.html @@ -0,0 +1,7502 @@ + + + + + + Phaser Class: World + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: World

    +
    + +
    +

    + Phaser.Physics. + + World +

    + +

    Physics World Constructor

    + +
    + +
    +
    + + + + +
    +

    new World(game, config)

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

    Reference to the current game instance.

    config + + +object + + + + + + <optional>
    + + + + + +

    Physics configuration object passed in from the game constructor.

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

    Members

    + +
    + +
    +

    applyDamping

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    applyDamping + + +boolean + + + +

    Enable to automatically apply body damping each step.

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

    applyGravity

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    applyGravity + + +boolean + + + +

    Enable to automatically apply gravity each step.

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

    applySpringForces

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    applySpringForces + + +boolean + + + +

    Enable to automatically apply spring forces each step.

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

    bounds

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bounds + + +p2.Body + + + +

    The bounds body contains the 4 walls that border the World. Define or disable with setBounds.

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

    collisionGroups

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    collisionGroups + + +array + + + +

    Internal var.

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

    emitImpactEvent

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    emitImpactEvent + + +boolean + + + +

    Set to true if you want to the world to emit the "impact" event. Turning this off could improve performance.

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

    enableBodySleeping

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    enableBodySleeping + + +boolean + + + +

    Enable / disable automatic body sleeping.

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

    friction

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    friction + + +number + + + +

    Friction between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair.

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

    game

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

    Local reference to game.

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

    gravity

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    gravity + + +Phaser.InversePointProxy + + + +

    The gravity applied to all bodies each step.

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

    <protected> materials

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    materials + + +array.<Phaser.Physics.Material> + + + +

    A local array of all created Materials.

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

    onBeginContact

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onBeginContact + + +Phaser.Signal + + + +

    Dispatched when a first contact is created between two bodies. This event is fired before the step has been done.

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

    onBodyAdded

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onBodyAdded + + +Phaser.Signal + + + +

    Dispatched when a new Body is added to the World.

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

    onBodyRemoved

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onBodyRemoved + + +Phaser.Signal + + + +

    Dispatched when a Body is removed from the World.

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

    onConstraintAdded

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onConstraintAdded + + +Phaser.Signal + + + +

    Dispatched when a new Constraint is added to the World.

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

    onConstraintRemoved

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onConstraintRemoved + + +Phaser.Signal + + + +

    Dispatched when a Constraint is removed from the World.

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

    onContactMaterialAdded

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onContactMaterialAdded + + +Phaser.Signal + + + +

    Dispatched when a new ContactMaterial is added to the World.

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

    onContactMaterialRemoved

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onContactMaterialRemoved + + +Phaser.Signal + + + +

    Dispatched when a ContactMaterial is removed from the World.

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

    onEndContact

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onEndContact + + +Phaser.Signal + + + +

    Dispatched when final contact occurs between two bodies. This event is fired before the step has been done.

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

    onImpact

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onImpact + + +Phaser.Signal + + + +

    Dispatched when a first contact is created between two bodies. This event is fired after the step has been done.

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

    onPostBroadphase

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onPostBroadphase + + +Phaser.Signal + + + +

    Dispatched after the Broadphase has collected collision pairs in the world.

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

    onPostStep

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onPostStep + + +Phaser.Signal + + + +

    Dispatched after the World.step()

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

    onSpringAdded

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onSpringAdded + + +Phaser.Signal + + + +

    Dispatched when a new Spring is added to the World.

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

    onSpringRemoved

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    onSpringRemoved + + +Phaser.Signal + + + +

    Dispatched when a Spring is removed from the World.

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

    restituion

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    restitution + + +number + + + +

    Default coefficient of restitution between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair.

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

    solveConstraints

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    solveConstraints + + +boolean + + + +

    Enable/disable constraint solving in each step.

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

    <readonly> time

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    time + + +boolean + + + +

    The World time.

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

    <protected> world

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +p2.World + + + +

    The p2 World in which the simulation is run.

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

    Methods

    + +
    + +
    +

    addBody(body) → {boolean}

    + + +
    +
    + + +
    +

    Add a body to the world.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body + + +Phaser.Physics.Body + + + +

    The Body to add to the World.

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

    True if the Body was added successfully, otherwise false.

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

    addConstraint(constraint) → {Phaser.Physics.Constraint}

    + + +
    +
    + + +
    +

    Adds a Constraint to the world.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    constraint + + +Phaser.Physics.Constraint + + + +

    The Constraint to add to the World.

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

    The Constraint that was added.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.Constraint + + +
    +
    + + + + + +
    + + + +
    +

    addContactMaterial(material) → {Phaser.Physics.ContactMaterial}

    + + +
    +
    + + +
    +

    Adds a Contact Material to the world.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    material + + +Phaser.Physics.ContactMaterial + + + +

    The Contact Material to be added to the World.

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

    The Contact Material that was added.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.ContactMaterial + + +
    +
    + + + + + +
    + + + +
    +

    addSpring(spring) → {Phaser.Physics.Spring}

    + + +
    +
    + + +
    +

    Adds a Spring to the world.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    spring + + +Phaser.Physics.Spring + + + +

    The Spring to add to the World.

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

    The Spring that was added.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.Spring + + +
    +
    + + + + + +
    + + + +
    +

    createBody(x, y, mass, addToWorld, options, points)

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

    The x coordinate of Body.

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

    The y coordinate of Body.

    mass + + +number + + + + + + + + + + + +

    The mass of the Body. A mass of 0 means a 'static' Body is created.

    addToWorld + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Automatically add this Body to the world? (usually false as it won't have any shapes on construction).

    options + + +object + + + + + + + + + + + +

    An object containing the build options:

    +
    Properties
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    optimalDecomp + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.

    skipSimpleCheck + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you already know that the path is not intersecting itself.

    removeCollinearPoints + + +boolean +| + +number + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to a number (angle threshold value) to remove collinear points, or false to keep all points.

    + +
    points + + +Array.<number> +| + +number + + + + + + + + + + + +

    An array of 2d vectors that form the convex or concave polygon. + Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + or the arguments passed can be flat x,y values e.g. setPolygon(options, x,y, x,y, x,y, ...) where x and y are numbers.

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

    createBody(x, y, mass, addToWorld, options, points)

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

    The x coordinate of Body.

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

    The y coordinate of Body.

    mass + + +number + + + + + + + + + + + +

    The mass of the Body. A mass of 0 means a 'static' Body is created.

    addToWorld + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Automatically add this Body to the world? (usually false as it won't have any shapes on construction).

    options + + +object + + + + + + + + + + + +

    An object containing the build options:

    +
    Properties
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    optimalDecomp + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.

    skipSimpleCheck + + +boolean + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to true if you already know that the path is not intersecting itself.

    removeCollinearPoints + + +boolean +| + +number + + + + + + <optional>
    + + + + + +
    + + false + +

    Set to a number (angle threshold value) to remove collinear points, or false to keep all points.

    + +
    points + + +Array.<number> +| + +number + + + + + + + + + + + +

    An array of 2d vectors that form the convex or concave polygon. + Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + or the arguments passed can be flat x,y values e.g. setPolygon(options, x,y, x,y, x,y, ...) where x and y are numbers.

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

    createContactMaterial(materialA, materialB, options) → {Phaser.Physics.ContactMaterial}

    + + +
    +
    + + +
    +

    Creates a Contact Material from the two given Materials. You can then edit the properties of the Contact Material directly.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    materialA + + +Phaser.Physics.Material + + + + + + <optional>
    + + + + + +

    The first Material to create the ContactMaterial from. If undefined it will create a new Material object first.

    materialB + + +Phaser.Physics.Material + + + + + + <optional>
    + + + + + +

    The second Material to create the ContactMaterial from. If undefined it will create a new Material object first.

    options + + +object + + + + + + <optional>
    + + + + + +

    Material options object.

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

    The Contact Material that was created.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.ContactMaterial + + +
    +
    + + + + + +
    + + + +
    +

    createMaterial(name, body) → {Phaser.Physics.Material}

    + + +
    +
    + + +
    +

    Creates a Material. Materials are applied to Shapes owned by a Body and can be set with Body.setMaterial(). +Materials are a way to control what happens when Shapes collide. Combine unique Materials together to create Contact Materials. +Contact Materials have properties such as friction and restitution that allow for fine-grained collision control between different Materials.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDescription
    name + + +string + + + + + + <optional>
    + + + + + +

    Optional name of the Material. Each Material has a unique ID but string names are handy for debugging.

    body + + +Phaser.Physics.Body + + + + + + <optional>
    + + + + + +

    Optional Body. If given it will assign the newly created Material to the Body shapes.

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

    The Material that was created. This is also stored in Phaser.Physics.World.materials.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.Material + + +
    +
    + + + + + +
    + + + +
    +

    destroy()

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

    getBodies() → {array.<Phaser.Physics.Body>}

    + + +
    +
    + + +
    +

    Populates and returns an array of all current Bodies in the world.

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

    An array containing all current Bodies in the world.

    +
    + + + +
    +
    + Type +
    +
    + +array.<Phaser.Physics.Body> + + +
    +
    + + + + + +
    + + + +
    +

    getConstraints() → {array.<Phaser.Physics.Constraints>}

    + + +
    +
    + + +
    +

    Populates and returns an array of all current Constraints in the world.

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

    An array containing all current Constraints in the world.

    +
    + + + +
    +
    + Type +
    +
    + +array.<Phaser.Physics.Constraints> + + +
    +
    + + + + + +
    + + + +
    +

    getContactMaterial(materialA, materialB) → {Phaser.Physics.ContactMaterial|boolean}

    + + +
    +
    + + +
    +

    Gets a Contact Material based on the two given Materials.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    materialA + + +Phaser.Physics.Material + + + +

    The first Material to search for.

    materialB + + +Phaser.Physics.Material + + + +

    The second Material to search for.

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

    The Contact Material or false if none was found matching the Materials given.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.ContactMaterial +| + +boolean + + +
    +
    + + + + + +
    + + + +
    +

    getSprings() → {array.<Phaser.Physics.Spring>}

    + + +
    +
    + + +
    +

    Populates and returns an array of all current Springs in the world.

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

    An array containing all current Springs in the world.

    +
    + + + +
    +
    + Type +
    +
    + +array.<Phaser.Physics.Spring> + + +
    +
    + + + + + +
    + + + +
    +

    hitTest(worldPoint, bodies, precision) → {Array}

    + + +
    +
    + + +
    +

    Test if a world point overlaps bodies.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    worldPoint + + +Phaser.Point + + + +

    Point to use for intersection tests.

    bodies + + +Array + + + +

    A list of objects to check for intersection.

    precision + + +number + + + +

    Used for matching against particles and lines. Adds some margin to these infinitesimal objects.

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

    Array of bodies that overlap the point.

    +
    + + + +
    +
    + Type +
    +
    + +Array + + +
    +
    + + + + + +
    + + + +
    +

    removeBody(body) → {Phaser.Physics.Body}

    + + +
    +
    + + +
    +

    Removes a body from the world.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    body + + +Phaser.Physics.Body + + + +

    The Body to remove from the World.

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

    The Body that was removed.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.Body + + +
    +
    + + + + + +
    + + + +
    +

    removeConstraint(constraint) → {Phaser.Physics.Constraint}

    + + +
    +
    + + +
    +

    Removes a Constraint from the world.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    constraint + + +Phaser.Physics.Constraint + + + +

    The Constraint to be removed from the World.

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

    The Constraint that was removed.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.Constraint + + +
    +
    + + + + + +
    + + + +
    +

    removeContactMaterial(material) → {Phaser.Physics.ContactMaterial}

    + + +
    +
    + + +
    +

    Removes a Contact Material from the world.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    material + + +Phaser.Physics.ContactMaterial + + + +

    The Contact Material to be removed from the World.

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

    The Contact Material that was removed.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.ContactMaterial + + +
    +
    + + + + + +
    + + + +
    +

    removeSpring(spring) → {Phaser.Physics.Spring}

    + + +
    +
    + + +
    +

    Removes a Spring from the world.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    spring + + +Phaser.Physics.Spring + + + +

    The Spring to remove from the World.

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

    The Spring that was removed.

    +
    + + + +
    +
    + Type +
    +
    + +Phaser.Physics.Spring + + +
    +
    + + + + + +
    + + + +
    +

    setBounds(x, y, width, height, left, right, top, bottom, setCollisionGroup)

    + + +
    +
    + + +
    +

    Sets the bounds of the Physics world to match the given world pixel dimensions. +You can optionally set which 'walls' to create: left, right, top or bottom.

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

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

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

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

    width + + +number + + + + + + + + + + + +

    The width of the bounds.

    height + + +number + + + + + + + + + + + +

    The height of the bounds.

    left + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the left bounds wall.

    right + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the right bounds wall.

    top + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the top bounds wall.

    bottom + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the bottom bounds wall.

    setCollisionGroup + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true the Bounds will be set to use its own Collision Group.

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

    setMaterial(material, bodies)

    + + +
    +
    + + +
    +

    Sets the given Material against all Shapes owned by all the Bodies in the given array.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    material + + +Phaser.Physics.Material + + + +

    The Material to be applied to the given Bodies.

    bodies + + +array.<Phaser.Physics.Body> + + + +

    An Array of Body objects that the given Material will be set on.

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

    toJSON() → {object}

    + + +
    +
    + + +
    +

    Converts the current world into a JSON object.

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

    A JSON representation of the world.

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

    update()

    + + +
    +
    + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.html b/docs/Phaser.Physics.html index f2e26909f..b43c63565 100644 --- a/docs/Phaser.Physics.html +++ b/docs/Phaser.Physics.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -545,13 +581,1483 @@
    Arcade
    + +
    Body
    +
    + +
    CollisionGroup
    +
    + +
    ContactMaterial
    +
    + +
    InversePointProxy
    +
    + +
    Material
    +
    + +
    PointProxy
    +
    + +
    Spring
    +
    + +
    World
    +
    +

    Members

    +
    + +
    +

    <static, constant> LIME_CORONA_JSON :number

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

    Methods

    + +
    + +
    +

    setBoundsToWorld(left, right, top, bottom, setCollisionGroup)

    + + +
    +
    + + +
    +

    Sets the bounds of the Physics world to match the Game.World dimensions. +You can optionally set which 'walls' to create: left, right, top or bottom.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    left + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the left bounds wall.

    right + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the right bounds wall.

    top + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the top bounds wall.

    bottom + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the bottom bounds wall.

    setCollisionGroup + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true the Bounds will be set to use its own Collision Group.

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

    setWorldMaterial(material, left, right, top, bottom)

    + + +
    +
    + + +
    +

    Sets the given material against the 4 bounds of this World.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    material + + +Phaser.Physics.Material + + + + + + + + + + + +

    The material to set.

    left + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will set the material on the left bounds wall.

    right + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will set the material on the right bounds wall.

    top + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will set the material on the top bounds wall.

    bottom + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will set the material on the bottom bounds wall.

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

    Class: Physics

    +
    + +
    +

    + Phaser. + + Physics +

    + +
    + +
    +
    + + + + +
    +

    new Physics()

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

    Classes

    + +
    +
    Arcade
    +
    + +
    Body
    +
    + +
    CollisionGroup
    +
    + +
    ContactMaterial
    +
    + +
    InversePointProxy
    +
    + +
    Material
    +
    + +
    PointProxy
    +
    + +
    Spring
    +
    + +
    World
    +
    +
    + + + + + +

    Members

    + +
    + +
    +

    <static, constant> LIME_CORONA_JSON :number

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

    Methods

    + +
    + +
    +

    setBoundsToWorld(left, right, top, bottom, setCollisionGroup)

    + + +
    +
    + + +
    +

    Sets the bounds of the Physics world to match the Game.World dimensions. +You can optionally set which 'walls' to create: left, right, top or bottom.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    left + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the left bounds wall.

    right + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the right bounds wall.

    top + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the top bounds wall.

    bottom + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will create the bottom bounds wall.

    setCollisionGroup + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true the Bounds will be set to use its own Collision Group.

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

    setWorldMaterial(material, left, right, top, bottom)

    + + +
    +
    + + +
    +

    Sets the given material against the 4 bounds of this World.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    material + + +Phaser.Physics.Material + + + + + + + + + + + +

    The material to set.

    left + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will set the material on the left bounds wall.

    right + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will set the material on the right bounds wall.

    top + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will set the material on the top bounds wall.

    bottom + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    If true will set the material on the bottom bounds wall.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    @@ -577,7 +2083,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:29 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Plugin.html b/docs/Phaser.Plugin.html index eb7dbfeb6..93e78c8af 100644 --- a/docs/Phaser.Plugin.html +++ b/docs/Phaser.Plugin.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1944,7 +1980,7 @@ It is only called if active is set to true.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:29 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.PluginManager.html b/docs/Phaser.PluginManager.html index 4fc191e13..9bcb5f320 100644 --- a/docs/Phaser.PluginManager.html +++ b/docs/Phaser.PluginManager.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1609,7 +1645,7 @@ It only calls plugins who have active=true.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:29 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Point.html b/docs/Phaser.Point.html index 622577880..8a39d1411 100644 --- a/docs/Phaser.Point.html +++ b/docs/Phaser.Point.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -5469,7 +5505,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:30 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Pointer.html b/docs/Phaser.Pointer.html index 18255a3b8..2bf4fc017 100644 --- a/docs/Phaser.Pointer.html +++ b/docs/Phaser.Pointer.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -4447,7 +4483,7 @@ If you wish to check if the Pointer was released just once then see the Sprite.e Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:30 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Polygon.html b/docs/Phaser.Polygon.html index 59526d5c2..bfba0ab31 100644 --- a/docs/Phaser.Polygon.html +++ b/docs/Phaser.Polygon.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1102,7 +1138,7 @@ arguments passed can be flat x,y values e.g. new Phaser.Polygon(x,y, x,y, Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:30 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.RandomDataGenerator.html b/docs/Phaser.RandomDataGenerator.html index 14e8f03f4..1abc018c8 100644 --- a/docs/Phaser.RandomDataGenerator.html +++ b/docs/Phaser.RandomDataGenerator.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2075,7 +2111,7 @@ Random number generator from Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:30 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Rectangle.html b/docs/Phaser.Rectangle.html index 14a4822ea..ec1300ea2 100644 --- a/docs/Phaser.Rectangle.html +++ b/docs/Phaser.Rectangle.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -7672,7 +7708,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:30 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.RenderTexture.html b/docs/Phaser.RenderTexture.html index 7b369a480..95788e6da 100644 --- a/docs/Phaser.RenderTexture.html +++ b/docs/Phaser.RenderTexture.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1040,6 +1076,526 @@ +

    Methods

    + +
    + +
    +

    render(displayObject, position, clear)

    + + +
    +
    + + +
    +

    This function will draw the display object to the texture.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    displayObject + + +Phaser.Sprite +| + +Phaser.Image +| + +Phaser.Text +| + +Phaser.BitmapText +| + +Phaser.Group + + + +

    The display object to render to this texture.

    position + + +Phaser.Point + + + +

    A Point object containing the position to render the display object at.

    clear + + +boolean + + + +

    If true the texture will be cleared before the display object is drawn.

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

    renderXY(displayObject, x, y, clear)

    + + +
    +
    + + +
    +

    This function will draw the display object to the texture.

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    displayObject + + +Phaser.Sprite +| + +Phaser.Image +| + +Phaser.Text +| + +Phaser.BitmapText +| + +Phaser.Group + + + +

    The display object to render to this texture.

    x + + +number + + + +

    The x position to render the object at.

    y + + +number + + + +

    The y position to render the object at.

    clear + + +boolean + + + +

    If true the texture will be cleared before the display object is drawn.

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

    resize(width, height)

    + + +
    +
    + + +
    +

    Resize this RenderTexture to the given width and height.

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

    The new width of the RenderTexture.

    height + + +number + + + +

    The new height of the RenderTexture.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + + +
    + +
    + @@ -1064,7 +1620,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:30 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.RequestAnimationFrame.html b/docs/Phaser.RequestAnimationFrame.html index 69f81237b..f4611c867 100644 --- a/docs/Phaser.RequestAnimationFrame.html +++ b/docs/Phaser.RequestAnimationFrame.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -470,7 +506,7 @@
    -

    new RequestAnimationFrame(game)

    +

    new RequestAnimationFrame(game, forceSetTimeOut)

    @@ -500,8 +536,12 @@ Type + Argument + + Default + Description @@ -525,13 +565,64 @@ + + + + + + + + + + + +

    A reference to the currently running game.

    + + + + forceSetTimeOut + + + + + +boolean + + + + + + + + + <optional>
    + + + + + + + + + + + + false + + + + +

    Tell Phaser to use setTimeOut even if raf is available.

    + + + @@ -560,7 +651,7 @@
    Source:
    @@ -603,6 +694,108 @@
    +
    +

    forceSetTimeOut

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    forceSetTimeOut + + +boolean + + + +

    Tell Phaser to use setTimeOut even if raf is available.

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

    game

    @@ -688,7 +881,7 @@
    Source:
    @@ -793,7 +986,7 @@
    Source:
    @@ -858,7 +1051,7 @@
    Source:
    @@ -946,7 +1139,7 @@
    Source:
    @@ -1034,7 +1227,7 @@
    Source:
    @@ -1103,7 +1296,7 @@
    Source:
    @@ -1221,7 +1414,7 @@
    Source:
    @@ -1290,7 +1483,7 @@
    Source:
    @@ -1341,7 +1534,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:30 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Signal.html b/docs/Phaser.Signal.html index 1c6e73c3a..18afda0bf 100644 --- a/docs/Phaser.Signal.html +++ b/docs/Phaser.Signal.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2326,7 +2362,7 @@ IMPORTANT: should be called only during signal dispatch, calling it before/after Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:30 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.SinglePad.html b/docs/Phaser.SinglePad.html index e9b43d7b7..251dff3a1 100644 --- a/docs/Phaser.SinglePad.html +++ b/docs/Phaser.SinglePad.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2103,6 +2139,289 @@ The Key object can then be polled, have events attached to it, etc.

    +
    + + + +
    +

    addCallbacks(context, callbacks)

    + + +
    +
    + + +
    +

    Add callbacks to the this Gamepad to handle connect/disconnect/button down/button up/axis change/float value buttons

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    context + + +Object + + + +

    The context under which the callbacks are run.

    callbacks + + +Object + + + +

    Object that takes six different callbak methods: +onConnectCallback, onDisconnectCallback, onDownCallback, onUpCallback, onAxisCallback, onFloatCallback

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

    axis(axisCode) → {number}

    + + +
    +
    + + +
    +

    Returns value of requested axis

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    axisCode + + +number + + + +

    The index of the axis to check

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

    Axis value if available otherwise false

    +
    + + + +
    +
    + Type +
    +
    + +number + + +
    +
    + + + + +
    @@ -2432,147 +2751,6 @@ analog trigger buttons on the XBOX 360 controller

    - - - - -
    -

    isDown(axisCode) → {number}

    - - -
    -
    - - -
    -

    Returns value of requested axis

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    axisCode - - -number - - - -

    The index of the axis to check

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    Axis value if available otherwise false

    -
    - - - -
    -
    - Type -
    -
    - -number - - -
    -
    - - - - -
    @@ -2714,202 +2892,6 @@ analog trigger buttons on the XBOX 360 controller

    - - - - -
    -

    justPressed(buttonCode, duration) → {boolean}

    - - -
    -
    - - -
    -

    Returns the "just released" state of a button from this gamepad. Just released is considered as being true if the button was released within the duration given (default 250ms).

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeArgumentDefaultDescription
    buttonCode - - -number - - - - - - - - - - - -

    The buttonCode of the button to check for.

    duration - - -number - - - - - - <optional>
    - - - - - -
    - - 250 - -

    The duration below which the button is considered as being just released.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    True if the button is just released otherwise false.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - -
    @@ -3106,6 +3088,202 @@ analog trigger buttons on the XBOX 360 controller

    + + + + +
    +

    justReleased(buttonCode, duration) → {boolean}

    + + +
    +
    + + +
    +

    Returns the "just released" state of a button from this gamepad. Just released is considered as being true if the button was released within the duration given (default 250ms).

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    buttonCode + + +number + + + + + + + + + + + +

    The buttonCode of the button to check for.

    duration + + +number + + + + + + <optional>
    + + + + + +
    + + 250 + +

    The duration below which the button is considered as being just released.

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

    True if the button is just released otherwise false.

    +
    + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    + + + + +
    @@ -3813,7 +3991,7 @@ analog trigger buttons on the XBOX 360 controller

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:31 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Sound.html b/docs/Phaser.Sound.html index 5851b38fc..e5f9ed408 100644 --- a/docs/Phaser.Sound.html +++ b/docs/Phaser.Sound.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -5837,7 +5873,7 @@ This allows you to bundle multiple sounds together into a single audio file and Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:31 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.SoundManager.html b/docs/Phaser.SoundManager.html index 0a3233fe8..55cac1106 100644 --- a/docs/Phaser.SoundManager.html +++ b/docs/Phaser.SoundManager.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2895,7 +2931,7 @@ Note: On Firefox 25+ on Linux if you have media.gstreamer disabled in about:conf Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:31 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Sprite.html b/docs/Phaser.Sprite.html index cf18d6cc3..8475e04b5 100644 --- a/docs/Phaser.Sprite.html +++ b/docs/Phaser.Sprite.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -663,7 +699,7 @@ events (via Sprite.events), animation (via Sprite.animations), camera culling an
    Source:
    @@ -692,6 +728,12 @@ events (via Sprite.events), animation (via Sprite.animations), camera culling an +

    Extends

    + +
      +
    • PIXI.Sprite
    • +
    + @@ -797,7 +839,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -899,7 +941,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -1010,7 +1052,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1073,7 +1115,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun -Phaser.Physics.Body +Phaser.Physics.Body | null @@ -1115,7 +1157,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1217,7 +1259,7 @@ Be advised this is quite an expensive operation, as it has to calculate the boun
    Source:
    @@ -1328,7 +1370,7 @@ bounds every frame to support it, and not all games need it. Enable it by settin
    Source:
    @@ -1433,7 +1475,7 @@ bounds every frame to support it, and not all games need it. Enable it by settin
    Source:
    @@ -1539,7 +1581,7 @@ bounds every frame to support it, and not all games need it. Enable it by settin
    Source:
    @@ -1645,7 +1687,7 @@ bounds every frame to support it, and not all games need it. Enable it by settin
    Source:
    @@ -1751,7 +1793,7 @@ bounds every frame to support it, and not all games need it. Enable it by settin
    Source:
    @@ -1853,7 +1895,7 @@ bounds every frame to support it, and not all games need it. Enable it by settin
    Source:
    @@ -1961,7 +2003,7 @@ Setting Sprite.exists to true will re-add the Body to the physics world (if it h
    Source:
    @@ -2069,7 +2111,7 @@ So if this Sprite was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2171,7 +2213,7 @@ So if this Sprite was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2273,7 +2315,7 @@ So if this Sprite was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2375,7 +2417,7 @@ So if this Sprite was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2477,7 +2519,7 @@ So if this Sprite was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2583,7 +2625,7 @@ So if this Sprite was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2688,7 +2730,7 @@ So if this Sprite was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2795,7 +2837,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2901,7 +2943,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3012,7 +3054,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3122,7 +3164,7 @@ The lifespan is decremented by game.time.elapsed each update, once it reaches ze
    Source:
    @@ -3224,7 +3266,7 @@ The lifespan is decremented by game.time.elapsed each update, once it reaches ze
    Source:
    @@ -3329,7 +3371,7 @@ The lifespan is decremented by game.time.elapsed each update, once it reaches ze
    Source:
    @@ -3439,7 +3481,7 @@ If you need a different result then adjust or re-create the Body shape offsets m
    Source:
    @@ -3541,7 +3583,7 @@ If you need a different result then adjust or re-create the Body shape offsets m
    Source:
    @@ -3643,7 +3685,7 @@ If you need a different result then adjust or re-create the Body shape offsets m
    Source:
    @@ -3745,7 +3787,7 @@ If you need a different result then adjust or re-create the Body shape offsets m
    Source:
    @@ -3811,7 +3853,7 @@ bought to the top of that Group, not the entire display list.

    Source:
    @@ -3941,7 +3983,7 @@ Cropping takes place from the top-left of the Sprite and can be modified in real
    Source:
    @@ -4060,7 +4102,7 @@ If health is then taken below zero Sprite.kill is called.

    Source:
    @@ -4094,75 +4136,6 @@ If health is then taken below zero Sprite.kill is called.

    - - - - -
    -

    destroy()

    - - -
    -
    - - -
    -

    Destroy this Graphics instance.

    -
    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - -
    @@ -4210,77 +4183,7 @@ and nulls its reference to game, freeing it up for garbage collection.

    Source:
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    drawPolygon()

    - - -
    -
    - - -
    -

    /* -Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled

    -
    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    @@ -4352,7 +4255,7 @@ If you don't need this Sprite any more you should call Sprite.destroy instead.Source:
    @@ -4517,7 +4420,7 @@ This causes a WebGL texture update, so use sparingly or in low-intensity portion
    Source:
    @@ -4769,7 +4672,7 @@ If the requested animation is already playing this request will be ignored. If y
    Source:
    @@ -4861,7 +4764,7 @@ If the requested animation is already playing this request will be ignored. If y
    Source:
    @@ -4930,7 +4833,7 @@ If the requested animation is already playing this request will be ignored. If y
    Source:
    @@ -5163,7 +5066,7 @@ If the Sprite has a physics body that too is reset.

    Source:
    @@ -5314,7 +5217,7 @@ It will dispatch the onRevived event, you can listen to Sprite.events.onRevived
    Source:
    @@ -5394,7 +5297,7 @@ It will dispatch the onRevived event, you can listen to Sprite.events.onRevived
    Source:
    @@ -5445,7 +5348,7 @@ It will dispatch the onRevived event, you can listen to Sprite.events.onRevived Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:31 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.SpriteBatch.html b/docs/Phaser.SpriteBatch.html index 41be5c716..35553d3dc 100644 --- a/docs/Phaser.SpriteBatch.html +++ b/docs/Phaser.SpriteBatch.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -834,7 +870,7 @@
    Source:
    @@ -941,7 +977,7 @@
    Source:
    @@ -1053,7 +1089,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1160,7 +1196,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1272,7 +1308,7 @@ The cursor is set to the first child added to the Group and doesn't change unles
    Source:
    @@ -1382,7 +1418,7 @@ The cursor is set to the first child added to the Group and doesn't change unles
    Source:
    @@ -1495,7 +1531,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1602,7 +1638,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1709,7 +1745,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1816,7 +1852,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1928,7 +1964,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2035,7 +2071,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2142,7 +2178,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2351,7 +2387,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2463,7 +2499,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -2575,7 +2611,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -2696,7 +2732,7 @@ that then see the addAt method.

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

    Source:
    @@ -3068,7 +3104,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -3214,7 +3250,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -3453,7 +3489,7 @@ After the method parameter and context you can add as many extra parameters as y
    Source:
    @@ -3651,7 +3687,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -3820,7 +3856,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -3894,7 +3930,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -3991,7 +4027,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -4303,7 +4339,7 @@ Useful if you don't need to create the Sprite instances before-hand.

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

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

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

    Source:
    @@ -5089,7 +5125,7 @@ Note: Currently this will skip any children which are Groups themselves.

    Source:
    @@ -5237,155 +5273,7 @@ For example: Group.forEachAlive(causeDamage, this, 500)

    Source:
    - - - - - - - -
    - - - - - - - - - - - - - -
    - - - -
    -

    forEachAlive(callback, callbackContext)

    - - -
    -
    - - -
    -

    Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. -You can add as many parameters as you like, which will all be passed to the callback along with the child. -For example: Group.forEachAlive(causeDamage, this, 500)

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    callback - - -function - - - -

    The function that will be called. Each child of the Group will be passed to it as its first parameter.

    callbackContext - - -Object - - - -

    The context in which the function should be called (usually 'this').

    - - - - -
    - - - - - - - -
    Inherited From:
    -
    - - - - - - - - - - - - - -
    Source:
    -
    @@ -5533,7 +5421,155 @@ For example: Group.forEachDead(bringToLife, this)

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

    forEachExists(callback, callbackContext)

    + + +
    +
    + + +
    +

    Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. +You can add as many parameters as you like, which will all be passed to the callback along with the child. +For example: Group.forEachExists(causeDamage, this, 500)

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

    The function that will be called. Each child of the Group will be passed to it as its first parameter.

    callbackContext + + +Object + + + +

    The context in which the function should be called (usually 'this').

    + + + + +
    + + + + + + + +
    Inherited From:
    +
    + + + + + + + + + + + + + +
    Source:
    +
    @@ -5656,7 +5692,7 @@ For example: Group.forEachDead(bringToLife, this)

    Source:
    @@ -5754,7 +5790,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -5852,7 +5888,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -5998,7 +6034,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6144,7 +6180,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6313,7 +6349,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6623,7 +6659,7 @@ You can add as many callback parameters as you like, which will all be passed to
    Source:
    @@ -6839,7 +6875,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.

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

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

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

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

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

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

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

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

    Source:
    @@ -7975,7 +8011,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -8267,7 +8303,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -8515,7 +8551,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -8698,7 +8734,7 @@ For example to depth sort Sprites for Zelda-style game you might call grou
    Source:
    @@ -8891,7 +8927,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -9038,7 +9074,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
    Source:
    @@ -9112,7 +9148,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
    Source:
    @@ -9163,7 +9199,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:31 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Stage.html b/docs/Phaser.Stage.html index b325f73ca..3e0a12ade 100644 --- a/docs/Phaser.Stage.html +++ b/docs/Phaser.Stage.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1939,7 +1975,7 @@ Most objects have preUpdate methods and it's where initial movement and position Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:31 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.StageScaleMode.html b/docs/Phaser.StageScaleMode.html index 889cdf36a..ef73be97b 100644 --- a/docs/Phaser.StageScaleMode.html +++ b/docs/Phaser.StageScaleMode.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -5228,7 +5264,7 @@ Please note that this needs to be supported by the web browser and isn't the sam Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:31 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.State.html b/docs/Phaser.State.html index 54a31fad1..2344d187c 100644 --- a/docs/Phaser.State.html +++ b/docs/Phaser.State.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2606,7 +2642,7 @@ If you need to use the loader, you may need to use them here.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:32 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.StateManager.html b/docs/Phaser.StateManager.html index 3c0bf0920..4cf5f8665 100644 --- a/docs/Phaser.StateManager.html +++ b/docs/Phaser.StateManager.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2341,7 +2377,7 @@ State must exist and have at least one callback function registered..

    Source:
    @@ -2410,7 +2446,7 @@ State must exist and have at least one callback function registered..

    Source:
    @@ -2604,7 +2640,7 @@ State must exist and have at least one callback function registered..

    Source:
    @@ -2669,7 +2705,7 @@ State must exist and have at least one callback function registered..

    Source:
    @@ -2734,7 +2770,7 @@ State must exist and have at least one callback function registered..

    Source:
    @@ -2917,7 +2953,7 @@ State must exist and have at least one callback function registered..

    Source:
    @@ -2982,7 +3018,7 @@ State must exist and have at least one callback function registered..

    Source:
    @@ -3259,7 +3295,7 @@ State must exist and have at least one callback function registered..

    Source:
    @@ -3310,7 +3346,7 @@ State must exist and have at least one callback function registered..

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:32 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Text.html b/docs/Phaser.Text.html index 6d75216e4..584e5b3b1 100644 --- a/docs/Phaser.Text.html +++ b/docs/Phaser.Text.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -478,7 +514,9 @@
    -

    Create a new Text object.

    +

    Create a new Text object. This uses a local hidden Canvas object and renders the type into it. It then makes a texture from this for renderning to the view. +Because of this you can only display fonts that are currently loaded and available to the browser. It won't load the fonts for you. +Here is a compatibility table showing the available default fonts across different mobile browsers: http://www.jordanm.co.uk/tinytype

    @@ -652,7 +690,7 @@
    Source:
    @@ -681,6 +719,12 @@ +

    Extends

    + +
      +
    • PIXI.Text
    • +
    + @@ -780,7 +824,7 @@
    Source:
    @@ -888,7 +932,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -990,7 +1034,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -1092,7 +1136,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -1197,7 +1241,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -1299,7 +1343,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -1407,7 +1451,7 @@ So if this Text was in a Group that has x: 200, then this will be added to the c
    Source:
    @@ -1509,7 +1553,7 @@ So if this Text was in a Group that has x: 200, then this will be added to the c
    Source:
    @@ -1611,7 +1655,7 @@ So if this Text was in a Group that has x: 200, then this will be added to the c
    Source:
    @@ -1713,7 +1757,7 @@ So if this Text was in a Group that has x: 200, then this will be added to the c
    Source:
    @@ -1815,7 +1859,7 @@ So if this Text was in a Group that has x: 200, then this will be added to the c
    Source:
    @@ -1920,7 +1964,7 @@ So if this Text was in a Group that has x: 200, then this will be added to the c
    Source:
    @@ -2027,7 +2071,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2129,7 +2173,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2231,7 +2275,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2333,7 +2377,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2435,7 +2479,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2537,7 +2581,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2639,7 +2683,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2741,7 +2785,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2843,7 +2887,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -2949,7 +2993,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3051,7 +3095,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3153,7 +3197,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3255,7 +3299,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3357,7 +3401,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3418,7 +3462,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3487,7 +3531,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3556,7 +3600,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -3807,7 +3851,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -4240,7 +4284,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -4309,7 +4353,7 @@ activated for this object and it will then start to process click/touch events a
    Source:
    @@ -4360,7 +4404,7 @@ activated for this object and it will then start to process click/touch events a Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:32 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Tile.html b/docs/Phaser.Tile.html index e92d0bf63..4d1a6ec1f 100644 --- a/docs/Phaser.Tile.html +++ b/docs/Phaser.Tile.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -4003,7 +4039,7 @@ The callback must true true for collision processing to take place.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:32 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TileSprite.html b/docs/Phaser.TileSprite.html index d822bdc16..a692a5d91 100644 --- a/docs/Phaser.TileSprite.html +++ b/docs/Phaser.TileSprite.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -845,7 +881,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
    Source:
    @@ -1259,7 +1295,7 @@ So if this TileSprite was in a Group that has x: 200, then this will be added to
    Source:
    @@ -1361,7 +1397,7 @@ So if this TileSprite was in a Group that has x: 200, then this will be added to
    Source:
    @@ -1463,7 +1499,7 @@ So if this TileSprite was in a Group that has x: 200, then this will be added to
    Source:
    @@ -2526,7 +2562,7 @@ If the requested animation is already playing this request will be ignored. If y
    Source:
    @@ -2876,7 +2912,7 @@ If the requested animation is already playing this request will be ignored. If y Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:33 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Tilemap.html b/docs/Phaser.Tilemap.html index 3e920abbd..53b74e558 100644 --- a/docs/Phaser.Tilemap.html +++ b/docs/Phaser.Tilemap.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -10959,7 +10995,7 @@ If you want to set a callback for a tile at a specific location on the map then Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:32 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TilemapLayer.html b/docs/Phaser.TilemapLayer.html index 3c724fe2b..3ee341c37 100644 --- a/docs/Phaser.TilemapLayer.html +++ b/docs/Phaser.TilemapLayer.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -4638,7 +4674,7 @@ half as quickly as the 'normal' camera-locked layers do)

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:32 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TilemapParser.html b/docs/Phaser.TilemapParser.html index 8c8108792..f6f5793d2 100644 --- a/docs/Phaser.TilemapParser.html +++ b/docs/Phaser.TilemapParser.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -655,7 +691,7 @@
    -

    Parse tileset data from the cache and creates a Tileset object.

    +

    Parse tilemap data from the cache and creates a Tilemap object.

    @@ -1573,7 +1609,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:32 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Tileset.html b/docs/Phaser.Tileset.html index c2c0f642e..557a06a2a 100644 --- a/docs/Phaser.Tileset.html +++ b/docs/Phaser.Tileset.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2640,7 +2676,7 @@ You should not normally instantiate this class directly.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:33 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Time.html b/docs/Phaser.Time.html index 0c5e9aa4a..543419d36 100644 --- a/docs/Phaser.Time.html +++ b/docs/Phaser.Time.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -3120,7 +3156,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:33 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Timer.html b/docs/Phaser.Timer.html index d703b0b37..72e430770 100644 --- a/docs/Phaser.Timer.html +++ b/docs/Phaser.Timer.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -3784,7 +3820,7 @@ If the Timer is already running the delay will be calculated based on the timers Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:33 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TimerEvent.html b/docs/Phaser.TimerEvent.html index 54261eb9c..68696d965 100644 --- a/docs/Phaser.TimerEvent.html +++ b/docs/Phaser.TimerEvent.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1709,7 +1745,7 @@ It can call a specific callback, passing in optional parameters.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:33 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Touch.html b/docs/Phaser.Touch.html index b79e8f9a7..5f77cf040 100644 --- a/docs/Phaser.Touch.html +++ b/docs/Phaser.Touch.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -2679,7 +2715,7 @@ Doesn't appear to be supported by most browsers on a canvas element yet.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:33 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Tween.html b/docs/Phaser.Tween.html index 9fa9f675a..1c051b466 100644 --- a/docs/Phaser.Tween.html +++ b/docs/Phaser.Tween.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -3168,7 +3204,7 @@ Used in combination with repeat you can create endless loops.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:33 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TweenManager.html b/docs/Phaser.TweenManager.html index 9d2525ea6..0a9df2696 100644 --- a/docs/Phaser.TweenManager.html +++ b/docs/Phaser.TweenManager.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1227,6 +1263,75 @@ Please see https://github.com/sole/tw +
    + + + +
    +

    pauseAll()

    + + +
    +
    + + +
    +

    Pauses all currently running tweens.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + +
    @@ -1575,75 +1680,6 @@ Please see https://github.com/sole/tw - - - - -
    -

    update()

    - - -
    -
    - - -
    -

    Pauses all currently running tweens.

    -
    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - -
    @@ -1672,7 +1708,7 @@ Please see https://github.com/sole/tw Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:33 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Utils.Debug.html b/docs/Phaser.Utils.Debug.html index 1983e6d4a..ecec4f96b 100644 --- a/docs/Phaser.Utils.Debug.html +++ b/docs/Phaser.Utils.Debug.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1950,7 +1986,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2193,7 +2229,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2354,7 +2390,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2562,7 +2598,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2735,7 +2771,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -2978,7 +3014,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3054,7 +3090,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -Phaser.Body +Phaser.Physics.Body @@ -3076,7 +3112,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -

    The Phaser.Body instance to render all shapes from.

    +

    The Phaser.Physics.Body instance to render all shapes from.

    @@ -3147,7 +3183,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3339,7 +3375,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3500,7 +3536,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -3790,7 +3826,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -4033,148 +4069,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    renderQuadTree(quadtree, color)

    - - -
    -
    - - -
    -

    Visually renders a QuadTree to the display.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    quadtree - - -Phaser.QuadTree - - - -

    The quadtree to render.

    color - - -string - - - -

    The color of the lines in the quadtree.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    @@ -4384,7 +4279,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -4412,13 +4307,17 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    -

    renderShape(shape, x, y, angle)

    +

    renderShapeCircle(x, y, bodyAngle, shape, offset, angle)

    +
    +

    Renders a p2.Circle shape. Do not call this directly - instead use Debug.renderPhysicsBody.

    +
    + @@ -4448,29 +4347,6 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL - - - shape - - - - - -p2.Shape - - - - - - - - - -

    The shape to render.

    - - - - x @@ -4489,7 +4365,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -

    The x coordinate of the Body to translate to.

    +

    The x coordinate of the Shape to translate to.

    @@ -4512,14 +4388,14 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -

    The y coordinate of the Body to translate to.

    +

    The y coordinate of the Shape to translate to.

    - angle + bodyAngle @@ -4539,143 +4415,6 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - - - -
    - - - -
    -

    renderShape(x, y, shape, offset, angle)

    - - -
    -
    - - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4708,7 +4447,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL + @@ -4741,7 +4480,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL - + @@ -4773,7 +4512,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -4801,13 +4540,17 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    -

    renderShape(shape, x, y, angle)

    +

    renderShapeConvex(x, y, bodyAngle, shape, offset, angle)

    +
    +

    Renders a convex shape. Do not call this directly - instead use Debug.renderPhysicsBody.

    +
    + @@ -4837,6 +4580,75 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4862,13 +4674,13 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL - + - - - - - - - - - - - - - - - - + @@ -4924,7 +4713,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL - + @@ -4956,7 +4745,473 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    renderShapeLine(x, y, bodyAngle, shape, offset, angle)

    + + +
    +
    + + +
    +

    Renders a p2.Line shape. Do not call this directly - instead use Debug.renderPhysicsBody.

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

    The x coordinate of the Body to translate to.

    y - - -number - - - -

    The y coordinate of the Body to translate to.

    -number +array @@ -4718,7 +4457,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -

    -

    The shape offset vector.

    -

    The shape angle.

    x + + +number + + + +

    The x coordinate of the Shape to translate to.

    y + + +number + + + +

    The y coordinate of the Shape to translate to.

    bodyAngle + + +number + + + +

    The angle of the Body to rotate to.

    shape
    xoffset -number +array @@ -4878,30 +4690,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL -

    The x coordinate of the Body to translate to.

    y - - -number - - - -

    The y coordinate of the Body to translate to.

    The shape offset vector.

    The angle of the Body to rotate to.

    The shape angle.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    x + + +number + + + +

    The x coordinate of the Shape to translate to.

    y + + +number + + + +

    The y coordinate of the Shape to translate to.

    bodyAngle + + +number + + + +

    The angle of the Body to rotate to.

    shape + + +p2.Shape + + + +

    The shape to render.

    offset + + +array + + + +

    The shape offset vector.

    angle + + +number + + + +

    The shape angle.

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

    renderShapeRectangle(x, y, bodyAngle, shape, offset, angle)

    + + +
    +
    + + +
    +

    Renders a p2.Rectangle shape. Do not call this directly - instead use Debug.renderPhysicsBody.

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

    The x coordinate of the Shape to translate to.

    y + + +number + + + +

    The y coordinate of the Shape to translate to.

    bodyAngle + + +number + + + +

    The angle of the Body to rotate to.

    shape + + +p2.Shape + + + +

    The shape to render.

    offset + + +array + + + +

    The shape offset vector.

    angle + + +number + + + +

    The shape angle.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -5199,7 +5454,217 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    renderSpriteBounds(sprite, color, filled)

    + + +
    +
    + + +
    +

    Renders the Sprites bounds. Note: This is really expensive as it has to calculate the bounds every time you call it!

    +
    + + + + + + + +
    Parameters:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeArgumentDefaultDescription
    sprite + + +Phaser.Sprite + + + + + + + + + + + +

    Description.

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

    Color of the debug info to be rendered (format is css color string).

    filled + + +boolean + + + + + + <optional>
    + + + + + +
    + + true + +

    Render the rectangle as a fillRect (default, true) or a strokeRect (false)

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -5442,7 +5907,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -5685,7 +6150,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -5928,7 +6393,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -6182,7 +6647,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
    Source:
    @@ -6675,7 +7140,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:34 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Utils.html b/docs/Phaser.Utils.html index 5dedb87a8..7e61abb89 100644 --- a/docs/Phaser.Utils.html +++ b/docs/Phaser.Utils.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1297,7 +1333,7 @@ dir = 1 (left), 2 (right), 3 (both)

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:34 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.World.html b/docs/Phaser.World.html index 85665af26..00366e5b4 100644 --- a/docs/Phaser.World.html +++ b/docs/Phaser.World.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -563,7 +599,7 @@ the world at world-based coordinates. By default a world is created the same siz
    Source:
    @@ -705,7 +741,7 @@ the world at world-based coordinates. By default a world is created the same siz
    Source:
    @@ -812,7 +848,7 @@ the world at world-based coordinates. By default a world is created the same siz
    Source:
    @@ -924,7 +960,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -1033,7 +1069,7 @@ So if you want to make a game in which the world itself will rotate you should a
    Source:
    @@ -1135,7 +1171,7 @@ So if you want to make a game in which the world itself will rotate you should a
    Source:
    @@ -1242,7 +1278,7 @@ So if you want to make a game in which the world itself will rotate you should a
    Source:
    @@ -1344,7 +1380,7 @@ So if you want to make a game in which the world itself will rotate you should a
    Source:
    @@ -1446,7 +1482,7 @@ So if you want to make a game in which the world itself will rotate you should a
    Source:
    @@ -1548,7 +1584,7 @@ So if you want to make a game in which the world itself will rotate you should a
    Source:
    @@ -1660,7 +1696,7 @@ The cursor is set to the first child added to the Group and doesn't change unles
    Source:
    @@ -1770,7 +1806,7 @@ The cursor is set to the first child added to the Group and doesn't change unles
    Source:
    @@ -1883,7 +1919,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -1990,7 +2026,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2092,7 +2128,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2199,7 +2235,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2306,7 +2342,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2408,7 +2444,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2510,7 +2546,7 @@ So if this Group was in a Group that has x: 200, then this will be added to the
    Source:
    @@ -2622,7 +2658,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2729,7 +2765,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2836,7 +2872,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -2943,7 +2979,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3050,7 +3086,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3152,7 +3188,7 @@ This will have no impact on the rotation value of its children, but it will upda
    Source:
    @@ -3264,7 +3300,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -3376,7 +3412,7 @@ This will have no impact on the x/y coordinates of its children, but it will upd
    Source:
    @@ -3497,7 +3533,7 @@ that then see the addAt method.

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

    Source:
    @@ -3869,7 +3905,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -3961,7 +3997,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -4084,7 +4120,7 @@ The child is added to the Group at the location specified by the index value, th
    Source:
    @@ -4323,7 +4359,7 @@ After the method parameter and context you can add as many extra parameters as y
    Source:
    @@ -4521,7 +4557,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -4690,7 +4726,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -4764,7 +4800,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -4861,7 +4897,7 @@ After the existsValue parameter you can add as many parameters as you like, whic
    Source:
    @@ -5173,7 +5209,7 @@ Useful if you don't need to create the Sprite instances before-hand.

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

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

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

    Source:
    @@ -5885,7 +5921,7 @@ Note: Currently this will skip any children which are Groups themselves.

    Source:
    @@ -6033,155 +6069,7 @@ For example: Group.forEachAlive(causeDamage, this, 500)

    Source:
    - - - - - - - -
    - - - - - - - - - - - - - -
    - - - -
    -

    forEachAlive(callback, callbackContext)

    - - -
    -
    - - -
    -

    Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. -You can add as many parameters as you like, which will all be passed to the callback along with the child. -For example: Group.forEachAlive(causeDamage, this, 500)

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    callback - - -function - - - -

    The function that will be called. Each child of the Group will be passed to it as its first parameter.

    callbackContext - - -Object - - - -

    The context in which the function should be called (usually 'this').

    - - - - -
    - - - - - - - -
    Inherited From:
    -
    - - - - - - - - - - - - - -
    Source:
    -
    @@ -6329,7 +6217,155 @@ For example: Group.forEachDead(bringToLife, this)

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

    forEachExists(callback, callbackContext)

    + + +
    +
    + + +
    +

    Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. +You can add as many parameters as you like, which will all be passed to the callback along with the child. +For example: Group.forEachExists(causeDamage, this, 500)

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

    The function that will be called. Each child of the Group will be passed to it as its first parameter.

    callbackContext + + +Object + + + +

    The context in which the function should be called (usually 'this').

    + + + + +
    + + + + + + + +
    Inherited From:
    +
    + + + + + + + + + + + + + +
    Source:
    +
    @@ -6452,7 +6488,7 @@ For example: Group.forEachDead(bringToLife, this)

    Source:
    @@ -6550,7 +6586,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6648,7 +6684,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6794,7 +6830,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -6940,7 +6976,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -7109,7 +7145,7 @@ This is handy for checking if everything has been wiped out, or choosing a squad
    Source:
    @@ -7419,7 +7455,7 @@ You can add as many callback parameters as you like, which will all be passed to
    Source:
    @@ -7635,7 +7671,7 @@ Group.multiplyAll('x', 2) will x2 the child.x value.

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

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

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

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

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

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

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

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

    Source:
    @@ -8771,7 +8807,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9063,7 +9099,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9250,7 +9286,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9498,7 +9534,7 @@ The operation parameter controls how the new value is assigned to the property,
    Source:
    @@ -9681,7 +9717,7 @@ For example to depth sort Sprites for Zelda-style game you might call grou
    Source:
    @@ -9874,7 +9910,7 @@ Group.subAll('x', 10) will minus 10 from the child.x value.

    Source:
    @@ -10021,7 +10057,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
    Source:
    @@ -10095,7 +10131,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
    Source:
    @@ -10146,7 +10182,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:34 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:36 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.html b/docs/Phaser.html index a2c09d20f..2dbbe4126 100644 --- a/docs/Phaser.html +++ b/docs/Phaser.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -575,6 +611,9 @@
    Game
    +
    GameObjectCreator
    +
    +
    GameObjectFactory
    @@ -635,6 +674,9 @@
    Physics
    +
    Physics
    +
    +
    Plugin
    @@ -768,7 +810,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:21 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.js.html b/docs/Phaser.js.html index 0ea5449c9..4490ca6b1 100644 --- a/docs/Phaser.js.html +++ b/docs/Phaser.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -504,7 +540,28 @@ var Phaser = Phaser || { KINEMATIC: 4, CANVAS_PX_ROUND: false, - CANVAS_CLEAR_RECT: true + CANVAS_CLEAR_RECT: true, + + // the various blend modes supported by pixi / phaser + blendModes: { + NORMAL:0, + ADD:1, + MULTIPLY:2, + SCREEN:3, + OVERLAY:4, + DARKEN:5, + LIGHTEN:6, + COLOR_DODGE:7, + COLOR_BURN:8, + HARD_LIGHT:9, + SOFT_LIGHT:10, + DIFFERENCE:11, + EXCLUSION:12, + HUE:13, + SATURATION:14, + COLOR:15, + LUMINOSITY:16 + } }; @@ -533,7 +590,7 @@ PIXI.InteractionManager = function (dummy) { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Plugin.js.html b/docs/Plugin.js.html index d6f35b484..f40ede86d 100644 --- a/docs/Plugin.js.html +++ b/docs/Plugin.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -597,7 +633,7 @@ Phaser.Plugin.prototype.constructor = Phaser.Plugin; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/PluginManager.js.html b/docs/PluginManager.js.html index 3b6e00c67..f0d45c444 100644 --- a/docs/PluginManager.js.html +++ b/docs/PluginManager.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -773,7 +809,7 @@ Phaser.PluginManager.prototype.constructor = Phaser.PluginManager; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Point.js.html b/docs/Point.js.html index 8ac30aac8..3eb655a94 100644 --- a/docs/Point.js.html +++ b/docs/Point.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -933,7 +969,7 @@ PIXI.Point = Phaser.Point; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/PointProxy.js.html b/docs/PointProxy.js.html new file mode 100644 index 000000000..e5ba42ca8 --- /dev/null +++ b/docs/PointProxy.js.html @@ -0,0 +1,616 @@ + + + + + + Phaser Source: physics/PointProxy.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: physics/PointProxy.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2014 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* A PointProxy is an internal class that allows for direct getter/setter style property access to Arrays and TypedArrays.
    +*
    +* @class Phaser.Physics.PointProxy
    +* @classdesc PointProxy
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the Phaser.Game instance.
    +* @param {any} destination - The object to bind to.
    +*/
    +Phaser.Physics.PointProxy = function (game, destination) {
    +
    +    this.game = game;
    +	this.destination = destination;
    +
    +};
    +
    +Phaser.Physics.PointProxy.prototype.constructor = Phaser.Physics.PointProxy;
    +
    +/**
    +* @name Phaser.Physics.PointProxy#x
    +* @property {number} x - The x property of this PointProxy.
    +*/
    +Object.defineProperty(Phaser.Physics.PointProxy.prototype, "x", {
    +    
    +    get: function () {
    +
    +        return this.destination[0];
    +
    +    },
    +
    +    set: function (value) {
    +
    +        this.destination[0] = this.game.math.px2p(value);
    +
    +    }
    +
    +});
    +
    +/**
    +* @name Phaser.Physics.PointProxy#y
    +* @property {number} y - The y property of this PointProxy.
    +*/
    +Object.defineProperty(Phaser.Physics.PointProxy.prototype, "y", {
    +    
    +    get: function () {
    +
    +        return this.destination[1];
    +
    +    },
    +
    +    set: function (value) {
    +
    +        this.destination[1] = this.game.math.px2p(value);
    +
    +    }
    +
    +});
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Pointer.js.html b/docs/Pointer.js.html index 673babbc0..fd02125fd 100644 --- a/docs/Pointer.js.html +++ b/docs/Pointer.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1120,7 +1156,7 @@ Object.defineProperty(Phaser.Pointer.prototype, "worldY", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Polygon.js.html b/docs/Polygon.js.html index 0213c160e..406731841 100644 --- a/docs/Polygon.js.html +++ b/docs/Polygon.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -584,7 +620,7 @@ PIXI.Polygon = Phaser.Polygon; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/RandomDataGenerator.js.html b/docs/RandomDataGenerator.js.html index 0fc571851..29fac511f 100644 --- a/docs/RandomDataGenerator.js.html +++ b/docs/RandomDataGenerator.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -723,7 +759,7 @@ Phaser.RandomDataGenerator.prototype.constructor = Phaser.RandomDataGenerator; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Rectangle.js.html b/docs/Rectangle.js.html index 229b9ebdc..24ee51e56 100644 --- a/docs/Rectangle.js.html +++ b/docs/Rectangle.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1250,7 +1286,7 @@ PIXI.EmptyRectangle = new Phaser.Rectangle(0, 0, 0, 0); Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/RenderTexture.js.html b/docs/RenderTexture.js.html index 00bad73a2..6f5088508 100644 --- a/docs/RenderTexture.js.html +++ b/docs/RenderTexture.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -485,12 +521,54 @@ Phaser.RenderTexture = function (game, width, height, key) { */ this.type = Phaser.RENDERTEXTURE; + /** + * @property {Phaser.Point} _temp - Internal var. + * @private + */ + this._temp = new Phaser.Point(); + PIXI.RenderTexture.call(this, width, height); }; Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype); Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture; + +/** +* This function will draw the display object to the texture. +* +* @method Phaser.RenderTexture.prototype.renderXY +* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapText|Phaser.Group} displayObject The display object to render to this texture. +* @param {number} x - The x position to render the object at. +* @param {number} y - The y position to render the object at. +* @param {boolean} clear - If true the texture will be cleared before the display object is drawn. +*/ +Phaser.RenderTexture.prototype.renderXY = function (displayObject, x, y, clear) { + + this._temp.set(x, y); + + this.render(displayObject, this._temp, clear); + +} + +// Documentation stubs + +/** +* This function will draw the display object to the texture. +* +* @method Phaser.RenderTexture.prototype.render +* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapText|Phaser.Group} displayObject The display object to render to this texture. +* @param {Phaser.Point} position - A Point object containing the position to render the display object at. +* @param {boolean} clear - If true the texture will be cleared before the display object is drawn. +*/ + +/** +* Resize this RenderTexture to the given width and height. +* +* @method Phaser.RenderTexture.prototype.resize +* @param {number} width - The new width of the RenderTexture. +* @param {number} height - The new height of the RenderTexture. +*/ @@ -512,7 +590,7 @@ Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/RequestAnimationFrame.js.html b/docs/RequestAnimationFrame.js.html index 7110e8b25..58b8152fd 100644 --- a/docs/RequestAnimationFrame.js.html +++ b/docs/RequestAnimationFrame.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -465,9 +501,12 @@ * @class Phaser.RequestAnimationFrame * @constructor * @param {Phaser.Game} game - A reference to the currently running game. +* @param {boolean} [forceSetTimeOut=false] - Tell Phaser to use setTimeOut even if raf is available. */ -Phaser.RequestAnimationFrame = function(game) { +Phaser.RequestAnimationFrame = function(game, forceSetTimeOut) { + if (typeof forceSetTimeOut === 'undefined') { forceSetTimeOut = false; } + /** * @property {Phaser.Game} game - The currently running game. */ @@ -479,6 +518,11 @@ Phaser.RequestAnimationFrame = function(game) { */ this.isRunning = false; + /** + * @property {boolean} forceSetTimeOut - Tell Phaser to use setTimeOut even if raf is available. + */ + this.forceSetTimeOut = forceSetTimeOut; + var vendors = [ 'ms', 'moz', @@ -524,7 +568,7 @@ Phaser.RequestAnimationFrame.prototype = { var _this = this; - if (!window.requestAnimationFrame) + if (!window.requestAnimationFrame || this.forceSetTimeOut) { this._isSetTimeOut = true; @@ -633,7 +677,7 @@ Phaser.RequestAnimationFrame.prototype.constructor = Phaser.RequestAnimationFram Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Signal.js.html b/docs/Signal.js.html index 7d520929f..5fe8f0835 100644 --- a/docs/Signal.js.html +++ b/docs/Signal.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -778,7 +814,7 @@ Phaser.Signal.prototype.constructor = Phaser.Signal; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SignalBinding.html b/docs/SignalBinding.html index eb256b6d6..59511c176 100644 --- a/docs/SignalBinding.html +++ b/docs/SignalBinding.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -771,7 +807,7 @@ Inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:34 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:36 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SignalBinding.js.html b/docs/SignalBinding.js.html index 215745fd6..3172b2b53 100644 --- a/docs/SignalBinding.js.html +++ b/docs/SignalBinding.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -638,7 +674,7 @@ Phaser.SignalBinding.prototype.constructor = Phaser.SignalBinding; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SinglePad.js.html b/docs/SinglePad.js.html index cb36f2d9a..93e93c624 100644 --- a/docs/SinglePad.js.html +++ b/docs/SinglePad.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -572,7 +608,7 @@ Phaser.SinglePad.prototype = { /** * Add callbacks to the this Gamepad to handle connect/disconnect/button down/button up/axis change/float value buttons - * @method Phaser.Gamepad#addCallbacks + * @method Phaser.SinglePad#addCallbacks * @param {Object} context - The context under which the callbacks are run. * @param {Object} callbacks - Object that takes six different callbak methods: * onConnectCallback, onDisconnectCallback, onDownCallback, onUpCallback, onAxisCallback, onFloatCallback @@ -662,8 +698,8 @@ Phaser.SinglePad.prototype = { /** * Gamepad connect function, should be called by Phaser.Gamepad - * @param {Object} rawPad - The raw gamepad object * @method Phaser.SinglePad#connect + * @param {Object} rawPad - The raw gamepad object */ connect: function (rawPad) { @@ -715,8 +751,8 @@ Phaser.SinglePad.prototype = { /** * Handles changes in axis - * @param {Object} axisState - State of the relevant axis * @method Phaser.SinglePad#processAxisChange + * @param {Object} axisState - State of the relevant axis */ processAxisChange: function (axisState) { @@ -746,9 +782,9 @@ Phaser.SinglePad.prototype = { /** * Handles button down press + * @method Phaser.SinglePad#processButtonDown * @param {number} buttonCode - Which buttonCode of this button * @param {Object} value - Button value - * @method Phaser.SinglePad#processButtonDown */ processButtonDown: function (buttonCode, value) { @@ -804,9 +840,9 @@ Phaser.SinglePad.prototype = { /** * Handles button release + * @method Phaser.SinglePad#processButtonUp * @param {number} buttonCode - Which buttonCode of this button * @param {Object} value - Button value - * @method Phaser.SinglePad#processButtonUp */ processButtonUp: function (buttonCode, value) { @@ -852,9 +888,9 @@ Phaser.SinglePad.prototype = { /** * Handles buttons with floating values (like analog buttons that acts almost like an axis but still registers like a button) + * @method Phaser.SinglePad#processButtonFloat * @param {number} buttonCode - Which buttonCode of this button * @param {Object} value - Button value (will range somewhere between 0 and 1, but not specifically 0 or 1. - * @method Phaser.SinglePad#processButtonFloat */ processButtonFloat: function (buttonCode, value) { @@ -893,7 +929,7 @@ Phaser.SinglePad.prototype = { /** * Returns value of requested axis - * @method Phaser.SinglePad#isDown + * @method Phaser.SinglePad#axis * @param {number} axisCode - The index of the axis to check * @return {number} Axis value if available otherwise false */ @@ -927,7 +963,7 @@ Phaser.SinglePad.prototype = { /** * Returns the "just released" state of a button from this gamepad. Just released is considered as being true if the button was released within the duration given (default 250ms). - * @method Phaser.SinglePad#justPressed + * @method Phaser.SinglePad#justReleased * @param {number} buttonCode - The buttonCode of the button to check for. * @param {number} [duration=250] - The duration below which the button is considered as being just released. * @return {boolean} True if the button is just released otherwise false. @@ -1043,7 +1079,7 @@ Object.defineProperty(Phaser.SinglePad.prototype, "index", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Sound.js.html b/docs/Sound.js.html index 7f0680f37..7d959b397 100644 --- a/docs/Sound.js.html +++ b/docs/Sound.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1299,7 +1335,7 @@ Object.defineProperty(Phaser.Sound.prototype, "volume", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SoundManager.js.html b/docs/SoundManager.js.html index f936684e1..ac447ac66 100644 --- a/docs/SoundManager.js.html +++ b/docs/SoundManager.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -956,7 +992,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Spring.js.html b/docs/Spring.js.html new file mode 100644 index 000000000..512c37b7c --- /dev/null +++ b/docs/Spring.js.html @@ -0,0 +1,619 @@ + + + + + + Phaser Source: physics/Spring.js + + + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: physics/Spring.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2014 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
    +
    +/**
    +* Creates a spring, connecting two bodies.
    +*
    +* @class Phaser.Physics.Spring
    +* @classdesc Physics Spring Constructor
    +* @constructor
    +* @param {Phaser.Game} game - A reference to the current game.
    +* @param {p2.Body} bodyA - First connected body.
    +* @param {p2.Body} bodyB - Second connected body.
    +* @param {number} [restLength=1] - Rest length of the spring. A number > 0.
    +* @param {number} [stiffness=100] - Stiffness of the spring. A number >= 0.
    +* @param {number} [damping=1] - Damping of the spring. A number >= 0.
    +* @param {Array} [worldA] - Where to hook the spring to body A, in world coordinates, i.e. [32, 32].
    +* @param {Array} [worldB] - Where to hook the spring to body B, in world coordinates, i.e. [32, 32].
    +* @param {Array} [localA] - Where to hook the spring to body A, in local body coordinates.
    +* @param {Array} [localB] - Where to hook the spring to body B, in local body coordinates.
    +*/
    +Phaser.Physics.Spring = function (game, bodyA, bodyB, restLength, stiffness, damping, worldA, worldB, localA, localB) {
    +
    +    /**
    +    * @property {Phaser.Game} game - Local reference to game.
    +    */
    +    this.game = game;
    +
    +    if (typeof restLength === 'undefined') { restLength = 1; }
    +    if (typeof stiffness === 'undefined') { stiffness = 100; }
    +    if (typeof damping === 'undefined') { damping = 1; }
    +
    +    var options = {
    +        restLength: restLength,
    +        stiffness: stiffness,
    +        damping: damping
    +    };
    +
    +    if (typeof worldA !== 'undefined' && worldA !== null)
    +    {
    +        options.worldAnchorA = [ game.math.px2p(worldA[0]), game.math.px2p(worldA[1]) ];
    +    }
    +
    +    if (typeof worldB !== 'undefined' && worldB !== null)
    +    {
    +        options.worldAnchorB = [ game.math.px2p(worldB[0]), game.math.px2p(worldB[1]) ];
    +    }
    +
    +    if (typeof localA !== 'undefined' && localA !== null)
    +    {
    +        options.localAnchorA = [ game.math.px2p(localA[0]), game.math.px2p(localA[1]) ];
    +    }
    +
    +    if (typeof localB !== 'undefined' && localB !== null)
    +    {
    +        options.localAnchorB = [ game.math.px2p(localB[0]), game.math.px2p(localB[1]) ];
    +    }
    +
    +    p2.Spring.call(this, bodyA, bodyB, options);
    +
    +}
    +
    +Phaser.Physics.Spring.prototype = Object.create(p2.Spring.prototype);
    +Phaser.Physics.Spring.prototype.constructor = Phaser.Physics.Spring;
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/Sprite.js.html b/docs/Sprite.js.html index 2d0518f39..a720ae7d1 100644 --- a/docs/Sprite.js.html +++ b/docs/Sprite.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -469,6 +505,7 @@ * events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases. * * @constructor +* @extends PIXI.Sprite * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} x - The x coordinate (in world space) to position the Sprite at. * @param {number} y - The y coordinate (in world space) to position the Sprite at. @@ -946,11 +983,6 @@ Phaser.Sprite.prototype.kill = function() { */ Phaser.Sprite.prototype.destroy = function() { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); @@ -976,10 +1008,19 @@ Phaser.Sprite.prototype.destroy = function() { this.events.destroy(); } + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.alive = false; this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; }; @@ -1371,7 +1412,6 @@ Object.defineProperty(Phaser.Sprite.prototype, "exists", { }); - /** * An Sprite that is fixed to the camera uses its x/y coordinates as offsets from the top left of the camera. These are stored in Sprite.cameraOffset. * Note that the cameraOffset values are in addition to any parent in the display list. @@ -1423,7 +1463,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "fixedToCamera", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SpriteBatch.js.html b/docs/SpriteBatch.js.html index d79a738e7..acaeb69c3 100644 --- a/docs/SpriteBatch.js.html +++ b/docs/SpriteBatch.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -509,7 +545,7 @@ Phaser.SpriteBatch.prototype.constructor = Phaser.SpriteBatch; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Stage.js.html b/docs/Stage.js.html index 7cf3fa67b..26ff38860 100644 --- a/docs/Stage.js.html +++ b/docs/Stage.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -799,7 +835,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/StageScaleMode.js.html b/docs/StageScaleMode.js.html index ebbd3ecd5..c7c64c2ba 100644 --- a/docs/StageScaleMode.js.html +++ b/docs/StageScaleMode.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1257,7 +1293,7 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/State.js.html b/docs/State.js.html index 0c89f806a..32e17c26c 100644 --- a/docs/State.js.html +++ b/docs/State.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -645,7 +681,7 @@ Phaser.State.prototype.constructor = Phaser.State; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/StateManager.js.html b/docs/StateManager.js.html index 49641e126..bc2763df8 100644 --- a/docs/StateManager.js.html +++ b/docs/StateManager.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -784,6 +820,7 @@ Phaser.StateManager.prototype = { this.states[key].game = this.game; this.states[key].add = this.game.add; + this.states[key].make = this.game.make; this.states[key].camera = this.game.camera; this.states[key].cache = this.game.cache; this.states[key].input = this.game.input; @@ -1004,7 +1041,7 @@ Phaser.StateManager.prototype.constructor = Phaser.StateManager; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Text.js.html b/docs/Text.js.html index a896f6b9b..596c7146a 100644 --- a/docs/Text.js.html +++ b/docs/Text.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -460,8 +496,12 @@ */ /** -* Create a new `Text` object. +* Create a new `Text` object. This uses a local hidden Canvas object and renders the type into it. It then makes a texture from this for renderning to the view. +* Because of this you can only display fonts that are currently loaded and available to the browser. It won't load the fonts for you. +* Here is a compatibility table showing the available default fonts across different mobile browsers: http://www.jordanm.co.uk/tinytype +* * @class Phaser.Text +* @extends PIXI.Text * @constructor * @param {Phaser.Game} game - Current game instance. * @param {number} x - X position of the new text object. @@ -622,7 +662,6 @@ Phaser.Text.prototype.update = function() { */ Phaser.Text.prototype.postUpdate = function () { - // Fixed to Camera? if (this._cache[7] === 1) { this.position.x = this.game.camera.view.x + this.cameraOffset.x; @@ -636,11 +675,6 @@ Phaser.Text.prototype.postUpdate = function () { */ Phaser.Text.prototype.destroy = function () { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); @@ -658,9 +692,18 @@ Phaser.Text.prototype.destroy = function () { this.context = null; } + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; } @@ -1285,7 +1328,7 @@ Object.defineProperty(Phaser.Text.prototype, "fixedToCamera", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tile.js.html b/docs/Tile.js.html index 6b470c069..15856305e 100644 --- a/docs/Tile.js.html +++ b/docs/Tile.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -767,7 +803,7 @@ Object.defineProperty(Phaser.Tile.prototype, "bottom", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TileSprite.js.html b/docs/TileSprite.js.html index e772067b5..1fb1e9cb2 100644 --- a/docs/TileSprite.js.html +++ b/docs/TileSprite.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -743,9 +779,18 @@ Phaser.TileSprite.prototype.destroy = function() { this.events.destroy(); + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; } @@ -885,7 +930,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tilemap.js.html b/docs/Tilemap.js.html index 680ae6ecb..f9e77132e 100644 --- a/docs/Tilemap.js.html +++ b/docs/Tilemap.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1889,7 +1925,7 @@ Phaser.Tilemap.prototype.constructor = Phaser.Tilemap; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TilemapLayer.js.html b/docs/TilemapLayer.js.html index 6daa61f4a..c057bf763 100644 --- a/docs/TilemapLayer.js.html +++ b/docs/TilemapLayer.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1354,7 +1390,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionHeight", { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TilemapParser.js.html b/docs/TilemapParser.js.html index b06d0881b..7ca86c268 100644 --- a/docs/TilemapParser.js.html +++ b/docs/TilemapParser.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -521,7 +557,7 @@ Phaser.TilemapParser = { }, /** - * Parse tileset data from the cache and creates a Tileset object. + * Parse tilemap data from the cache and creates a Tilemap object. * @method Phaser.TilemapParser.parse * @param {Phaser.Game} game - Game reference to the currently running game. * @param {string} key - The key of the tilemap in the Cache. @@ -933,7 +969,7 @@ Phaser.TilemapParser = { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tileset.js.html b/docs/Tileset.js.html index fc27a8f25..52ca0715c 100644 --- a/docs/Tileset.js.html +++ b/docs/Tileset.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -630,7 +666,7 @@ Phaser.Tileset.prototype.constructor = Phaser.Tileset; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Time.js.html b/docs/Time.js.html index 7e4e07472..cfb57c5ba 100644 --- a/docs/Time.js.html +++ b/docs/Time.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -821,7 +857,7 @@ Phaser.Time.prototype.constructor = Phaser.Time; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Timer.js.html b/docs/Timer.js.html index 378175f60..cabba6147 100644 --- a/docs/Timer.js.html +++ b/docs/Timer.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -983,7 +1019,7 @@ Phaser.Timer.prototype.constructor = Phaser.Timer; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TimerEvent.js.html b/docs/TimerEvent.js.html index 684a55ff5..b5b57d718 100644 --- a/docs/TimerEvent.js.html +++ b/docs/TimerEvent.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -547,7 +583,7 @@ Phaser.TimerEvent.prototype.constructor = Phaser.TimerEvent; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Touch.js.html b/docs/Touch.js.html index cdef914bb..8223f21ae 100644 --- a/docs/Touch.js.html +++ b/docs/Touch.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -845,7 +881,7 @@ Phaser.Touch.prototype.constructor = Phaser.Touch; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tween.js.html b/docs/Tween.js.html index a21786a12..bbe889169 100644 --- a/docs/Tween.js.html +++ b/docs/Tween.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1053,7 +1089,7 @@ Phaser.Tween.prototype.constructor = Phaser.Tween; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TweenManager.js.html b/docs/TweenManager.js.html index d2479aa37..c08f1aa9b 100644 --- a/docs/TweenManager.js.html +++ b/docs/TweenManager.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -629,7 +665,7 @@ Phaser.TweenManager.prototype = { /** * Pauses all currently running tweens. * - * @method Phaser.TweenManager#update + * @method Phaser.TweenManager#pauseAll */ pauseAll: function () { @@ -678,7 +714,7 @@ Phaser.TweenManager.prototype.constructor = Phaser.TweenManager; Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Utils.js.html b/docs/Utils.js.html index 5b12f3f3e..a2ddcbeeb 100644 --- a/docs/Utils.js.html +++ b/docs/Utils.js.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -779,7 +815,7 @@ if (!Array.isArray) { Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:20 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:21 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/World.js.html b/docs/World.js.html index a9f342a6e..2f50bc7a1 100644 --- a/docs/World.js.html +++ b/docs/World.js.html @@ -3,7 +3,7 @@ - Phaser Source: core/World.js + Phaser Source: physics/World.js + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Source: core/World.js

    + +
    +
    +
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2014 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
    +*
    +* 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
    +* @extends Phaser.Group
    +* @constructor
    +* @param {Phaser.Game} game - Reference to the current game instance.
    +*/
    +Phaser.World = function (game) {
    +
    +    Phaser.Group.call(this, game, null, '__world', false);
    +
    +    /**
    +    * The World has no fixed size, but it does have a bounds outside of which objects are no longer considered as being "in world" and you should use this to clean-up the display list and purge dead objects.
    +    * By default we set the Bounds to be from 0,0 to Game.width,Game.height. I.e. it will match the size given to the game constructor with 0,0 representing the top-left of the display.
    +    * However 0,0 is actually the center of the world, and if you rotate or scale the world all of that will happen from 0,0.
    +    * So if you want to make a game in which the world itself will rotate you should adjust the bounds so that 0,0 is the center point, i.e. set them to -1000,-1000,2000,2000 for a 2000x2000 sized world centered around 0,0.
    +    * @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;
    +    
    +}
    +
    +Phaser.World.prototype = Object.create(Phaser.Group.prototype);
    +Phaser.World.prototype.constructor = Phaser.World;
    +
    +/**
    +* Initialises the game world.
    +*
    +* @method Phaser.World#boot
    +* @protected
    +*/
    +Phaser.World.prototype.boot = function () {
    +
    +    this.camera = new Phaser.Camera(this.game, 0, 0, 0, this.game.width, this.game.height);
    +
    +    this.camera.displayObject = this;
    +
    +    this.game.camera = this.camera;
    +
    +    this.game.stage.addChild(this);
    +
    +}
    +
    +/**
    +* Updates the size of this world. Note that this doesn't modify the world x/y coordinates, just the width and height.
    +*
    +* @method Phaser.World#setBounds
    +* @param {number} x - Top left most corner of the world.
    +* @param {number} y - Top left most corner of the world.
    +* @param {number} width - New width of the world. Can never be smaller than the Game.width.
    +* @param {number} height - New height of the world. Can never be smaller than the Game.height.
    +*/
    +Phaser.World.prototype.setBounds = function (x, y, width, height) {
    +
    +    if (width < this.game.width)
    +    {
    +        width = this.game.width;
    +    }
    +
    +    if (height < this.game.height)
    +    {
    +        height = this.game.height;
    +    }
    +
    +    this.bounds.setTo(x, y, width, height);
    +
    +    if (this.camera.bounds)
    +    {
    +        //  The Camera can never be smaller than the game size
    +        this.camera.bounds.setTo(x, y, width, height);
    +    }
    +
    +    this.game.physics.setBoundsToWorld();
    +
    +}
    +
    +/**
    +* Destroyer of worlds.
    +* @method Phaser.World#destroy
    +*/
    +Phaser.World.prototype.destroy = function () {
    +
    +    this.camera.reset();
    +
    +    this.game.input.reset(true);
    +
    +    this.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 () {
    +
    +        if (this.bounds.x < 0)
    +        {
    +            return this.game.rnd.integerInRange(this.bounds.x, (this.bounds.width - Math.abs(this.bounds.x)));
    +        }
    +        else
    +        {
    +            return this.game.rnd.integerInRange(this.bounds.x, 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 () {
    +
    +        if (this.bounds.y < 0)
    +        {
    +            return this.game.rnd.integerInRange(this.bounds.y, (this.bounds.height - Math.abs(this.bounds.y)));
    +        }
    +        else
    +        {
    +            return this.game.rnd.integerInRange(this.bounds.y, this.bounds.height);
    +        }
    +
    +    }
    +
    +});
    +
    +
    +
    +
    + + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2014 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. + +
    +
    + + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + diff --git a/docs/build/conf.json b/docs/build/conf.json index b965156b8..7ef6be69c 100644 --- a/docs/build/conf.json +++ b/docs/build/conf.json @@ -14,7 +14,7 @@ "../../src/math/", "../../src/net/", "../../src/particles/", - "../../src/physics/arcade/", + "../../src/physics/", "../../src/sound/", "../../src/system/", "../../src/tilemap/", diff --git a/docs/classes.list.html b/docs/classes.list.html index e08341fab..3860ac29d 100644 --- a/docs/classes.list.html +++ b/docs/classes.list.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -603,6 +639,9 @@
    Game
    +
    GameObjectCreator
    +
    +
    GameObjectFactory
    @@ -666,9 +705,36 @@
    Physics
    +
    Physics
    +
    +
    Arcade
    +
    Body
    +
    + +
    CollisionGroup
    +
    + +
    ContactMaterial
    +
    + +
    InversePointProxy
    +
    + +
    Material
    +
    + +
    PointProxy
    +
    + +
    Spring
    +
    + +
    World
    +
    +
    Plugin
    @@ -815,7 +881,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:21 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/global.html b/docs/global.html index feb3b1821..b5185e319 100644 --- a/docs/global.html +++ b/docs/global.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -1221,7 +1257,7 @@ this function is taken from Starling Framework as its pretty neat ;)

    Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:21 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/index.html b/docs/index.html index 4b75349d4..2c595f8af 100644 --- a/docs/index.html +++ b/docs/index.html @@ -166,6 +166,10 @@ Game +
  • + GameObjectCreator +
  • +
  • GameObjectFactory
  • @@ -254,6 +258,38 @@ Arcade +
  • + Body +
  • + +
  • + CollisionGroup +
  • + +
  • + ContactMaterial +
  • + +
  • + InversePointProxy +
  • + +
  • + Material +
  • + +
  • + PointProxy +
  • + +
  • + Spring +
  • + +
  • + World +
  • +
  • Plugin
  • @@ -539,6 +575,8 @@
  • Cache.getImageKeys and similar has been removed, please use Cache.getKeys(Phaser.Cache.IMAGE) instead, this now supports all 10 Cache data types.
  • After defining tiles that collide on a Tilemap, you need to call Tilemap.generateCollisionData(layer) to populate the physics world with the data required.
  • Phaser.QuadTree has been removed from core and moved to a plugin. It's no longer required, nor works with the physics system.
  • +
  • Phaser.Animation.frame now returns the frame of the current animation, rather than the global frame from the sprite sheet / atlas.
  • +
  • When adding a Group if the parent value is null the Group won't be added to the World, so you can add it when ready. If parent is undefined it's added to World by default.
  • New features:

      @@ -580,6 +618,8 @@
    • World.reset now calls Camera.reset which sends the camera back to 0,0 and un-follows any object it may have been tracking.
    • Added hostname: '*' to the grunt-connect in Gruntfile.js (fixes #426)
    • Device, Canvas and GamePad classes all updated for better CocoonJS support (thanks Videlais)
    • +
    • BitmapData.alphaMask will draw the given image onto a BitmapData using an image as an alpha mask.
    • +
    • The new GameObjectCreator (which you access via game.make or State.make) lets you easily create an object but NOT add it to the display list.

    Bug Fixes:

      @@ -733,7 +773,7 @@ Sprites also have full Input support: click them, touch them, drag them around, Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:21 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html index d34ce06db..747eeb6f5 100644 --- a/docs/namespaces.list.html +++ b/docs/namespaces.list.html @@ -166,6 +166,10 @@ Game +
    • + GameObjectCreator +
    • +
    • GameObjectFactory
    • @@ -254,6 +258,38 @@ Arcade +
    • + Body +
    • + +
    • + CollisionGroup +
    • + +
    • + ContactMaterial +
    • + +
    • + InversePointProxy +
    • + +
    • + Material +
    • + +
    • + PointProxy +
    • + +
    • + Spring +
    • + +
    • + World +
    • +
    • Plugin
    • @@ -603,6 +639,9 @@
      Game
      +
      GameObjectCreator
      +
      +
      GameObjectFactory
      @@ -666,9 +705,36 @@
      Physics
      +
      Physics
      +
      +
      Arcade
      +
      Body
      +
      + +
      CollisionGroup
      +
      + +
      ContactMaterial
      +
      + +
      InversePointProxy
      +
      + +
      Material
      +
      + +
      PointProxy
      +
      + +
      Spring
      +
      + +
      World
      +
      +
      Plugin
      @@ -815,7 +881,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Wed Feb 19 2014 05:26:21 GMT-0000 (GMT) using the DocStrap template. + on Fri Feb 21 2014 15:36:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/examples/_site/view_full.html b/examples/_site/view_full.html index 33314ad85..479851401 100644 --- a/examples/_site/view_full.html +++ b/examples/_site/view_full.html @@ -12,32 +12,29 @@ it's because it makes debugging *significantly* easier for us. Feel free to replace all the below with just a call to ../dist/phaser.js instead if you prefer. --> + - - - - - - + + + + + + + - - - - - @@ -57,36 +54,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -115,29 +86,27 @@ + + + + - - - - - - - + @@ -165,9 +134,14 @@ - - - + + + + + + + + diff --git a/examples/_site/view_lite.html b/examples/_site/view_lite.html index b7c6d0ae1..0455a4e31 100644 --- a/examples/_site/view_lite.html +++ b/examples/_site/view_lite.html @@ -12,32 +12,29 @@ it's because it makes debugging *significantly* easier for us. Feel free to replace all the below with just a call to ../build/phaser.js instead if you prefer. --> + - - - - - - + + + + + + + - - - - - @@ -57,36 +54,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -115,29 +86,27 @@ + + + + - - - - - - - + @@ -165,9 +134,14 @@ - - - + + + + + + + + diff --git a/examples/assets/sprites/seacreatures_json.json b/examples/assets/sprites/seacreatures_json.json index 305d2a432..6a5e96d3e 100644 Binary files a/examples/assets/sprites/seacreatures_json.json and b/examples/assets/sprites/seacreatures_json.json differ diff --git a/examples/basics/03 - move an image.js b/examples/basics/03 - move an image.js index 0cdd93205..a98631a64 100644 --- a/examples/basics/03 - move an image.js +++ b/examples/basics/03 - move an image.js @@ -19,6 +19,8 @@ function create() { // and assign it to a variable var image = game.add.sprite(0, 0, 'einstein'); - image.body.velocity.x=50; + image.physicsEnabled = true; + + image.body.moveRight(150); } diff --git a/examples/camera/basic follow.js b/examples/camera/basic follow.js index bcb21bc7b..5a949b481 100644 --- a/examples/camera/basic follow.js +++ b/examples/camera/basic follow.js @@ -31,6 +31,8 @@ function create() { player = game.add.sprite(150, 320, 'player'); + player.physicsEnabled = true; + cursors = game.input.keyboard.createCursorKeys(); game.camera.follow(player); @@ -39,15 +41,15 @@ function create() { function update() { - player.body.velocity.setTo(0, 0); + player.body.setZeroVelocity(); if (cursors.up.isDown) { - player.body.velocity.y = -200; + player.body.moveUp(200) } else if (cursors.down.isDown) { - player.body.velocity.y = 200; + player.body.moveDown(200); } if (cursors.left.isDown) @@ -56,7 +58,7 @@ function update() { } else if (cursors.right.isDown) { - player.body.velocity.x = 200; + player.body.moveRight(200); } } diff --git a/examples/camera/camera cull.js b/examples/camera/camera cull.js index 6060ada2a..cb15113ad 100644 --- a/examples/camera/camera cull.js +++ b/examples/camera/camera cull.js @@ -42,7 +42,7 @@ function update() { function render() { - game.debug.renderSpriteCorners(s, true, true); + game.debug.renderSpriteBounds(s); game.debug.renderSpriteInfo(s, 20, 32); } diff --git a/examples/display/fullscreen.js b/examples/display/fullscreen.js index d02dd75ce..2ff001d7e 100644 --- a/examples/display/fullscreen.js +++ b/examples/display/fullscreen.js @@ -26,7 +26,7 @@ function create() { function gofull() { - game.stage.scale.startFullScreen(); + game.scale.startFullScreen(); } diff --git a/examples/groups/bring a group to top.js b/examples/groups/bring a group to top.js index 687c07f21..bff5bdf41 100644 --- a/examples/groups/bring a group to top.js +++ b/examples/groups/bring a group to top.js @@ -34,7 +34,7 @@ function create() { var tempSprite = game.add.sprite(game.world.randomX, game.world.randomY, 'atari1'); tempSprite.name = 'atari' + i; - tempSprite.input.start(i, true); + tempSprite.inputEnabled = true; tempSprite.input.enableDrag(false, true); group1.add(tempSprite); @@ -44,7 +44,7 @@ function create() { var tempSprite=game.add.sprite(game.world.randomX, game.world.randomY, 'sonic'); tempSprite.name = 'sonic' + i; - tempSprite.input.start(10 + i, true); + tempSprite.inputEnabled = true; tempSprite.input.enableDrag(false, true); group2.add(tempSprite); diff --git a/examples/groups/call all.js b/examples/groups/call all.js index 250d6fa09..8123997f7 100644 --- a/examples/groups/call all.js +++ b/examples/groups/call all.js @@ -19,12 +19,12 @@ function create() { item = game.add.sprite(290, 98 * (i + 1), 'item', i); // Enable input. - item.input.start(0, true); + item.inputEnabled = true; item.events.onInputUp.add(kill); // An item besides the left one. item = game.add.sprite(388, 98 * (i + 1), 'item', i + 3); - item.input.start(0, true); + item.inputEnabled = true; item.events.onInputUp.add(kill); } diff --git a/examples/groups/depth sort.js b/examples/groups/depth sort.js index 05b745113..2684b533f 100644 --- a/examples/groups/depth sort.js +++ b/examples/groups/depth sort.js @@ -35,6 +35,8 @@ function create() { // The player sprite = group.create(300, 200, 'phaser'); + sprite.physicsEnabled = true; + // Some trees for (var i = 0; i < 50; i++) { diff --git a/examples/groups/remove.js b/examples/groups/remove.js index 85ed08dd9..4b88e3503 100644 --- a/examples/groups/remove.js +++ b/examples/groups/remove.js @@ -23,7 +23,7 @@ function create() { // Directly create sprites from the group. item = items.create(90, 90 * i, 'item', i); // Enable input detection, then it's possible be dragged. - item.input.start(0,true); + item.inputEnabled = true; // Make this item draggable. item.input.enableDrag(); // Then we make it snap to 90x90 grids. diff --git a/examples/groups/replace.js b/examples/groups/replace.js index 8fac95956..23de93ce3 100644 --- a/examples/groups/replace.js +++ b/examples/groups/replace.js @@ -25,12 +25,12 @@ function create() { // Directly create sprites from the left group. item = left.create(290, 98 * (i + 1), 'item', i); // Enable input. - item.input.start(0, false, true); + item.inputEnabled = true; item.events.onInputUp.add(select); // Add another to the right group. item = right.create(388, 98 * (i + 1), 'item', i + 3); // Enable input. - item.input.start(0,true); + item.inputEnabled = true; item.events.onInputUp.add(select); } } diff --git a/examples/input/drop limitation.js b/examples/input/drop limitation.js index 76a0c6153..0fbc35333 100644 --- a/examples/input/drop limitation.js +++ b/examples/input/drop limitation.js @@ -18,7 +18,7 @@ function create() { item = game.add.sprite(90, 90 * i, 'item', i); // Enable input detection, then it's possible be dragged. - item.input.start(0,true); + item.inputEnabled = true; // Make this item draggable. item.input.enableDrag(); diff --git a/examples/input/game scale.js b/examples/input/game scale.js index 0e6542e51..b750015ad 100644 --- a/examples/input/game scale.js +++ b/examples/input/game scale.js @@ -14,6 +14,8 @@ function preload() { } +var cursors; + function create() { //We increase the size of our game world @@ -25,26 +27,28 @@ function create() { game.add.sprite(game.world.randomX, game.world.randomY, 'melon'); } + cursors = game.input.keyboard.createCursorKeys(); + } function update() { //This allows us to move the game camera using the keyboard - if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) + if (cursors.left.isDown) { game.camera.x -= 4; } - else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) + else if (cursors.right.isDown) { game.camera.x += 4; } - if (game.input.keyboard.isDown(Phaser.Keyboard.UP)) + if (cursors.up.isDown) { game.camera.y -= 4; } - else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) + else if (cursors.down.isDown) { game.camera.y += 4; } diff --git a/examples/input/keyboard justpressed.js b/examples/input/keyboard justpressed.js index 8eb6321e5..a4c24e32c 100644 --- a/examples/input/keyboard justpressed.js +++ b/examples/input/keyboard justpressed.js @@ -19,10 +19,13 @@ function create() { bullets = game.add.group(); bullets.createMultiple(10, 'bullet'); + bullets.setAll('physicsEnabled',true); bullets.callAll('events.onOutOfBounds.add', 'events.onOutOfBounds', resetBullet, this); sprite = game.add.sprite(400, 550, 'phaser'); + sprite.physicsEnabled = true; + // Stop the following keys from propagating up to the browser game.input.keyboard.addKeyCapture([ Phaser.Keyboard.LEFT, Phaser.Keyboard.RIGHT, Phaser.Keyboard.SPACEBAR ]); diff --git a/examples/input/motion lock - horizontal.js b/examples/input/motion lock - horizontal.js index 1e2a82f2a..fff812735 100644 --- a/examples/input/motion lock - horizontal.js +++ b/examples/input/motion lock - horizontal.js @@ -18,7 +18,7 @@ function create() { // Enable Input detection. Sprites have this disabled by default, // so you have to start it if you want to interact with them. - sprite.input.start(0,true); + sprite.inputEnabled = true; // This allows you to drag the sprite. The parameter controls if you drag from the position you touched it (false) // or if it will snap to the center (true) diff --git a/examples/input/motion lock - vertical.js b/examples/input/motion lock - vertical.js index 045bbc64a..ea5692c36 100644 --- a/examples/input/motion lock - vertical.js +++ b/examples/input/motion lock - vertical.js @@ -18,7 +18,7 @@ function create() { // Enable Input detection. Sprites have this disabled by default, // so you have to start it if you want to interact with them. - sprite.input.start(0,true); + sprite.inputEnabled = true; // This allows you to drag the sprite. The parameter controls if you drag from the position you touched it (false) // or if it will snap to the center (true) diff --git a/examples/sprites/out of bounds.js b/examples/sprites/out of bounds.js index 94ffc31f6..23b7a51c7 100644 --- a/examples/sprites/out of bounds.js +++ b/examples/sprites/out of bounds.js @@ -13,6 +13,10 @@ var aliens; function create() { + // We only want world bounds on the left and right + game.physics.setBoundsToWorld(true, true, false, false); + game.physics.friction = 0; + player = game.add.sprite(400, 500, 'ship'); player.anchor.setTo(0.5, 0.5); @@ -24,7 +28,9 @@ function create() { { var alien = aliens.create(200 + x * 48, y * 50, 'alien'); alien.name = 'alien' + x.toString() + y.toString(); + alien.checkWorldBounds = true; alien.events.onOutOfBounds.add(alienOut, this); + alien.physicsEnabled = true; alien.body.velocity.y = 50 + Math.random() * 200; } } diff --git a/examples/wip/alpha-mask.js b/examples/wip/alpha-mask.js new file mode 100644 index 000000000..72d6824fd --- /dev/null +++ b/examples/wip/alpha-mask.js @@ -0,0 +1,34 @@ + +// var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render }); +var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); + +function preload() { + + game.load.image('pic', 'assets/pics/questar.png'); + game.load.image('mask1', 'assets/pics/mask-test.png'); + game.load.image('mask2', 'assets/pics/mask-test2.png'); + +} + +var pic; + +function create() { + + var bmd = game.make.bitmapData(320, 256); + + bmd.alphaMask('pic', 'mask2'); + + pic = game.add.sprite(0, 0, bmd); + + pic.scale.set(2); + +} + +function update() { + + +} + +function render() { + +} diff --git a/examples/wip/blendmodes.js b/examples/wip/blendmodes.js new file mode 100644 index 000000000..b8fc2a710 --- /dev/null +++ b/examples/wip/blendmodes.js @@ -0,0 +1,62 @@ + +var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render }); +// var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); + +function preload() { + + game.load.image('bg', 'assets/pics/color_wheel_swirl.png'); + game.load.image('pic', 'assets/pics/questar.png'); + game.load.image('mask1', 'assets/pics/mask-test.png'); + game.load.image('mask2', 'assets/pics/mask-test2.png'); + +} + +var pic; +var mask; + +function create() { + + var bmd = game.make.bitmapData(320, 200); + + // bmd.draw('pic'); + + bmd.alphaMask('pic', 'mask2'); + + pic = game.add.sprite(0, 0, bmd); + + // game.add.image(-200, 0, 'bg'); + + // mask = game.add.sprite(0, 0, 'mask1'); + + // pic = game.add.sprite(0, 0, 'pic'); + + // mask.addChild(pic); + + // pic.blendMode = Phaser.blendModes.NORMAL; + // pic.blendMode = Phaser.blendModes.ADD; + // pic.blendMode = Phaser.blendModes.MULTIPLY; + // pic.blendMode = Phaser.blendModes.SCREEN; + // mask.blendMode = Phaser.blendModes.OVERLAY; + // pic.blendMode = Phaser.blendModes.DARKEN; + // pic.blendMode = Phaser.blendModes.LIGHTEN; + // pic.blendMode = Phaser.blendModes.COLOR_DODGE; + // pic.blendMode = Phaser.blendModes.COLOR_BURN; + // pic.blendMode = Phaser.blendModes.HARD_LIGHT; + // pic.blendMode = Phaser.blendModes.SOFT_LIGHT; + // pic.blendMode = Phaser.blendModes.DIFFERENCE; + // pic.blendMode = Phaser.blendModes.EXCLUSION; + // pic.blendMode = Phaser.blendModes.HUE; + // pic.blendMode = PIXI.blendModes.SATURATION; + // pic.blendMode = Phaser.blendModes.COLOR; + // pic.blendMode = Phaser.blendModes.LUMINOSITY; + +} + +function update() { + + +} + +function render() { + +} diff --git a/examples/wip/graphics-mask.js b/examples/wip/graphics-mask.js new file mode 100644 index 000000000..85ebff6e0 --- /dev/null +++ b/examples/wip/graphics-mask.js @@ -0,0 +1,40 @@ + +var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render }); +// var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); + +function preload() { + + game.load.image('atari', 'assets/sprites/atari130xe.png'); + +} + +var atari1; +var graphics; + +function create() { + + atari1 = game.add.sprite(50, 50, 'atari'); + + graphics = game.add.graphics(0, 0); + + graphics.beginFill(0xFF3300); + graphics.moveTo(0,50); + graphics.lineTo(250, 50); + graphics.lineTo(100, 100); + graphics.lineTo(250, 220); + graphics.lineTo(50, 220); + graphics.lineTo(0, 50); + graphics.endFill(); + + atari1.mask = graphics; + +} + +function update() { + + +} + +function render() { + +} diff --git a/examples/wip/tilemap3.js b/examples/wip/tilemap3.js new file mode 100644 index 000000000..eb3e62e2f --- /dev/null +++ b/examples/wip/tilemap3.js @@ -0,0 +1,41 @@ + +var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render }); +// var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render }); + +function preload() { + + game.load.tilemap('map', 'assets/tilemaps/maps/test.json', null, Phaser.Tilemap.TILED_JSON); + game.load.image('tileset', 'assets/tilemaps/tiles/test.png'); + +} + +var map; +var layer; + +function create() { + + game.stage.backgroundColor = '#787878'; + + map = game.add.tilemap('map'); + + map.addTilesetImage('tileset'); + + layer = map.createLayer('calque1'); + + console.log(layer); + + // layer.resizeWorld(); + + // map.setCollisionBetween(1, 12); + + // layer.debug = true; + + // dump = map.generateCollisionData(layer); + +} + +function update() { +} + +function render() { +} diff --git a/examples/wip/tilesprite input.js b/examples/wip/tilesprite input.js new file mode 100644 index 000000000..94876e905 --- /dev/null +++ b/examples/wip/tilesprite input.js @@ -0,0 +1,67 @@ + +var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render }); + +function preload() { + + game.load.image('backdrop', 'assets/pics/remember-me.jpg'); + game.load.image('mushroom', 'assets/sprites/mushroom2.png'); + game.load.image('starfield', 'assets/misc/starfield.jpg'); + +} + +var sprite; +var cursors; +var mushroom; + +function create() { + + game.world.setBounds(0, 0, 1920, 1200); + game.add.image(0, 0, 'backdrop'); + + sprite = game.add.tileSprite(100, 100, 200, 200, 'starfield'); + sprite.inputEnabled = true; + sprite.events.onInputDown.add(scroll, this); + sprite.input.enableDrag(); + + mushroom = game.add.sprite(400, 400, 'mushroom'); + mushroom.inputEnabled = true; + mushroom.input.enableDrag(); + + game.camera.follow(mushroom); + + cursors = game.input.keyboard.createCursorKeys(); + +} + +function scroll() +{ + sprite.autoScroll(0, 100); +} + +function update() { + + if (cursors.left.isDown) + { + mushroom.x -= 8; + } + else if (cursors.right.isDown) + { + mushroom.x += 8; + } + + if (cursors.up.isDown) + { + mushroom.y -= 8; + } + else if (cursors.down.isDown) + { + mushroom.y += 8; + } + +} + +function render() { + + // game.debug.renderText(sprite.frame, 32, 32); + +} diff --git a/examples/wip/timer1.js b/examples/wip/timer1.js new file mode 100644 index 000000000..a3e2aedd8 --- /dev/null +++ b/examples/wip/timer1.js @@ -0,0 +1,30 @@ + +var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update, render: render }); + +function preload() { + + game.load.image('pic', 'assets/pics/backscroll.png'); + +} + +var text; +var b; +var grd; + +function create() { + + game.stage.setBackgroundColor(0x2d2d2d); + + text = game.add.text(0, 0, "time"); + +} + +function update() { + + +} + +function render() { + + +} diff --git a/labs/code/010 fixed to camera.js b/labs/code/010 fixed to camera.js new file mode 100644 index 000000000..d900f3ef0 --- /dev/null +++ b/labs/code/010 fixed to camera.js @@ -0,0 +1,70 @@ + +var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update }); + +function preload() { + + game.load.image('backdrop', 'assets/pics/remember-me.jpg'); + game.load.image('mushroom', 'assets/sprites/mushroom2.png'); + game.load.image('coke', 'assets/sprites/cokecan.png'); + game.load.bitmapFont('desyrel', 'assets/fonts/desyrel.png', 'assets/fonts/desyrel.xml', null, 0, -32); + +} + +var cursors; +var mushroom; + +function create() { + + game.world.setBounds(0, 0, 1920, 1200); + game.add.image(0, 0, 'backdrop'); + + mushroom = game.add.sprite(400, 400, 'mushroom'); + + // Test Fixing an Image to the Camera + var fixie = game.add.image(100, 100, 'coke'); + fixie.fixedToCamera = true; + + // And tween it + game.add.tween(fixie.cameraOffset).to({ y: 500 }, 2000, Phaser.Easing.Bounce.Out, true, 0, 1000, true); + + // Test Fixing a Sprite to the Camera + var fixie2 = game.add.sprite(600, 100, 'coke'); + fixie2.fixedToCamera = true; + fixie2.inputEnabled = true; + fixie2.input.enableDrag(); + + // Test Fixing a Text to the Camera + var text = game.add.text(300, 32, 'arrows to move\ndrag the can ->'); + text.fixedToCamera = true; + + // Test fixing a BitmapText to the Camera + var text2 = game.add.bitmapText(270, 520, 'desyrel', 'Fixed to Camera!', 32); + text2.fixedToCamera = true; + + game.camera.follow(mushroom); + + cursors = game.input.keyboard.createCursorKeys(); + +} + +function update() { + + if (cursors.left.isDown) + { + mushroom.x -= 8; + } + else if (cursors.right.isDown) + { + mushroom.x += 8; + } + + if (cursors.up.isDown) + { + mushroom.y -= 8; + } + else if (cursors.down.isDown) + { + mushroom.y += 8; + } + +} diff --git a/src/Phaser.js b/src/Phaser.js index 43eeaf5cd..ae7571a06 100644 --- a/src/Phaser.js +++ b/src/Phaser.js @@ -49,7 +49,28 @@ var Phaser = Phaser || { KINEMATIC: 4, CANVAS_PX_ROUND: false, - CANVAS_CLEAR_RECT: true + CANVAS_CLEAR_RECT: true, + + // the various blend modes supported by pixi / phaser + blendModes: { + NORMAL:0, + ADD:1, + MULTIPLY:2, + SCREEN:3, + OVERLAY:4, + DARKEN:5, + LIGHTEN:6, + COLOR_DODGE:7, + COLOR_BURN:8, + HARD_LIGHT:9, + SOFT_LIGHT:10, + DIFFERENCE:11, + EXCLUSION:12, + HUE:13, + SATURATION:14, + COLOR:15, + LUMINOSITY:16 + } }; diff --git a/src/animation/Animation.js b/src/animation/Animation.js index a61934214..03f0d555e 100644 --- a/src/animation/Animation.js +++ b/src/animation/Animation.js @@ -416,7 +416,7 @@ Object.defineProperty(Phaser.Animation.prototype, 'frame', { set: function (value) { - this.currentFrame = this._frameData.getFrame(value); + this.currentFrame = this._frameData.getFrame(this._frames[value]); if (this.currentFrame !== null) { diff --git a/src/core/Game.js b/src/core/Game.js index 2b1cf940b..0c64a6e8d 100644 --- a/src/core/Game.js +++ b/src/core/Game.js @@ -118,10 +118,15 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant this.raf = null; /** - * @property {Phaser.GameObjectFactory} add - Reference to the GameObject Factory. + * @property {Phaser.GameObjectFactory} add - Reference to the Phaser.GameObjectFactory. */ this.add = null; + /** + * @property {Phaser.GameObjectCreator} make - Reference to the GameObject Creator. + */ + this.make = null; + /** * @property {Phaser.Cache} cache - Reference to the assets cache. * @default @@ -440,6 +445,7 @@ Phaser.Game.prototype = { this.world = new Phaser.World(this); this.add = new Phaser.GameObjectFactory(this); + this.make = new Phaser.GameObjectCreator(this); this.cache = new Phaser.Cache(this); this.load = new Phaser.Loader(this); this.time = new Phaser.Time(this); @@ -534,13 +540,12 @@ Phaser.Game.prototype = { */ setUpRenderer: function () { - /* if (this.device.trident) { - // Pixi WebGL renderer on IE11 doesn't work correctly with masks, if you need them you may want to comment this block out + // Pixi WebGL renderer on IE11 doesn't work correctly at the moment, the pre-multiplied alpha gets all washed out. + // So we're forcing canvas for now until this is fixed, sorry. It's got to be better than no game appearing at all, right? this.renderType = Phaser.CANVAS; } - */ if (this.renderType === Phaser.HEADLESS || this.renderType === Phaser.CANVAS || (this.renderType === Phaser.AUTO && this.device.webGL === false)) { @@ -553,7 +558,6 @@ Phaser.Game.prototype = { this.renderer = new PIXI.CanvasRenderer(this.width, this.height, this.canvas, this.transparent); Phaser.Canvas.setSmoothingEnabled(this.renderer.context, this.antialias); - // this.canvas = this.renderer.view; this.context = this.renderer.context; } else @@ -566,13 +570,9 @@ Phaser.Game.prototype = { // They requested WebGL, and their browser supports it this.renderType = Phaser.WEBGL; this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.canvas, this.transparent, this.antialias); - // this.canvas = this.renderer.view; this.context = null; } - // Phaser.Canvas.addToDOM(this.renderer.view, this.parent, true); - // Phaser.Canvas.setTouchAction(this.renderer.view); - Phaser.Canvas.addToDOM(this.canvas, this.parent, true); Phaser.Canvas.setTouchAction(this.canvas); diff --git a/src/core/Group.js b/src/core/Group.js index f5a0a3fae..87ae200c7 100644 --- a/src/core/Group.js +++ b/src/core/Group.js @@ -10,18 +10,20 @@ * @classdesc A Group is a container for display objects that allows for fast pooling and object recycling. Groups can be nested within other Groups and have their own local transforms. * @constructor * @param {Phaser.Game} game - A reference to the currently running game. -* @param {Phaser.Group|Phaser.Sprite} parent - The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If undefined or null it will use game.world. +* @param {Phaser.Group|Phaser.Sprite|null} parent - The parent Group, DisplayObject or DisplayObjectContainer that this Group will be added to. If undefined it will use game.world. If null it won't be added to anything. * @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging. * @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World. */ Phaser.Group = function (game, parent, name, addToStage) { + if (typeof addToStage === 'undefined') { addToStage = false; } + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - if (typeof parent === 'undefined' || parent === null) + if (typeof parent === 'undefined') { parent = game.world; } @@ -33,20 +35,16 @@ Phaser.Group = function (game, parent, name, addToStage) { PIXI.DisplayObjectContainer.call(this); - if (typeof addToStage === 'undefined' || addToStage === false) + if (addToStage) + { + this.game.stage.addChild(this); + } + else { if (parent) { parent.addChild(this); } - else - { - this.game.stage.addChild(this); - } - } - else - { - this.game.stage.addChild(this); } /** @@ -1147,7 +1145,7 @@ Phaser.Group.prototype.destroy = function (destroyChildren) { { do { - if (this.children[0].group) + if (this.children[0].parent) { this.children[0].destroy(); } diff --git a/src/core/StateManager.js b/src/core/StateManager.js index a7ebbe060..1a29948fd 100644 --- a/src/core/StateManager.js +++ b/src/core/StateManager.js @@ -93,6 +93,11 @@ Phaser.StateManager = function (game, pendingState) { */ this.onPausedCallback = null; + /** + * @property {function} onResumedCallback - This will be called when the state is resumed from a paused state. + */ + this.onResumedCallback = null; + /** * @property {function} onShutDownCallback - This will be called when the state is shut down (i.e. swapped to another state). */ @@ -195,6 +200,7 @@ Phaser.StateManager.prototype = { this.onUpdateCallback = null; this.onRenderCallback = null; this.onPausedCallback = null; + this.onResumedCallback = null; this.onDestroyCallback = null; } @@ -329,6 +335,7 @@ Phaser.StateManager.prototype = { this.states[key].game = this.game; this.states[key].add = this.game.add; + this.states[key].make = this.game.make; this.states[key].camera = this.game.camera; this.states[key].cache = this.game.cache; this.states[key].input = this.game.input; @@ -369,6 +376,7 @@ Phaser.StateManager.prototype = { this.onPreRenderCallback = this.states[key]['preRender'] || null; this.onRenderCallback = this.states[key]['render'] || null; this.onPausedCallback = this.states[key]['paused'] || null; + this.onResumedCallback = this.states[key]['resumed'] || null; // Used when the state is no longer the current active state this.onShutDownCallback = this.states[key]['shutdown'] || this.dummy; @@ -417,7 +425,7 @@ Phaser.StateManager.prototype = { if (this._created && this.onPausedCallback) { - this.onPausedCallback.call(this.callbackContext, this.game, true); + this.onPausedCallback.call(this.callbackContext, this.game); } }, @@ -428,9 +436,9 @@ Phaser.StateManager.prototype = { */ resume: function () { - if (this._created && this.onre) + if (this._created && this.onResumedCallback) { - this.onPausedCallback.call(this.callbackContext, this.game, false); + this.onResumedCallback.call(this.callbackContext, this.game); } }, @@ -517,6 +525,7 @@ Phaser.StateManager.prototype = { this.onUpdateCallback = null; this.onRenderCallback = null; this.onPausedCallback = null; + this.onResumedCallback = null; this.onDestroyCallback = null; this.game = null; diff --git a/src/gameobjects/BitmapData.js b/src/gameobjects/BitmapData.js index 4c5a5287e..9fdcc4625 100644 --- a/src/gameobjects/BitmapData.js +++ b/src/gameobjects/BitmapData.js @@ -108,7 +108,7 @@ Phaser.BitmapData = function (game, key, width, height) { Phaser.BitmapData.prototype = { /** - * Updates the given objects so that they use this BitmapData as their texture. + * Updates the given objects so that they use this BitmapData as their texture. This will replace any texture they will currently have set. * * @method Phaser.BitmapData#add * @param {Phaser.Sprite|Phaser.Sprite[]|Phaser.Image|Phaser.Image[]} object - Either a single Sprite/Image or an Array of Sprites/Images. @@ -217,6 +217,7 @@ Phaser.BitmapData.prototype = { /** * Sets the color of the given pixel to the specified red, green and blue values. + * * @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. @@ -231,7 +232,8 @@ Phaser.BitmapData.prototype = { }, /** - * Get a color of a specific pixel. + * Get the color of a specific pixel. + * * @param {number} x - The X coordinate of the pixel to get. * @param {number} y - The Y coordinate of the pixel to get. * @return {number} A native color value integer (format: 0xRRGGBB) @@ -246,7 +248,8 @@ Phaser.BitmapData.prototype = { }, /** - * Get a color of a specific pixel (including alpha value). + * Get the color of a specific pixel including its alpha value. + * * @param {number} x - The X coordinate of the pixel to get. * @param {number} y - The Y coordinate of the pixel to get. * @return {number} A native color value integer (format: 0xAARRGGBB) @@ -261,8 +264,9 @@ Phaser.BitmapData.prototype = { }, /** - * Get pixels in array in a specific Rectangle. - * @param rect {Rectangle} The specific Rectangle. + * Gets all the pixels from the region specified by the given Rectangle object. + * + * @param {Phaser.Rectangle} rect - The Rectangle region to get. * @return {array} CanvasPixelArray. */ getPixels: function (rect) { @@ -271,15 +275,89 @@ Phaser.BitmapData.prototype = { }, + /** + * Copies the pixels from the source image to this BitmapData based on the given area and destination. + * + * @param {HTMLImage|string} source - The Image to draw. If you give a key it will try and find the Image in the Game.Cache. + * @param {Phaser.Rectangle} area - The Rectangle region to copy from the source image. + * @param {number} destX - The destination x coordinate to copy the image to. + * @param {number} destY - The destination y coordinate to copy the image to. + */ copyPixels: function (source, area, destX, destY) { - this.context.drawImage(source, area.x, area.y, area.width, area.height, destX, destY, area.width, area.height); + if (typeof source === 'string') + { + source = this.game.cache.getImage(source); + } + + if (source) + { + this.context.drawImage(source, area.x, area.y, area.width, area.height, destX, destY, area.width, area.height); + } + + }, + + /** + * Draws the given image to this BitmapData at the coordinates specified. If you need to only draw a part of the image use BitmapData.copyPixels instead. + * + * @param {HTMLImage|string} source - The Image to draw. If you give a key it will try and find the Image in the Game.Cache. + * @param {number} destX - The destination x coordinate to draw the image to. + * @param {number} destY - The destination y coordinate to draw the image to. + */ + draw: function (source, destX, destY) { + + if (typeof source === 'string') + { + source = this.game.cache.getImage(source); + } + + if (source) + { + this.context.drawImage(source, 0, 0, source.width, source.height, destX, destY, source.width, source.height); + } + + }, + + /** + * Draws the given image onto this BitmapData using an image as an alpha mask. + * + * @param {HTMLImage|string} source - The Image to draw. If you give a key it will try and find the Image in the Game.Cache. + * @param {HTMLImage|string} mask - The Image to use as the alpha mask. If you give a key it will try and find the Image in the Game.Cache. + */ + alphaMask: function (source, mask) { + + var temp = this.context.globalCompositeOperation; + + if (typeof mask === 'string') + { + mask = this.game.cache.getImage(mask); + } + + if (mask) + { + this.context.drawImage(mask, 0, 0); + } + + this.context.globalCompositeOperation = 'source-atop'; + + if (typeof source === 'string') + { + source = this.game.cache.getImage(source); + } + + if (source) + { + this.context.drawImage(source, 0, 0); + } + + this.context.globalCompositeOperation = temp; }, /** * 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 */ render: function () { @@ -287,7 +365,7 @@ Phaser.BitmapData.prototype = { if (this._dirty) { // Only needed if running in WebGL, otherwise this array will never get cleared down - if (this.game.renderType == Phaser.WEBGL) + if (this.game.renderType === Phaser.WEBGL) { PIXI.texturesToUpdate.push(this.baseTexture); } diff --git a/src/gameobjects/BitmapText.js b/src/gameobjects/BitmapText.js index 12dcc2388..c2b86bde9 100644 --- a/src/gameobjects/BitmapText.js +++ b/src/gameobjects/BitmapText.js @@ -204,30 +204,25 @@ Phaser.BitmapText.prototype.postUpdate = function () { */ Phaser.BitmapText.prototype.destroy = function() { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); } + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; - if (this.children.length > 0) - { - do - { - this.removeChild(this.children[0]); - } - while (this.children.length > 0); - } - } /** diff --git a/src/gameobjects/GameObjectCreator.js b/src/gameobjects/GameObjectCreator.js new file mode 100644 index 000000000..da0d48053 --- /dev/null +++ b/src/gameobjects/GameObjectCreator.js @@ -0,0 +1,360 @@ +/** +* @author Richard Davey +* @copyright 2014 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} +*/ + +/** +* The Game Object Creator is a quick way to create all of the different sorts of core objects that Phaser uses, but not add them to the game world. +* Use the GameObjectFactory to create and add the objects into the world. +* +* @class Phaser.GameObjectCreator +* @constructor +* @param {Phaser.Game} game - A reference to the currently running game. +*/ +Phaser.GameObjectCreator = function (game) { + + /** + * @property {Phaser.Game} game - A reference to the currently running Game. + */ + this.game = game; + + /** + * @property {Phaser.World} world - A reference to the game world. + */ + this.world = this.game.world; + +}; + +Phaser.GameObjectCreator.prototype = { + + /** + * Create a new `Image` object. An Image is a light-weight object you can use to display anything that doesn't need physics or animation. + * It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics. + * + * @method Phaser.GameObjectCreator#image + * @param {number} x - X position of the image. + * @param {number} y - Y position of the image. + * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. + * @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name. + * @returns {Phaser.Sprite} the newly created sprite object. + */ + image: function (x, y, key, frame) { + + return new Phaser.Image(this.game, x, y, key, frame); + + }, + + /** + * Create a new Sprite with specific position and sprite sheet key. + * + * @method Phaser.GameObjectCreator#sprite + * @param {number} x - X position of the new sprite. + * @param {number} y - Y position of the new sprite. + * @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. + * @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name. + * @returns {Phaser.Sprite} the newly created sprite object. + */ + sprite: function (x, y, key, frame) { + + return new Phaser.Sprite(this.game, x, y, key, frame); + + }, + + /** + * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. + * + * @method Phaser.GameObjectCreator#tween + * @param {object} obj - Object the tween will be run on. + * @return {Phaser.Tween} Description. + */ + tween: function (obj) { + + return this.game.tweens.create(obj); + + }, + + /** + * A Group is a container for display objects that allows for fast pooling, recycling and collision checks. + * + * @method Phaser.GameObjectCreator#group + * @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default. + * @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging. + * @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World. + * @return {Phaser.Group} The newly created group. + */ + group: function (parent, name, addToStage) { + + if (typeof name === 'undefined') { name = 'group'; } + if (typeof addToStage === 'undefined') { addToStage = false; } + + return new Phaser.Group(this.game, parent, name, addToStage); + + }, + + /** + * A Group is a container for display objects that allows for fast pooling, recycling and collision checks. + * + * @method Phaser.GameObjectCreator#spriteBatch + * @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any. + * @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging. + * @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World. + * @return {Phaser.Group} The newly created group. + */ + spriteBatch: function (parent, name, addToStage) { + + if (typeof name === 'undefined') { name = 'group'; } + if (typeof addToStage === 'undefined') { addToStage = false; } + + return new Phaser.SpriteBatch(this.game, parent, name, addToStage); + + }, + + /** + * Creates a new Sound object. + * + * @method Phaser.GameObjectCreator#audio + * @param {string} key - The Game.cache key of the sound that this object will use. + * @param {number} [volume=1] - The volume at which the sound will be played. + * @param {boolean} [loop=false] - Whether or not the sound will loop. + * @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio. + * @return {Phaser.Sound} The newly created text object. + */ + audio: function (key, volume, loop, connect) { + + return this.game.sound.add(key, volume, loop, connect); + + }, + + /** + * Creates a new Sound object. + * + * @method Phaser.GameObjectCreator#sound + * @param {string} key - The Game.cache key of the sound that this object will use. + * @param {number} [volume=1] - The volume at which the sound will be played. + * @param {boolean} [loop=false] - Whether or not the sound will loop. + * @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio. + * @return {Phaser.Sound} The newly created text object. + */ + sound: function (key, volume, loop, connect) { + + return this.game.sound.add(key, volume, loop, connect); + + }, + + /** + * Creates a new TileSprite object. + * + * @method Phaser.GameObjectCreator#tileSprite + * @param {number} x - The x coordinate (in world space) to position the TileSprite at. + * @param {number} y - The y coordinate (in world space) to position the TileSprite at. + * @param {number} width - The width of the TileSprite. + * @param {number} height - The height of the TileSprite. + * @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the TileSprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. + * @param {string|number} frame - If this TileSprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index. + * @return {Phaser.TileSprite} The newly created tileSprite object. + */ + tileSprite: function (x, y, width, height, key, frame) { + + return new Phaser.TileSprite(this.game, x, y, width, height, key, frame); + + }, + + /** + * Creates a new Text object. + * + * @method Phaser.GameObjectCreator#text + * @param {number} x - X position of the new text object. + * @param {number} y - Y position of the new text object. + * @param {string} text - The actual text that will be written. + * @param {object} style - The style object containing style attributes like font, font size , etc. + * @return {Phaser.Text} The newly created text object. + */ + text: function (x, y, text, style, group) { + + return new Phaser.Text(this.game, x, y, text, style); + + }, + + /** + * Creates a new Button object. + * + * @method Phaser.GameObjectCreator#button + * @param {number} [x] X position of the new button object. + * @param {number} [y] Y position of the new button object. + * @param {string} [key] The image key as defined in the Game.Cache to use as the texture for this button. + * @param {function} [callback] The function to call when this button is pressed + * @param {object} [callbackContext] The context in which the callback will be called (usually 'this') + * @param {string|number} [overFrame] This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name. + * @param {string|number} [outFrame] This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name. + * @param {string|number} [downFrame] This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name. + * @param {string|number} [upFrame] This is the frame or frameName that will be set when this button is in an up state. Give either a number to use a frame ID or a string for a frame name. + * @return {Phaser.Button} The newly created button object. + */ + button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame, group) { + + return new Phaser.Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame); + + }, + + /** + * Creates a new Graphics object. + * + * @method Phaser.GameObjectCreator#graphics + * @param {number} x - X position of the new graphics object. + * @param {number} y - Y position of the new graphics object. + * @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group. + * @return {Phaser.Graphics} The newly created graphics object. + */ + graphics: function (x, y, group) { + + return new Phaser.Graphics(this.game, x, y); + + }, + + /** + * Emitter is a lightweight particle emitter. It can be used for one-time explosions or for + * continuous effects like rain and fire. All it really does is launch Particle objects out + * at set intervals, and fixes their positions and velocities accorindgly. + * + * @method Phaser.GameObjectCreator#emitter + * @param {number} [x=0] - The x coordinate within the Emitter that the particles are emitted from. + * @param {number} [y=0] - The y coordinate within the Emitter that the particles are emitted from. + * @param {number} [maxParticles=50] - The total number of particles in this emitter. + * @return {Phaser.Emitter} The newly created emitter object. + */ + emitter: function (x, y, maxParticles) { + + return new Phaser.Particles.Arcade.Emitter(this.game, x, y, maxParticles); + + }, + + /** + * Create a new BitmapFont object to be used as a texture for an Image or Sprite and optionally add it to the Cache. + * The texture can be asssigned or one or multiple images/sprites, but note that the text the BitmapFont uses will be shared across them all, + * i.e. if you need each Image to have different text in it, then you need to create multiple BitmapFont objects. + * + * @method Phaser.GameObjectCreator#bitmapFont + * @param {string} font - The key of the image in the Game.Cache that the BitmapFont will use. + * @param {number} characterWidth - The width of each character in the font set. + * @param {number} characterHeight - The height of each character in the font set. + * @param {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements. + * @param {number} charsPerRow - The number of characters per row in the font set. + * @param {number} [xSpacing=0] - If the characters in the font set have horizontal spacing between them set the required amount here. + * @param {number} [ySpacing=0] - If the characters in the font set have vertical spacing between them set the required amount here. + * @param {number} [xOffset=0] - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here. + * @param {number} [yOffset=0] - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here. + * @return {Phaser.BitmapFont} The newly created BitmapFont texture which can be applied to an Image or Sprite. + */ + bitmapFont: function (font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset) { + + return new Phaser.BitmapFont(this.game, font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset); + + }, + + /** + * Create a new BitmapText object. + * + * @method Phaser.GameObjectCreator#bitmapText + * @param {number} x - X position of the new bitmapText object. + * @param {number} y - Y position of the new bitmapText object. + * @param {string} font - The key of the BitmapText font as stored in Game.Cache. + * @param {string} [text] - The actual text that will be rendered. Can be set later via BitmapText.text. + * @param {number} [size] - The size the font will be rendered in, in pixels. + * @return {Phaser.BitmapText} The newly created bitmapText object. + */ + bitmapText: function (x, y, font, text, size, group) { + + return new Phaser.BitmapText(this.game, x, y, font, text, size); + + }, + + /** + * Creates a new Tilemap object. + * + * @method Phaser.GameObjectCreator#tilemap + * @param {string} key - Asset key for the JSON or CSV map data in the cache. + * @param {object|string} tilesets - An object mapping Cache.tileset keys with the tileset names in the JSON file. If a string is provided that will be used. + * @return {Phaser.Tilemap} The newly created tilemap object. + */ + tilemap: function (key, tilesets) { + + return new Phaser.Tilemap(this.game, key, tilesets); + + }, + + /** + * A dynamic initially blank canvas to which images can be drawn. + * + * @method Phaser.GameObjectCreator#renderTexture + * @param {number} [width=100] - the width of the RenderTexture. + * @param {number} [height=100] - the height of the RenderTexture. + * @param {string} [key=''] - Asset key for the RenderTexture when stored in the Cache (see addToCache parameter). + * @param {boolean} [addToCache=false] - Should this RenderTexture be added to the Game.Cache? If so you can retrieve it with Cache.getTexture(key) + * @return {Phaser.RenderTexture} The newly created RenderTexture object. + */ + renderTexture: function (width, height, key, addToCache) { + + if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); } + if (typeof addToCache === 'undefined') { addToCache = false; } + + var texture = new Phaser.RenderTexture(this.game, width, height, key); + + if (addToCache) + { + this.game.cache.addRenderTexture(key, texture); + } + + return texture; + + }, + + /** + * A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites. + * + * @method Phaser.GameObjectCreator#bitmapData + * @param {number} [width=100] - The width of the BitmapData in pixels. + * @param {number} [height=100] - The height of the BitmapData in pixels. + * @param {string} [key=''] - Asset key for the BitmapData when stored in the Cache (see addToCache parameter). + * @param {boolean} [addToCache=false] - Should this BitmapData be added to the Game.Cache? If so you can retrieve it with Cache.getBitmapData(key) + * @return {Phaser.BitmapData} The newly created BitmapData object. + */ + bitmapData: function (width, height, addToCache) { + + if (typeof addToCache === 'undefined') { addToCache = false; } + if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); } + + var texture = new Phaser.BitmapData(this.game, key, width, height); + + if (addToCache) + { + this.game.cache.addBitmapData(key, texture); + } + + return texture; + + }, + + /** + * A WebGL shader/filter that can be applied to Sprites. + * + * @method Phaser.GameObjectCreator#filter + * @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 filter = new Phaser.Filter[filter](this.game); + + filter.init.apply(filter, args); + + return filter; + + } + +}; + +Phaser.GameObjectCreator.prototype.constructor = Phaser.GameObjectCreator; diff --git a/src/gameobjects/GameObjectFactory.js b/src/gameobjects/GameObjectFactory.js index 3dae41e8d..4320eba65 100644 --- a/src/gameobjects/GameObjectFactory.js +++ b/src/gameobjects/GameObjectFactory.js @@ -83,7 +83,7 @@ Phaser.GameObjectFactory.prototype = { * * @method Phaser.GameObjectFactory#tween * @param {object} obj - Object the tween will be run on. - * @return {Phaser.Tween} Description. + * @return {Phaser.Tween} The newly created Phaser.Tween object. */ tween: function (obj) { @@ -95,7 +95,7 @@ Phaser.GameObjectFactory.prototype = { * A Group is a container for display objects that allows for fast pooling, recycling and collision checks. * * @method Phaser.GameObjectFactory#group - * @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any. + * @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default. * @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging. * @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World. * @return {Phaser.Group} The newly created group. diff --git a/src/gameobjects/Image.js b/src/gameobjects/Image.js index 656790812..a76285b6b 100644 --- a/src/gameobjects/Image.js +++ b/src/gameobjects/Image.js @@ -369,11 +369,6 @@ Phaser.Image.prototype.kill = function() { */ Phaser.Image.prototype.destroy = function() { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); @@ -389,10 +384,19 @@ Phaser.Image.prototype.destroy = function() { this.input.destroy(); } + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.alive = false; this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; } diff --git a/src/gameobjects/RenderTexture.js b/src/gameobjects/RenderTexture.js index 1fb002d9d..f4db87081 100644 --- a/src/gameobjects/RenderTexture.js +++ b/src/gameobjects/RenderTexture.js @@ -30,9 +30,51 @@ Phaser.RenderTexture = function (game, width, height, key) { */ this.type = Phaser.RENDERTEXTURE; + /** + * @property {Phaser.Point} _temp - Internal var. + * @private + */ + this._temp = new Phaser.Point(); + PIXI.RenderTexture.call(this, width, height); }; Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype); Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture; + +/** +* This function will draw the display object to the texture. +* +* @method Phaser.RenderTexture.prototype.renderXY +* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapText|Phaser.Group} displayObject The display object to render to this texture. +* @param {number} x - The x position to render the object at. +* @param {number} y - The y position to render the object at. +* @param {boolean} clear - If true the texture will be cleared before the display object is drawn. +*/ +Phaser.RenderTexture.prototype.renderXY = function (displayObject, x, y, clear) { + + this._temp.set(x, y); + + this.render(displayObject, this._temp, clear); + +} + +// Documentation stubs + +/** +* This function will draw the display object to the texture. +* +* @method Phaser.RenderTexture.prototype.render +* @param {Phaser.Sprite|Phaser.Image|Phaser.Text|Phaser.BitmapText|Phaser.Group} displayObject The display object to render to this texture. +* @param {Phaser.Point} position - A Point object containing the position to render the display object at. +* @param {boolean} clear - If true the texture will be cleared before the display object is drawn. +*/ + +/** +* Resize this RenderTexture to the given width and height. +* +* @method Phaser.RenderTexture.prototype.resize +* @param {number} width - The new width of the RenderTexture. +* @param {number} height - The new height of the RenderTexture. +*/ diff --git a/src/gameobjects/Sprite.js b/src/gameobjects/Sprite.js index 232c94efd..04769f331 100644 --- a/src/gameobjects/Sprite.js +++ b/src/gameobjects/Sprite.js @@ -14,6 +14,7 @@ * events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases. * * @constructor +* @extends PIXI.Sprite * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} x - The x coordinate (in world space) to position the Sprite at. * @param {number} y - The y coordinate (in world space) to position the Sprite at. @@ -491,11 +492,6 @@ Phaser.Sprite.prototype.kill = function() { */ Phaser.Sprite.prototype.destroy = function() { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); @@ -521,10 +517,19 @@ Phaser.Sprite.prototype.destroy = function() { this.events.destroy(); } + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.alive = false; this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; }; diff --git a/src/gameobjects/Text.js b/src/gameobjects/Text.js index 5aa0b4238..2bca231fc 100644 --- a/src/gameobjects/Text.js +++ b/src/gameobjects/Text.js @@ -10,6 +10,7 @@ * Here is a compatibility table showing the available default fonts across different mobile browsers: http://www.jordanm.co.uk/tinytype * * @class Phaser.Text +* @extends PIXI.Text * @constructor * @param {Phaser.Game} game - Current game instance. * @param {number} x - X position of the new text object. @@ -170,7 +171,6 @@ Phaser.Text.prototype.update = function() { */ Phaser.Text.prototype.postUpdate = function () { - // Fixed to Camera? if (this._cache[7] === 1) { this.position.x = this.game.camera.view.x + this.cameraOffset.x; @@ -184,11 +184,6 @@ Phaser.Text.prototype.postUpdate = function () { */ Phaser.Text.prototype.destroy = function () { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); @@ -206,9 +201,18 @@ Phaser.Text.prototype.destroy = function () { this.context = null; } + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; } diff --git a/src/gameobjects/TileSprite.js b/src/gameobjects/TileSprite.js index e147145fc..f13ac4adb 100644 --- a/src/gameobjects/TileSprite.js +++ b/src/gameobjects/TileSprite.js @@ -83,6 +83,11 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) { this.position.set(x, y); + /** + * @property {Phaser.InputHandler|null} input - The Input Handler for this object. Needs to be enabled with image.inputEnabled = true before you can use it. + */ + this.input = null; + /** * @property {Phaser.Point} world - The world coordinates of this Sprite. This differs from the x/y coordinates which are relative to the Sprites container. */ @@ -288,9 +293,18 @@ Phaser.TileSprite.prototype.destroy = function() { this.events.destroy(); + var i = this.children.length; + + while (i--) + { + this.removeChild(this.children[i]); + } + this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; } @@ -409,3 +423,39 @@ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { } }); + +/** +* By default a TileSprite won't process any input events at all. By setting inputEnabled to true the Phaser.InputHandler is +* activated for this object and it will then start to process click/touch events and more. +* +* @name Phaser.TileSprite#inputEnabled +* @property {boolean} inputEnabled - Set to true to allow this object to receive input events. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { + + get: function () { + + return (this.input && this.input.enabled); + + }, + + set: function (value) { + + if (value) + { + if (this.input === null) + { + this.input = new Phaser.InputHandler(this); + this.input.start(); + } + } + else + { + if (this.input && this.input.enabled) + { + this.input.stop(); + } + } + } + +}); diff --git a/src/input/Input.js b/src/input/Input.js index c9b7dbc11..844c80111 100644 --- a/src/input/Input.js +++ b/src/input/Input.js @@ -730,6 +730,22 @@ Phaser.Input.prototype = { return false; } + else if (displayObject instanceof Phaser.TileSprite) + { + var width = displayObject.width; + var height = displayObject.height; + var x1 = -width * displayObject.anchor.x; + + if (this._localPoint.x > x1 && this._localPoint.x < x1 + width) + { + var y1 = -height * displayObject.anchor.y; + + if (this._localPoint.y > y1 && this._localPoint.y < y1 + height) + { + return true; + } + } + } else if (displayObject instanceof PIXI.Sprite) { var width = displayObject.texture.frame.width; diff --git a/src/input/InputHandler.js b/src/input/InputHandler.js index a42ca770e..210f34c25 100644 --- a/src/input/InputHandler.js +++ b/src/input/InputHandler.js @@ -628,7 +628,7 @@ Phaser.InputHandler.prototype = { return; } - if (this.enabled === false || this.sprite.visible === false || (this.sprite.group && this.sprite.group.visible === false)) + if (!this.enabled || !this.sprite.visible || !this.sprite.parent.visible) { this._pointerOutHandler(pointer); return false; diff --git a/src/input/Mouse.js b/src/input/Mouse.js index 0a429375e..033236f0f 100644 --- a/src/input/Mouse.js +++ b/src/input/Mouse.js @@ -165,7 +165,7 @@ Phaser.Mouse.prototype = { event.preventDefault(); } - this.button = event.which; + this.button = event.button; if (this.mouseDownCallback) { diff --git a/src/loader/Cache.js b/src/loader/Cache.js index 3945e6937..37ca004a6 100644 --- a/src/loader/Cache.js +++ b/src/loader/Cache.js @@ -49,6 +49,12 @@ Phaser.Cache = function (game) { */ this._text = {}; + /** + * @property {object} _text - Text key-value container. + * @private + */ + this._json = {}; + /** * @property {object} _physics - Physics data key-value container. * @private @@ -149,6 +155,12 @@ Phaser.Cache.BITMAPDATA = 9; */ Phaser.Cache.BITMAPFONT = 10; +/** +* @constant +* @type {number} +*/ +Phaser.Cache.JSON = 11; + Phaser.Cache.prototype = { /** @@ -382,6 +394,20 @@ Phaser.Cache.prototype = { }, + /** + * Add a new json object into the cache. + * + * @method Phaser.Cache#addJSON + * @param {string} key - Asset key for the text data. + * @param {string} url - URL of this text data file. + * @param {object} data - Extra text data. + */ + addJSON: function (key, url, data) { + + this._json[key] = { url: url, data: data }; + + }, + /** * Add a new image. * @@ -880,6 +906,26 @@ Phaser.Cache.prototype = { }, + /** + * Get a JSON object by key from the cache. + * + * @method Phaser.Cache#getJSON + * @param {string} key - Asset key of the json object to retrieve from the Cache. + * @return {object} The JSON object. + */ + getJSON: function (key) { + + if (this._json[key]) + { + return this._json[key].data; + } + else + { + console.warn('Phaser.Cache.getJSON: Invalid key: "' + key + '"'); + } + + }, + /** * Get binary data by key. * @@ -952,6 +998,10 @@ Phaser.Cache.prototype = { case Phaser.Cache.BITMAPFONT: array = this._bitmapFont; break; + + case Phaser.Cache.JSON: + array = this._json; + break; } if (!array) @@ -1013,6 +1063,16 @@ Phaser.Cache.prototype = { delete this._text[key]; }, + /** + * Removes a json object from the cache. + * + * @method Phaser.Cache#removeJSON + * @param {string} key - Key of the asset you want to remove. + */ + removeJSON: function (key) { + delete this._json[key]; + }, + /** * Removes a physics data file from the cache. * @@ -1090,6 +1150,11 @@ Phaser.Cache.prototype = { delete this._text[item['key']]; } + for (var item in this._json) + { + delete this._json[item['key']]; + } + for (var item in this._textures) { delete this._textures[item['key']]; diff --git a/src/loader/Loader.js b/src/loader/Loader.js index f6ee485fe..b4b7cd20a 100644 --- a/src/loader/Loader.js +++ b/src/loader/Loader.js @@ -144,10 +144,10 @@ Phaser.Loader.prototype = { /** * You can set a Sprite to be a "preload" sprite by passing it to this method. * A "preload" sprite will have its width or height crop adjusted based on the percentage of the loader in real-time. - * This allows you to easily make loading bars for games. + * This allows you to easily make loading bars for games. Note that Sprite.visible = true will be set when calling this. * * @method Phaser.Loader#setPreloadSprite - * @param {Phaser.Sprite} sprite - The sprite that will be cropped during the load. + * @param {Phaser.Sprite|Phaser.Image} sprite - The sprite that will be cropped during the load. * @param {number} [direction=0] - A value of zero means the sprite width will be cropped, a value of 1 means its height will be cropped. */ setPreloadSprite: function (sprite, direction) { @@ -169,6 +169,8 @@ Phaser.Loader.prototype = { sprite.crop(this.preloadSprite.crop); + sprite.visible = true; + }, /** @@ -359,6 +361,32 @@ Phaser.Loader.prototype = { }, + /** + * Add a json file to the Loader. + * + * @method Phaser.Loader#json + * @param {string} key - Unique asset key of the json file. + * @param {string} url - URL of the json file. + * @param {boolean} [overwrite=false] - If an unloaded file with a matching key already exists in the queue, this entry will overwrite it. + * @return {Phaser.Loader} This Loader instance. + */ + json: function (key, url, overwrite) { + + if (typeof overwrite === "undefined") { overwrite = false; } + + if (overwrite) + { + this.replaceInFileList('json', key, url); + } + else + { + this.addToFileList('json', key, url); + } + + return this; + + }, + /** * Add a JavaScript file to the Loader. Once loaded the JavaScript file will be automatically turned into a script tag (and executed), so be careful what you load! * @@ -883,6 +911,15 @@ Phaser.Loader.prototype = { break; + case 'json': + this._xhr.open("GET", this.baseURL + file.url, true); + this._xhr.responseType = "text"; + this._xhr.onload = function () { + return _this.jsonLoadComplete(_this._fileIndex); + }; + this._xhr.send(); + break; + case 'tilemap': this._xhr.open("GET", this.baseURL + file.url, true); this._xhr.responseType = "text"; @@ -1174,6 +1211,10 @@ Phaser.Loader.prototype = { { this.game.cache.addTilemap(file.key, file.url, data, file.format); } + else if (file.type === 'json') + { + this.game.cache.addJSON(file.key, file.url, data); + } else { this.game.cache.addTextureAtlas(file.key, file.url, file.data, data, file.format); @@ -1305,8 +1346,6 @@ Phaser.Loader.prototype = { { this.preloadSprite.crop.height = Math.floor((this.preloadSprite.height / 100) * this.progress); } - - // this.preloadSprite.sprite.crop = this.preloadSprite.crop; } this.onFileComplete.dispatch(this.progress, this._fileList[previousIndex].key, success, this.totalLoadedFiles(), this._fileList.length); diff --git a/src/physics/Body.js b/src/physics/Body.js index 218e90e08..a800f720e 100644 --- a/src/physics/Body.js +++ b/src/physics/Body.js @@ -49,14 +49,14 @@ Phaser.Physics.Body = function (game, sprite, x, y, mass) { this.data.parent = this; /** - * @property {Phaser.PointProxy} velocity - The velocity of the body. Set velocity.x to a negative value to move to the left, position to the right. velocity.y negative values move up, positive move down. + * @property {Phaser.InversePointProxy} velocity - The velocity of the body. Set velocity.x to a negative value to move to the left, position to the right. velocity.y negative values move up, positive move down. */ - this.velocity = new Phaser.Physics.PointProxy(this.data.velocity); + this.velocity = new Phaser.Physics.InversePointProxy(this.game, this.data.velocity); /** - * @property {Phaser.PointProxy} force - The force applied to the body. + * @property {Phaser.InversePointProxy} force - The force applied to the body. */ - this.force = new Phaser.Physics.PointProxy(this.data.force); + this.force = new Phaser.Physics.InversePointProxy(this.game, this.data.force); /** * @property {Phaser.Point} gravity - A locally applied gravity force to the Body. Applied directly before the world step. NOTE: Not currently implemented. @@ -1467,13 +1467,13 @@ Object.defineProperty(Phaser.Physics.Body.prototype, "x", { get: function () { - return this.p2px(this.data.position[0]); + return this.p2pxi(this.data.position[0]); }, set: function (value) { - this.data.position[0] = this.px2p(value); + this.data.position[0] = this.px2pi(value); } @@ -1487,13 +1487,13 @@ Object.defineProperty(Phaser.Physics.Body.prototype, "y", { get: function () { - return this.p2px(this.data.position[1]); + return this.p2pxi(this.data.position[1]); }, set: function (value) { - this.data.position[1] = this.px2p(value); + this.data.position[1] = this.px2pi(value); } diff --git a/src/physics/InversePointProxy.js b/src/physics/InversePointProxy.js index db936c9bc..c00d9af76 100644 --- a/src/physics/InversePointProxy.js +++ b/src/physics/InversePointProxy.js @@ -10,10 +10,12 @@ * @class Phaser.Physics.InversePointProxy * @classdesc InversePointProxy * @constructor +* @param {Phaser.Game} game - A reference to the Phaser.Game instance. * @param {any} destination - The object to bind to. */ -Phaser.Physics.InversePointProxy = function (destination) { +Phaser.Physics.InversePointProxy = function (game, destination) { + this.game = game; this.destination = destination; }; @@ -34,7 +36,7 @@ Object.defineProperty(Phaser.Physics.InversePointProxy.prototype, "x", { set: function (value) { - this.destination[0] = -value; + this.destination[0] = this.game.math.px2p(-value); } @@ -54,7 +56,7 @@ Object.defineProperty(Phaser.Physics.InversePointProxy.prototype, "y", { set: function (value) { - this.destination[1] = -value; + this.destination[1] = this.game.math.px2p(-value); } diff --git a/src/physics/PointProxy.js b/src/physics/PointProxy.js index 57b43083f..409ef7829 100644 --- a/src/physics/PointProxy.js +++ b/src/physics/PointProxy.js @@ -10,10 +10,12 @@ * @class Phaser.Physics.PointProxy * @classdesc PointProxy * @constructor +* @param {Phaser.Game} game - A reference to the Phaser.Game instance. * @param {any} destination - The object to bind to. */ -Phaser.Physics.PointProxy = function (destination) { +Phaser.Physics.PointProxy = function (game, destination) { + this.game = game; this.destination = destination; }; @@ -34,7 +36,7 @@ Object.defineProperty(Phaser.Physics.PointProxy.prototype, "x", { set: function (value) { - this.destination[0] = value; + this.destination[0] = this.game.math.px2p(value); } @@ -54,7 +56,7 @@ Object.defineProperty(Phaser.Physics.PointProxy.prototype, "y", { set: function (value) { - this.destination[1] = value; + this.destination[1] = this.game.math.px2p(value); } diff --git a/src/sound/SoundManager.js b/src/sound/SoundManager.js index 31988184a..2b7cd833a 100644 --- a/src/sound/SoundManager.js +++ b/src/sound/SoundManager.js @@ -352,12 +352,9 @@ Phaser.SoundManager.prototype = { * @param {string} key - Asset key for the sound. * @param {number} [volume=1] - Default value for the volume. * @param {boolean} [loop=false] - Whether or not the sound will loop. - * @param {boolean} [destroyOnComplete=false] - If true the Sound will destroy itself once it has finished playing, or is stopped. * @return {Phaser.Sound} The new sound instance. */ - play: function (key, volume, loop, destroyOnComplete) { - - if (typeof destroyOnComplete == 'undefined') { destroyOnComplete = false; } + play: function (key, volume, loop) { var sound = this.add(key, volume, loop); diff --git a/src/tilemap/TilemapParser.js b/src/tilemap/TilemapParser.js index e325cf8ce..973e3917c 100644 --- a/src/tilemap/TilemapParser.js +++ b/src/tilemap/TilemapParser.js @@ -66,7 +66,7 @@ Phaser.TilemapParser = { }, /** - * Parse tileset data from the cache and creates a Tileset object. + * Parse tilemap data from the cache and creates a Tilemap object. * @method Phaser.TilemapParser.parse * @param {Phaser.Game} game - Game reference to the currently running game. * @param {string} key - The key of the tilemap in the Cache. @@ -400,7 +400,14 @@ Phaser.TilemapParser = { newSet.columns = (set.imagewidth - set.margin) / (set.tilewidth + set.spacing); newSet.total = newSet.rows * newSet.columns; - tilesets.push(newSet); + if (newSet.rows % 1 !== 0 || newSet.columns % 1 !== 0) + { + console.warn('TileSet image dimensions do not match expected dimensions. Tileset width/height must be evenly divisible by Tilemap tile width/height.'); + } + else + { + tilesets.push(newSet); + } } map.tilesets = tilesets; diff --git a/src/utils/Debug.js b/src/utils/Debug.js index 2dedd032d..a42a3bcdb 100644 --- a/src/utils/Debug.js +++ b/src/utils/Debug.js @@ -350,6 +350,21 @@ Phaser.Utils.Debug.prototype = { }, + /** + * Renders the Sprites bounds. Note: This is really expensive as it has to calculate the bounds every time you call it! + * @method Phaser.Utils.Debug#renderSpriteBounds + * @param {Phaser.Sprite} sprite - Description. + * @param {string} [color] - Color of the debug info to be rendered (format is css color string). + * @param {boolean} [filled=true] - Render the rectangle as a fillRect (default, true) or a strokeRect (false) + */ + renderSpriteBounds: function (sprite, color, filled) { + + var bounds = sprite.getBounds(); + + this.renderRectangle(bounds, color, filled); + + }, + /** * Render debug infos (including name, bounds info, position and some other properties) about the Sprite. * @method Phaser.Utils.Debug#renderSpriteInfo @@ -373,26 +388,7 @@ Phaser.Utils.Debug.prototype = { this.line('x: ' + sprite.x.toFixed(1) + ' y: ' + sprite.y.toFixed(1)); this.line('angle: ' + sprite.angle.toFixed(1) + ' rotation: ' + sprite.rotation.toFixed(1)); this.line('visible: ' + sprite.visible + ' in camera: ' + sprite.inCamera); - this.line('body x: ' + sprite.body.x.toFixed(1) + ' y: ' + sprite.body.y.toFixed(1)); - // 0 = scaleX - // 1 = skewY - // 2 = translateX - // 3 = skewX - // 4 = scaleY - // 5 = translateY - - this.line('id: ' + sprite._id); - this.line('scale x: ' + sprite.worldTransform[0]); - this.line('scale y: ' + sprite.worldTransform[4]); - this.line('tx: ' + sprite.worldTransform[2]); - this.line('ty: ' + sprite.worldTransform[5]); - this.line('skew x: ' + sprite.worldTransform[3]); - this.line('skew y: ' + sprite.worldTransform[1]); - this.line('sdx: ' + sprite.deltaX); - this.line('sdy: ' + sprite.deltaY); - - // this.line('inCamera: ' + this.game.renderer.spriteRenderer.inCamera(this.game.camera, sprite)); this.stop(); }, diff --git a/tutorials/01 Getting Started/part4.html b/tutorials/01 Getting Started/part4.html index d533f735c..4077a440e 100644 --- a/tutorials/01 Getting Started/part4.html +++ b/tutorials/01 Getting Started/part4.html @@ -29,7 +29,7 @@

      WebStorm

      -

      JetBrains WebStorm is an extremely advanced fully development environment. It goes well beyond simple code editing and offers all of the high-level features you'd expect from a proper IDE include code-insight, npm built-in, code style/syntax reports, source control and a wealth of other features designed more for web developers than game developers. It's based on IntelliJ IDEA, which is both a good and bad thing. For a start the actual code editing experience is nothing like as smooth and freeform as with Sublime, but the power features can often make up for that. Having errors with your code spotted for you, before you've even tested your game can be really useful. And code-completion is great too, although obviously somewhat limited by the myriad ways JavaScript can be written.

      +

      JetBrains WebStorm is an extremely advanced fully development environment. It goes well beyond simple code editing and offers all of the high-level features you'd expect from a proper IDE include code-insight, npm built-in, code style/syntax reports, source control and a wealth of other features designed more for web developers than game developers. It's based on IntelliJ IDEA, a heavily Java based editor, which is both a good and bad thing. For a start the actual code editing experience is nothing like as smooth and freeform as with Sublime and OS integration is weak, but the power features can often make up for that. Having errors with your code spotted for you, before you've even tested your game can be really useful. And code-completion is great too, although obviously somewhat limited by the myriad ways JavaScript can be written.

      The full version starts from $49 and is available for Windows and OS X. There are often deals to be found on the JetBrains site too.