diff --git a/README.md b/README.md index e9241f63..c403ab76 100644 --- a/README.md +++ b/README.md @@ -32,81 +32,32 @@ As before we offer a heart-felt "Thank you!" to everyone who has encouraged us a Phaser is everything we ever wanted from an HTML5 game framework. It powers all of our client work in build today and remains our single most important product, and we've only just scratched the surface of what we have planned for it. -![Blasteroids](http://www.photonstorm.com/wp-content/uploads/2013/04/phaser_blaster.png) -(swap for tanks) +![MiniCybernoid](http://www.photonstorm.com/wp-content/uploads/2013/10/phaser-cybernoid-640x480.png) Change Log ---------- Version 1.1 +What's New: + * JSDoc is go! We've added jsdoc3 blocks to every property and function, in every file. * Brand new Example system (no more php!) and over 150 examples to learn from too. * New TypeScript definitions file generated (in the build folder - thanks to TomTom1229 for manually enhancing this). * New Grunt based build system added (thanks to Florent Cailhol) - -* Added World.postUpdate - all sprite position changes, as a result of physics, happen here before the render. -* Complete overhaul of Physics.Arcade.Body - now significantly more stable and faster too. -* Updated ArcadePhysics.separateX/Y to use new body system - much better results now. -* QuadTree bug found in 1.0.5 now fixed. The QuadTree is updated properly now using localTransform values. -* Fixed the Bounce.In and Bounce.InOut tweens (thanks XekeDeath) -* Renamed Phaser.Text.text to Phaser.Text.content to avoid conflict and overwrite from Pixi local var. -* Renamed Phaser.Text.style to Phaser.Text.font to avoid conflict and overwrite from Pixi local var. -* Phaser.Button now sets useHandCursor to true by default. -* Fixed an issue in Animation.update where if the game was paused it would get an insane delta timer throwing a uuid error. -* Added PixiPatch.js to patch in a few essential features until Pixi is updated. -* Fixed issue in Animation.play where the given frameRate and loop values wouldn't overwrite those set on construction. -* Added Animation.paused - can be set to true/false. * New: Phaser.Animation.generateFrameNames - really useful when creating animation data from texture atlases using file names, not indexes. * Added Sprite.play as a handy short-cut to play an animation already loaded onto a Sprite. -* Fixed small bug stopping Tween.pause / resume from resuming correctly when called directly. -* Fixed an issue where Tweens.removeAll wasn't clearing tweens in the addition queue. -* Change: When you start a new State all active tweens are now purged. -* BUG: Loader conflict if 2 keys are the same even if they are in different packages (i.e. you can't use "title" for both and image and sound file). -* Fixed Particle Emitters when using Emitter width/height (thanks XekeDeath) -* Made animation looping more robust when skipping frames (thanks XekeDeath) -* Fix for incorrect new particle positioning (issue #73) (thanks cottonflop) -* Added support for Body.maxVelocity (thanks cocoademon) -* Fixed issue in Sound.play where if you gave a missing marker it would play the whole sound sprite instead. -* Button.setFrames will set the current frame based on the button state immediately. -* InputHandler now creates the _pointerData array on creation and populates with one empty set of values, so pointerOver etc all work before a start call. * Added Canvas.setUserSelect() to disable touchCallouts and user selections within the canvas. -* When the game boots it will now by default disable user-select and touch action events on the game canvas. -* Loaded.setPreloadSprite now rounds the width/height values and starts from 1. This fixes canvas draw errors in IE9/10 and Firefox. -* Fixed issue causing Keyboard.justPressed to always fire (thanks stemkoski) * Added Keyboard.addKey() which creates a new Phaser.Key object that can be polled for updates, pressed states, etc. See the 2 new examples showing use. -* Removed the callbackContext parameter from Group.callAll because it's no longer needed. -* Updated Group.forEach, forEachAlive and forEachDead so you can now pass as many parameters as you want, which will all be given to the callback after the child. -* Updated build script so it can be run from the command-line and includes UMD wrappers (thanks iaincarsberg) -* Fixed bug in LinkedList#remove that could cause first to point to a dead node (thanks onedayitwillmake) -* Moved LinkedList.dump to Debug.dumpLinkedList(list) * Added Button.freezeFrames boolean. Stops the frames being set on mouse events if true. -* Phaser.Animation.Frame is now Phaser.Frame -* Phaser.Animation.FrameData is now Phaser.FrameData -* Phaser.Animation.Parser is now Phaser.AnimationParser (also the file has renamed from Parser.js to AnimationParser.js) -* Phaser.Loader.Parser is now Phaser.LoaderParser (also the file has renamed from Parser.js to LoaderParser.js) -* Fixed Cache.addDefaultImage so the default image works in Canvas as well as WebGL. Updated to a new image (32x32 black square with green outline) * Extended the Loader 404 error to display the url of the file that didn't load as well as the key. -* Change: We've removed the scrollFactor property from all Game Objects. Sorry, but the new Camera system doesn't work with it and it caused all kinds of issues anyway. We will sort out a replacement for it at a later date. -* Change: World now extends Phaser.Group. As a result we've updated GameObjectFactory and other classes that linked to it. If you have anywhere in your code that used to reference world.group you can just remove 'group' from that. So before, world.group.add() is now just world.add(). -* Change: The Camera has been completely revamped. Rather than adjusting the position of all display objects (bad) it now just shifts the position of the single world container (good!), this is much quicker and also stops the game objects positions from self-adjusting all the time, allowing for them to be properly nested with other containers. * New: Direction constants have been added to Sprites and adjust based on body motion. -* World.randomX/Y now returns values anywhere in the world.bounds range (if set, otherwise 0), including negative values. -* Fixed a bug in the Sprite transform cache check that caused the skew/scale cache to get constantly invalidated - now only updates as needed, significant performance increase! * Brand new Sprite.update loop handler. Combined with the transform cache fix and further optimisations this is now much quicker to execute. -* Made Sprite.body optional and added in checks, so you can safely null the Sprite body object if using your own physics system and not impact rendering. -* Fixed typo in StageScaleMode so it's not pageAlignVeritcally any longer, but pageAlignVertically. -* Fixed issue in Group.countLiving / countDead where the value was off by one (thanks mjablonski) -* Fixed issue with a jittery Camera if you moved a Sprite via velocity instead of x/y placement. * Added Keyboard.createCursorKeys() which creates an object with 4 Key objects inside it mapped to up, down, left and right. See the new example in the input folder. * Added Body.skipQuadTree boolean for more fine-grained control over when a body is added to the World QuadTree. * Re-implemented Angular Velocity and Angular Acceleration on the Sprite.body and created 2 new examples to show use. -* Moved the Camera update checks to World.postUpdate, so all the sprites get the correct adjusted camera position. * Added Sprite.fixedToCamera boolean. A Sprite that is fixed to the camera doesn't move with the world, but has its x/y coordinates relative to the top-left of the camera. -* Updated InputHandler to use Math.round rather than Math.floor when snapping an object during drag. -* If you didn't provide the useNumericIndex parameter then AnimationManager.add will set the value by looking at the datatype of the first element in the frames array. * Added Group.createMultiple - useful when you need to create a Group of identical sprites for pooling, such as bullets. -* Group.create now sets the visible and alive properties of the Sprite to the same value as the 'exists' parameter. * Added Group.total. Same as Group.length, but more in line with the rest of the Group naming. * Added Sprite.outOfBoundsKill boolean flag. Will automatically kill a sprite that leaves the game World bounds (off by default). * Lots of changes and fixes in ArcadePhysics, including: @@ -116,48 +67,108 @@ Version 1.1 * New distance functions: distanceBetween, distanceToXY, distanceToPointer * New angle functions: angleBetween, angleToXY, angleToPointer * velocityFromAngle and velocityFromRotation added with examples created. -* Fixed the RandomDataGenerator.sow method so if you give in the same seed you'll now get the same results (thanks Hsaka) -* World.randomX/Y now works with negative World.bounds values. * Added killOnComplete parameter to Animation.play. Really useful in situations where you want a Sprite to animate once then kill itself on complete, like an explosion effect. * Added Sprite.loadTexture(key, frame) which allows you to load a new texture set into an existing sprite rather than having to create a new sprite. -* Tweens .to will now always return the parent (thanks powerfear) -* You can now pass a PIXI.Texture to Sprite (you also need to pass a Phaser.Frame as the frame parameter) but this is useful for Sprites sharing joint canvases. -* Fixed Issue #101 (Mouse Button 0 is not recognised, thanks rezoner) * Added Sprite.destroy back in again and made it a lot more robust at cleaning up child objects. * Added 'return this' to all the core Loader functions so you can chain load calls if you so wish. -* Group.alpha is now exposed publically and changes the Group container object (not the children directly, who can still have their own alpha values) -* Device.webGL uses new inspection code to accurately catch more webGL capable devices. -* Fixed an issue where creating an animation with just one frame with an index of zero would cause a UUID error (thanks SYNYST3R1) -* Fixed Rectangle.union (thanks andron77) -* Debug.renderSpriteBody updated to use a the new Sprite.Body.screenX/Y properties. * Added Text.destroy() and BitmapText.destroy(), also updated Group.remove to make it more bullet-proof when an element doesn't have any events. * Added Phaser.Utils.shuffle to shuffle an array. * Added Graphics.destroy, x, y and updated angle functions. -* Additional checks added to AnimationManager.frame/frameName on the given values. * Added AnimationManager.refreshFrame - will reset the texture being used for a Sprite (useful after a crop rect clear) -* You can now null a Sprite.crop and it will clear down the crop rect area correctly. -* The default Game.antialias value is now 'true', so graphics will be smoothed automatically in canvas. Disable it via the Game constructor or Canvas utils. * Added Physics.overlap(sprite1, sprite2) for quick body vs. body overlap tests with no separation performed. -* Fixed Issue 111 - calling Kill on a Phaser.Graphics instance causes error on undefined events. +* On a busy page it's possible for the game to boot with an incorrect stage offset x/y which can cause input events to be calculated wrong. A new property has been added to Stage to combat this issue: Stage.checkOffsetInterval. By default it will check the canvas offset every 2500ms and adjust it accordingly. You can set the value to 'false' to disable the check entirely, or set a higher or lower value. We recommend that you get the value quite low during your games preloader, but once the game has fully loaded hopefully the containing page will have settled down, so it's probably safe to disable the check entirely. +* Added Rectangle.floorAll to floor all values in a Rectangle (x, y, width and height). + +What's changed: + +* Renamed Phaser.Text.text to Phaser.Text.content to avoid conflict and overwrite from Pixi local var. +* Renamed Phaser.Text.style to Phaser.Text.font to avoid conflict and overwrite from Pixi local var. +* Phaser.Button now sets useHandCursor to true by default. +* Change: When you start a new State all active tweens are now purged. +* When the game boots it will now by default disable user-select and touch action events on the game canvas. +* Moved LinkedList.dump to Debug.dumpLinkedList(list) +* Phaser.Animation.Frame is now Phaser.Frame +* Phaser.Animation.FrameData is now Phaser.FrameData +* Phaser.Animation.Parser is now Phaser.AnimationParser (also the file has renamed from Parser.js to AnimationParser.js) +* Phaser.Loader.Parser is now Phaser.LoaderParser (also the file has renamed from Parser.js to LoaderParser.js) +* Change: We've removed the scrollFactor property from all Game Objects. Sorry, but the new Camera system doesn't work with it and it caused all kinds of issues anyway. We will sort out a replacement for it at a later date. +* Change: World now extends Phaser.Group. As a result we've updated GameObjectFactory and other classes that linked to it. If you have anywhere in your code that used to reference world.group you can just remove 'group' from that. So before, world.group.add() is now just world.add(). +* Change: The Camera has been completely revamped. Rather than adjusting the position of all display objects (bad) it now just shifts the position of the single world container (good!), this is much quicker and also stops the game objects positions from self-adjusting all the time, allowing for them to be properly nested with other containers. +* Made Sprite.body optional and added in checks, so you can safely null the Sprite body object if using your own physics system and not impact rendering. +* Moved the Camera update checks to World.postUpdate, so all the sprites get the correct adjusted camera position. +* The default Game.antialias value is now 'true', so graphics will be smoothed automatically in canvas. Disable it via the Game constructor or Canvas utils. * Phaser.Group now automatically calls updateTransform on any child added to it (avoids temp. frame glitches when new objects are rendered on their first frame). + +What has been updated: + +* Complete overhaul of Physics.Arcade.Body - now significantly more stable and faster too. +* Updated ArcadePhysics.separateX/Y to use new body system - much better results now. +* Added World.postUpdate - all sprite position changes, as a result of physics, happen here before the render. +* Added Animation.paused - can be set to true/false. +* Added support for Body.maxVelocity (thanks cocoademon) +* InputHandler now creates the _pointerData array on creation and populates with one empty set of values, so pointerOver etc all work before a start call. +* Removed the callbackContext parameter from Group.callAll because it's no longer needed. +* Updated Group.forEach, forEachAlive and forEachDead so you can now pass as many parameters as you want, which will all be given to the callback after the child. +* Updated build script so it can be run from the command-line and includes UMD wrappers (thanks iaincarsberg) +* World.randomX/Y now returns values anywhere in the world.bounds range (if set, otherwise 0), including negative values. +* Updated InputHandler to use Math.round rather than Math.floor when snapping an object during drag. +* If you didn't provide the useNumericIndex parameter then AnimationManager.add will set the value by looking at the datatype of the first element in the frames array. +* Group.create now sets the visible and alive properties of the Sprite to the same value as the 'exists' parameter. +* World.randomX/Y now works with negative World.bounds values. +* Tweens .to will now always return the parent (thanks powerfear) +* You can now pass a PIXI.Texture to Sprite (you also need to pass a Phaser.Frame as the frame parameter) but this is useful for Sprites sharing joint canvases. +* Group.alpha is now exposed publically and changes the Group container object (not the children directly, who can still have their own alpha values) +* Device.webGL uses new inspection code to accurately catch more webGL capable devices. +* Debug.renderSpriteBody updated to use a the new Sprite.Body.screenX/Y properties. +* Additional checks added to AnimationManager.frame/frameName on the given values. +* You can now null a Sprite.crop and it will clear down the crop rect area correctly. * Phaser.Time physicsElapsed delta timer clamp added. Stops rogue iOS / slow mobile timer errors causing crazy high deltas. * Animation.generateFrameNames can now work in reverse, so the start/stop values can create frames that increment or decrement respectively. * Loader updated to use xhr.responseText when loading json, csv or text files. xhr.response is still used for Web Audio binary files (thanks bubba) * Input.onDown and onUp events now dispatch the original event that triggered them (i.e. a MouseEvent or TouchEvent) as the 2nd parameter, after the Pointer (thanks rezoner) -* Game.destroy will now stop the raf from running as well as close down all input related event listeners (issue 92, thanks astrism) -* Fixed issue 105 where a dragged object that was destroyed would cause an Input error (thanks onedayitwillmake) * Updated Sprite.crop significantly. Values are now cached, stopping constant Texture frame updates and you can do sprite.crop.width++ for example (thanks haden) * Change: Sprite.crop needs to be enabled with sprite.cropEnabled = true. -* Added Rectangle.floorAll to floor all values in a Rectangle (x, y, width and height). -* Fixed Sound.resume so it now correctly resumes playback from the point it was paused (fixes issue 51, thanks Yora). * Sprite.loadTexture now works correctly with static images, RenderTextures and Animations. * Lots of fixes within Sprite.bounds. The bounds is now correct regardless of rotation, anchor or scale of the Sprite or any of its parent objects. -* On a busy page it's possible for the game to boot with an incorrect stage offset x/y which can cause input events to be calculated wrong. A new property has been added to Stage to combat this issue: Stage.checkOffsetInterval. By default it will check the canvas offset every 2500ms and adjust it accordingly. You can set the value to 'false' to disable the check entirely, or set a higher or lower value. We recommend that you get the value quite low during your games preloader, but once the game has fully loaded hopefully the containing page will have settled down, so it's probably safe to disable the check entirely. + +What has been fixed: + +* QuadTree bug found in 1.0.5 now fixed. The QuadTree is updated properly now using localTransform values. +* Fixed the Bounce.In and Bounce.InOut tweens (thanks XekeDeath) +* Fixed an issue in Animation.update where if the game was paused it would get an insane delta timer throwing a uuid error. +* Added PixiPatch.js to patch in a few essential features until Pixi is updated. +* Fixed issue in Animation.play where the given frameRate and loop values wouldn't overwrite those set on construction. +* Fixed small bug stopping Tween.pause / resume from resuming correctly when called directly. +* Fixed an issue where Tweens.removeAll wasn't clearing tweens in the addition queue. +* Fixed Particle Emitters when using Emitter width/height (thanks XekeDeath) +* Made animation looping more robust when skipping frames (thanks XekeDeath) +* Fix for incorrect new particle positioning (issue #73) (thanks cottonflop) +* Fixed issue in Sound.play where if you gave a missing marker it would play the whole sound sprite instead. +* Button.setFrames will set the current frame based on the button state immediately. +* Loaded.setPreloadSprite now rounds the width/height values and starts from 1. This fixes canvas draw errors in IE9/10 and Firefox. +* Fixed issue causing Keyboard.justPressed to always fire (thanks stemkoski) +* Fixed bug in LinkedList#remove that could cause first to point to a dead node (thanks onedayitwillmake) +* Fixed Cache.addDefaultImage so the default image works in Canvas as well as WebGL. Updated to a new image (32x32 black square with green outline) +* Fixed a bug in the Sprite transform cache check that caused the skew/scale cache to get constantly invalidated - now only updates as needed, significant performance increase! +* Fixed typo in StageScaleMode so it's not pageAlignVeritcally any longer, but pageAlignVertically. +* Fixed issue in Group.countLiving / countDead where the value was off by one (thanks mjablonski) +* Fixed issue with a jittery Camera if you moved a Sprite via velocity instead of x/y placement. +* Fixed the RandomDataGenerator.sow method so if you give in the same seed you'll now get the same results (thanks Hsaka) +* Fixed Issue #101 (Mouse Button 0 is not recognised, thanks rezoner) +* Fixed an issue where creating an animation with just one frame with an index of zero would cause a UUID error (thanks SYNYST3R1) +* Fixed Rectangle.union (thanks andron77) +* Fixed Sound.resume so it now correctly resumes playback from the point it was paused (fixes issue 51, thanks Yora). +* Fixed issue 105 where a dragged object that was destroyed would cause an Input error (thanks onedayitwillmake) +* Fixed Issue 111 - calling Kill on a Phaser.Graphics instance causes error on undefined events. +* Game.destroy will now stop the raf from running as well as close down all input related event listeners (issue 92, thanks astrism) * Pixel Perfect click detection now works even if the Sprite is part of a texture atlas. +![Tanks](http://www.photonstorm.com/wp-content/uploads/2013/10/phaser_tanks-640x480.png) + Outstanding Tasks ----------------- +* TODY: Loader conflict if 2 keys are the same even if they are in different packages (i.e. you can't use "title" for both and image and sound file). * TODO: d-pad example (http://www.html5gamedevs.com/topic/1574-gameinputondown-question/) * TODO: more touch input examples (http://www.html5gamedevs.com/topic/1556-mobile-touch-event/) * TODO: Sound.addMarker hh:mm:ss:ms @@ -165,6 +176,11 @@ Outstanding Tasks * TODO: rotation offset * TODO: Look at HiDPI Canvas settings +How to Build +------------ + +A Grunt script has been provided that will build Phaser from source as well as the examples. Run `grunt` in the phaser folder for a list of command-line options. + Requirements ------------ @@ -172,7 +188,7 @@ Games created with Phaser require a modern web browser that supports the canvas For developing with Phaser you can use either a plain-vanilla JavaScript approach or [TypeScript](https://typescript.codeplex.com/) using the provided TypeScript definitions file. We made no assumptions about how you like to code your games, and were careful not to impose any form of class/inheritance/structure upon you. -Phaser is 275 KB minified and 62 KB gzipped. +Phaser is 281 KB minified and 66 KB gzipped. Features -------- @@ -242,7 +258,7 @@ We use Phaser every day on our many client projects. As a result it's constantly Although Phaser 1.0 is a brand new release it is born from years of experience building some of the biggest HTML5 games out there. We're not saying it is 100% bug free, but we use it for our client work every day, so issues get resolved fast and we stay on-top of the changing browser landscape. -![Phaser Particles](http://www.photonstorm.com/wp-content/uploads/2013/04/phaser_particles.png) +![FruitParty](http://www.photonstorm.com/wp-content/uploads/2013/10/phaser_fruit_particles-640x480.png) Road Map -------- diff --git a/docs/Animation.js.html b/docs/Animation.js.html index b57a3c32..eb175def 100644 --- a/docs/Animation.js.html +++ b/docs/Animation.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -924,7 +864,7 @@ Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zer Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/AnimationManager.js.html b/docs/AnimationManager.js.html index 3e94389f..f7d9a825 100644 --- a/docs/AnimationManager.js.html +++ b/docs/AnimationManager.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -866,7 +806,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/AnimationParser.js.html b/docs/AnimationParser.js.html index d0f3c520..d52e7908 100644 --- a/docs/AnimationParser.js.html +++ b/docs/AnimationParser.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -780,7 +720,7 @@ Phaser.AnimationParser = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/ArcadePhysics.js.html b/docs/ArcadePhysics.js.html index 4c8b318e..ded02953 100644 --- a/docs/ArcadePhysics.js.html +++ b/docs/ArcadePhysics.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -462,45 +402,142 @@ Phaser.Physics = {}; */ Phaser.Physics.Arcade = function (game) { + /** + * @property {Phaser.Game} game - Local reference to game. + */ this.game = game; + /** + * @property {Phaser.Point} gravity - The World gravity setting. Defaults to x: 0, y: 0, or no gravity. + */ this.gravity = new Phaser.Point; + + /** + * @property {Phaser.Rectangle} bounds - The bounds inside of which the physics world exists. Defaults to match the world bounds. + */ this.bounds = new Phaser.Rectangle(0, 0, game.world.width, game.world.height); /** - * Used by the QuadTree to set the maximum number of objects - * @type {number} + * @property {number} maxObjects - Used by the QuadTree to set the maximum number of objects per quad. */ this.maxObjects = 10; /** - * Used by the QuadTree to set the maximum number of levels - * @type {number} + * @property {number} maxLevels - Used by the QuadTree to set the maximum number of iteration levels. */ this.maxLevels = 4; + /** + * @property {number} OVERLAP_BIAS - A value added to the delta values during collision checks. + */ this.OVERLAP_BIAS = 4; - this.TILE_OVERLAP = false; + /** + * @property {Phaser.QuadTree} quadTree - The world QuadTree. + */ this.quadTree = new Phaser.QuadTree(this, this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels); + + /** + * @property {number} quadTreeID - The QuadTree ID. + */ this.quadTreeID = 0; // Avoid gc spikes by caching these values for re-use + + /** + * @property {Phaser.Rectangle} _bounds1 - Internal cache var. + * @private + */ this._bounds1 = new Phaser.Rectangle; + + /** + * @property {Phaser.Rectangle} _bounds2 - Internal cache var. + * @private + */ this._bounds2 = new Phaser.Rectangle; + + /** + * @property {number} _overlap - Internal cache var. + * @private + */ this._overlap = 0; + + /** + * @property {number} _maxOverlap - Internal cache var. + * @private + */ this._maxOverlap = 0; + + /** + * @property {number} _velocity1 - Internal cache var. + * @private + */ this._velocity1 = 0; + + /** + * @property {number} _velocity2 - Internal cache var. + * @private + */ this._velocity2 = 0; + + /** + * @property {number} _newVelocity1 - Internal cache var. + * @private + */ this._newVelocity1 = 0; + + /** + * @property {number} _newVelocity2 - Internal cache var. + * @private + */ this._newVelocity2 = 0; + + /** + * @property {number} _average - Internal cache var. + * @private + */ this._average = 0; + + /** + * @property {Array} _mapData - Internal cache var. + * @private + */ this._mapData = []; + + /** + * @property {number} _mapTiles - Internal cache var. + * @private + */ this._mapTiles = 0; + + /** + * @property {boolean} _result - Internal cache var. + * @private + */ this._result = false; + + /** + * @property {number} _total - Internal cache var. + * @private + */ this._total = 0; + + /** + * @property {number} _angle - Internal cache var. + * @private + */ this._angle = 0; + + /** + * @property {number} _dx - Internal cache var. + * @private + */ this._dx = 0; + + /** + * @property {number} _dy - Internal cache var. + * @private + */ this._dy = 0; }; @@ -1735,7 +1772,7 @@ Phaser.Physics.Arcade.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/BitmapText.js.html b/docs/BitmapText.js.html index 7c793fa8..66f82bd1 100644 --- a/docs/BitmapText.js.html +++ b/docs/BitmapText.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -688,7 +628,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'y', { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Body.js.html b/docs/Body.js.html index 00d0cb23..39daa201 100644 --- a/docs/Body.js.html +++ b/docs/Body.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -441,87 +381,321 @@
    -
    Phaser.Physics.Arcade.Body = function (sprite) {
    +            
    /**
    +* @author       Richard Davey <rich@photonstorm.com>
    +* @copyright    2013 Photon Storm Ltd.
    +* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    +*/
     
    +/**
    +* The Physics Body is linked to a single Sprite. All physics operations should be performed against the body rather than
    +* the Sprite itself. For example you can set the velocity, acceleration, bounce values etc all on the Body.
    +*
    +* @class Phaser.Physics.Arcade.Body
    +* @classdesc Arcade Physics Body Constructor
    +* @constructor
    +* @param {Phaser.Sprite} sprite - The Sprite object this physics body belongs to.
    +*/
    +Phaser.Physics.Arcade.Body = function (sprite) {
    +
    +    /**
    +    * @property {Phaser.Sprite} sprite - Reference to the parent Sprite.
    +    */
     	this.sprite = sprite;
    +
    +    /**
    +    * @property {Phaser.Game} game - Local reference to game.
    +    */
     	this.game = sprite.game;
     
    +    /**
    +    * @property {Phaser.Point} offset - The offset of the Physics Body from the Sprite x/y position.
    +    */
     	this.offset = new Phaser.Point;
     
    +    /**
    +    * @property {number} x - The x position of the physics body.
    +    * @readonly
    +    */
     	this.x = sprite.x;
    +
    +    /**
    +    * @property {number} y - The y position of the physics body.
    +    * @readonly
    +    */
     	this.y = sprite.y;
    +
    +    /**
    +    * @property {number} preX - The previous x position of the physics body.
    +    * @readonly
    +    */
     	this.preX = sprite.x;
    +
    +    /**
    +    * @property {number} preY - The previous y position of the physics body.
    +    * @readonly
    +    */
     	this.preY = sprite.y;
    +
    +    /**
    +    * @property {number} preRotation - The previous rotation of the physics body.
    +    * @readonly
    +    */
     	this.preRotation = sprite.angle;
    +
    +    /**
    +    * @property {number} screenX - The x position of the physics body translated to screen space.
    +    * @readonly
    +    */
     	this.screenX = sprite.x;
    +
    +    /**
    +    * @property {number} screenY - The y position of the physics body translated to screen space.
    +    * @readonly
    +    */
     	this.screenY = sprite.y;
     
    -	//	un-scaled original size
    +    /**
    +    * @property {number} sourceWidth - The un-scaled original size.
    +    * @readonly
    +    */
     	this.sourceWidth = sprite.currentFrame.sourceSizeW;
    +
    +    /**
    +    * @property {number} sourceHeight - The un-scaled original size.
    +    * @readonly
    +    */
     	this.sourceHeight = sprite.currentFrame.sourceSizeH;
     
    -	//	calculated (scaled) size
    +    /**
    +    * @property {number} width - The calculated width of the physics body.
    +    */
     	this.width = sprite.currentFrame.sourceSizeW;
    +
    +    /**
    +    * @property .numInternal ID cache
    +    */
     	this.height = sprite.currentFrame.sourceSizeH;
    +
    +    /**
    +    * @property {number} halfWidth - The calculated width / 2 of the physics body.
    +    */
     	this.halfWidth = Math.floor(sprite.currentFrame.sourceSizeW / 2);
    +
    +    /**
    +    * @property {number} halfHeight - The calculated height / 2 of the physics body.
    +    */
     	this.halfHeight = Math.floor(sprite.currentFrame.sourceSizeH / 2);
     
    -	//	Scale value cache
    +    /**
    +    * @property {number} _sx - Internal cache var.
    +    * @private
    +    */
     	this._sx = sprite.scale.x;
    +
    +    /**
    +    * @property {number} _sy - Internal cache var.
    +    * @private
    +    */
     	this._sy = sprite.scale.y;
     
    +    /**
    +    * @property {Phaser.Point} velocity - The velocity in pixels per second sq. of the Body.
    +    */
         this.velocity = new Phaser.Point;
    +
    +    /**
    +    * @property {Phaser.Point} acceleration - The velocity in pixels per second sq. of the Body.
    +    */
         this.acceleration = new Phaser.Point;
    +
    +    /**
    +    * @property {Phaser.Point} drag - The drag applied to the motion of the Body.
    +    */
         this.drag = new Phaser.Point;
    +
    +    /**
    +    * @property {Phaser.Point} gravity - A private Gravity setting for the Body.
    +    */
         this.gravity = new Phaser.Point;
    +
    +    /**
    +    * @property {Phaser.Point} bounce - The elasticitiy of the Body when colliding. bounce.x/y = 1 means full rebound, bounce.x/y = 0.5 means 50% rebound velocity.
    +    */
         this.bounce = new Phaser.Point;
    +
    +    /**
    +    * @property {Phaser.Point} maxVelocity - The maximum velocity in pixels per second sq. that the Body can reach.
    +    * @default
    +    */
         this.maxVelocity = new Phaser.Point(10000, 10000);
     
    +    /**
    +    * @property {number} angularVelocity - The angular velocity in pixels per second sq. of the Body.
    +    * @default
    +    */
         this.angularVelocity = 0;
    +
    +    /**
    +    * @property {number} angularAcceleration - The angular acceleration in pixels per second sq. of the Body.
    +    * @default
    +    */
         this.angularAcceleration = 0;
    +
    +    /**
    +    * @property {number} angularDrag - The angular drag applied to the rotation of the Body.
    +    * @default
    +    */
         this.angularDrag = 0;
    +
    +    /**
    +    * @property {number} maxAngular - The maximum angular velocity in pixels per second sq. that the Body can reach.
    +    * @default
    +    */
         this.maxAngular = 1000;
    +
    +    /**
    +    * @property {number} mass - The mass of the Body.
    +    * @default
    +    */
         this.mass = 1;
     
    +    /**
    +    * @property {boolean} skipQuadTree - If the Body is an irregular shape you can set this to true to avoid it being added to the World quad tree.
    +    * @default
    +    */
         this.skipQuadTree = false;
    +
    +    /**
    +    * @property {Array} quadTreeIDs - Internal ID cache.
    +    * @protected
    +    */
         this.quadTreeIDs = [];
    +
    +    /**
    +    * @property {number} quadTreeIndex - Internal ID cache.
    +    * @protected
    +    */
         this.quadTreeIndex = -1;
     
         //	Allow collision
    +
    +    /**
    +    * Set the allowCollision properties to control which directions collision is processed for this Body.
    +    * For example allowCollision.up = false means it won't collide when the collision happened while moving up.
    +    * @property {object} allowCollision - An object containing allowed collision.
    +    */
         this.allowCollision = { none: false, any: true, up: true, down: true, left: true, right: true };
    +
    +    /**
    +    * This object is populated with boolean values when the Body collides with another.
    +    * touching.up = true means the collision happened to the top of this Body for example.
    +    * @property {object} touching - An object containing touching results.
    +    */
         this.touching = { none: true, up: false, down: false, left: false, right: false };
    +
    +    /**
    +    * This object is populated with previous touching values from the bodies previous collision.
    +    * @property {object} wasTouching - An object containing previous touching results.
    +    */
         this.wasTouching = { none: true, up: false, down: false, left: false, right: false };
    +
    +    /**
    +    * @property {number} facing - A const reference to the direction the Body is traveling or facing.
    +    * @default
    +    */
         this.facing = Phaser.NONE;
     
    +    /**
    +    * @property {boolean} immovable - An immovable Body will not receive any impacts from other bodies.
    +    * @default
    +    */
         this.immovable = false;
    +
    +    /**
    +    * @property {boolean} moves - Set to true to allow the Physics system to move this Body, other false to move it manually.
    +    * @default
    +    */
         this.moves = true;
    +
    +    /**
    +    * @property {number} rotation - The amount the Body is rotated.
    +    * @default
    +    */
         this.rotation = 0;
    +
    +    /**
    +    * @property {boolean} allowRotation - Allow this Body to be rotated? (via angularVelocity, etc)
    +    * @default
    +    */
         this.allowRotation = true;
    +
    +    /**
    +    * @property {boolean} allowGravity - Allow this Body to be influenced by the global Gravity?
    +    * @default
    +    */
         this.allowGravity = true;
     
    -    //	These two flags allow you to disable the custom separation that takes place
    -    //	Used in combination with your own collision processHandler you can create whatever
    -    //	type of collision response you need.
    +    /**
    +    * This flag allows you to disable the custom x separation that takes place by Physics.Arcade.separate.
    +    * Used in combination with your own collision processHandler you can create whatever type of collision response you need.
    +    * @property {boolean} customSeparateX - Use a custom separation system or the built-in one?
    +    * @default
    +    */
         this.customSeparateX = false;
    +
    +    /**
    +    * This flag allows you to disable the custom y separation that takes place by Physics.Arcade.separate.
    +    * Used in combination with your own collision processHandler you can create whatever type of collision response you need.
    +    * @property {boolean} customSeparateY - Use a custom separation system or the built-in one?
    +    * @default
    +    */
         this.customSeparateY = false;
     
    -    //	When this body collides with another the amount of overlap is stored in here
    -    //	These values are useful if you want to provide your own custom separation logic.
    +    /**
    +    * When this body collides with another, the amount of overlap is stored here.
    +    * @property {number} overlapX - The amount of horizontal overlap during the collision.
    +    */
         this.overlapX = 0;
    +
    +    /**
    +    * When this body collides with another, the amount of overlap is stored here.
    +    * @property {number} overlapY - The amount of vertical overlap during the collision.
    +    */
         this.overlapY = 0;
     
    +    /**
    +    * @property {Phaser.Rectangle} hullX - The dynamically calculated hull used during collision.
    +    */
         this.hullX = new Phaser.Rectangle();
    +
    +    /**
    +    * @property {Phaser.Rectangle} hullY - The dynamically calculated hull used during collision.
    +    */
         this.hullY = new Phaser.Rectangle();
     
    -    //	If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true
    +    /**
    +    * If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true.
    +    * @property {boolean} embedded - Body embed value.
    +    */
         this.embedded = false;
     
    +    /**
    +    * A Body can be set to collide against the World bounds automatically and rebound back into the World if this is set to true. Otherwise it will leave the World.
    +    * @property {boolean} collideWorldBounds - Should the Body collide with the World bounds?
    +    */
         this.collideWorldBounds = false;
     
     };
     
     Phaser.Physics.Arcade.Body.prototype = {
     
    +    /**
    +    * Internal method.
    +    *
    +    * @method Phaser.Physics.Arcade#updateBounds
    +    * @protected
    +    */
     	updateBounds: function (centerX, centerY, scaleX, scaleY) {
     
     		if (scaleX != this._sx || scaleY != this._sy)
    @@ -536,6 +710,12 @@ Phaser.Physics.Arcade.Body.prototype = {
     
     	},
     
    +    /**
    +    * Internal method.
    +    *
    +    * @method Phaser.Physics.Arcade#preUpdate
    +    * @protected
    +    */
     	preUpdate: function () {
     
     		//	Store and reset collision flags
    @@ -574,8 +754,7 @@ Phaser.Physics.Arcade.Body.prototype = {
     				this.checkWorldBounds();
     			}
     
    -			this.updateHulls();
    -		}
    +			this.updateHulls();Array		}
     
     		if (this.skipQuadTree == false && this.allowCollision.none == false && this.sprite.visible && this.sprite.alive)
     		{
    @@ -586,6 +765,12 @@ Phaser.Physics.Arcade.Body.prototype = {
     
     	},
     
    +    /**
    +    * Internal method.
    +    *
    +    * @method Phaser.Physics.Arcade#postUpdate
    +    * @protected
    +    */
     	postUpdate: function () {
     
     		//	Calculate forward-facing edge
    @@ -626,6 +811,12 @@ Phaser.Physics.Arcade.Body.prototype = {
     
     	},
     
    +    /**
    +    * Internal method.
    +    *
    +    * @method Phaser.Physics.Arcade#updateHulls
    +    * @protected
    +    */
     	updateHulls: function () {
     
     		this.hullX.setTo(this.x, this.preY, this.width, this.height);
    @@ -633,6 +824,12 @@ Phaser.Physics.Arcade.Body.prototype = {
     
     	},
     
    +    /**
    +    * Internal method.
    +    *
    +    * @method Phaser.Physics.Arcade#checkWorldBounds
    +    * @protected
    +    */
     	checkWorldBounds: function () {
     
     		if (this.x < this.game.world.bounds.x)
    @@ -659,6 +856,17 @@ Phaser.Physics.Arcade.Body.prototype = {
     
     	},
     
    +    /**
    +    * You can modify the size of the physics Body to be any dimension you need.
    +    * So it could be smaller or larger than the parent Sprite. You can also control the x and y offset, which
    +    * is the position of the Body relative to the top-left of the Sprite.
    +    *
    +    * @method Phaser.Physics.Arcade#setSize
    +    * @param {number} width - The width of the Body.
    +    * @param {number} height - The height of the Body.
    +    * @param {number} offsetX - The X offset of the Body from the Sprite position.
    +    * @param {number} offsetY - The Y offset of the Body from the Sprite position.
    +    */
     	setSize: function (width, height, offsetX, offsetY) {
     
     		offsetX = offsetX || this.offset.x;
    @@ -674,6 +882,11 @@ Phaser.Physics.Arcade.Body.prototype = {
     
     	},
     
    +    /**
    +    * Resets all Body values (velocity, acceleration, rotation, etc)
    +    *
    +    * @method Phaser.Physics.Arcade#reset
    +    */
     	reset: function () {
     
     		this.velocity.setTo(0, 0);
    @@ -691,18 +904,42 @@ Phaser.Physics.Arcade.Body.prototype = {
     
     	},
     
    +    /**
    +    * Returns the absolute delta x value.
    +    *
    +    * @method Phaser.Physics.Arcade.Body#deltaAbsX
    +    * @return {number} The absolute delta value.
    +    */
         deltaAbsX: function () {
             return (this.deltaX() > 0 ? this.deltaX() : -this.deltaX());
         },
     
    +    /**
    +    * Returns the absolute delta y value.
    +    *
    +    * @method Phaser.Physics.Arcade.Body#deltaAbsY
    +    * @return {number} The absolute delta value.
    +    */
         deltaAbsY: function () {
             return (this.deltaY() > 0 ? this.deltaY() : -this.deltaY());
         },
     
    +    /**
    +    * Returns the delta x value.
    +    *
    +    * @method Phaser.Physics.Arcade.Body#deltaX
    +    * @return {number} The delta value.
    +    */
         deltaX: function () {
             return this.x - this.preX;
         },
     
    +    /**
    +    * Returns the delta y value.
    +    *
    +    * @method Phaser.Physics.Arcade.Body#deltaY
    +    * @return {number} The delta value.
    +    */
         deltaY: function () {
             return this.y - this.preY;
         },
    @@ -713,6 +950,10 @@ Phaser.Physics.Arcade.Body.prototype = {
     
     };
     
    +/**
    +* @name Phaser.Physics.Arcade.Body#bottom
    +* @property {number} bottom - The bottom value of this Body (same as Body.y + Body.height)
    +*/
     Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", {
         
         /**
    @@ -744,6 +985,10 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", {
     
     });
     
    +/**
    +* @name Phaser.Physics.Arcade.Body#right
    +* @property {number} right - The right value of this Body (same as Body.x + Body.width)
    +*/
     Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", {
         
         /**
    @@ -797,7 +1042,7 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", {
     					
     		
     		Documentation generated by JSDoc 3.3.0-dev
    -		on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template.
    +		on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template.
     		
     				
     			
    diff --git a/docs/Bullet.js.html b/docs/Bullet.js.html
    index 7d551922..fcae3569 100644
    --- a/docs/Bullet.js.html
    +++ b/docs/Bullet.js.html
    @@ -226,6 +226,10 @@
     							Arcade
     						
     						
    +						
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1085,7 +1025,7 @@ Object.defineProperty(Phaser.Bullet.prototype, "inCamera", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Button.js.html b/docs/Button.js.html index 5e9d198d..bb6b3066 100644 --- a/docs/Button.js.html +++ b/docs/Button.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -782,7 +722,7 @@ Phaser.Button.prototype.onInputUpHandler = function (pointer) { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Cache.js.html b/docs/Cache.js.html index a8ea6989..8c915f0a 100644 --- a/docs/Cache.js.html +++ b/docs/Cache.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1259,7 +1199,7 @@ Phaser.Cache.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Camera.js.html b/docs/Camera.js.html index dde93b3f..91a6d8e5 100644 --- a/docs/Camera.js.html +++ b/docs/Camera.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -869,7 +809,7 @@ Object.defineProperty(Phaser.Camera.prototype, "height", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Canvas.js.html b/docs/Canvas.js.html index 0296461c..7960c51c 100644 --- a/docs/Canvas.js.html +++ b/docs/Canvas.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -718,7 +658,7 @@ Phaser.Canvas = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Circle.js.html b/docs/Circle.js.html index 9546d9a2..fbc48b91 100644 --- a/docs/Circle.js.html +++ b/docs/Circle.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -932,7 +872,7 @@ Phaser.Circle.intersectsRectangle = function (c, r) { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Color.js.html b/docs/Color.js.html index a8b99a3e..21dad46a 100644 --- a/docs/Color.js.html +++ b/docs/Color.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -789,7 +729,7 @@ Phaser.Color = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Debug.js.html b/docs/Debug.js.html index 8e5b2487..e6047948 100644 --- a/docs/Debug.js.html +++ b/docs/Debug.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1334,7 +1274,7 @@ Phaser.Utils.Debug.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Device.js.html b/docs/Device.js.html index 39e54b21..a7986ed3 100644 --- a/docs/Device.js.html +++ b/docs/Device.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1005,7 +945,7 @@ Phaser.Device.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Easing.js.html b/docs/Easing.js.html index bcd7d229..8f1aae89 100644 --- a/docs/Easing.js.html +++ b/docs/Easing.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1023,7 +963,7 @@ Phaser.Easing = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Emitter.js.html b/docs/Emitter.js.html index 79a282b7..cc9911c7 100644 --- a/docs/Emitter.js.html +++ b/docs/Emitter.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1137,7 +1077,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Events.js.html b/docs/Events.js.html index f6d0fa93..68bb6f91 100644 --- a/docs/Events.js.html +++ b/docs/Events.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -529,7 +469,7 @@ Phaser.Events.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Frame.js.html b/docs/Frame.js.html index ed867b7d..7187b4ae 100644 --- a/docs/Frame.js.html +++ b/docs/Frame.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -622,7 +562,7 @@ Phaser.Frame.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/FrameData.js.html b/docs/FrameData.js.html index 6a66f2c0..7bbe8801 100644 --- a/docs/FrameData.js.html +++ b/docs/FrameData.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -699,7 +639,7 @@ Object.defineProperty(Phaser.FrameData.prototype, "total", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Game.js.html b/docs/Game.js.html index 630772fa..49709934 100644 --- a/docs/Game.js.html +++ b/docs/Game.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -949,7 +889,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/GameObjectFactory.js.html b/docs/GameObjectFactory.js.html index fbd5c909..f427f1f9 100644 --- a/docs/GameObjectFactory.js.html +++ b/docs/GameObjectFactory.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -448,7 +388,7 @@ */ /** -* Description. +* The Game Object Factory is a quick way to create all of the different sorts of core objects that Phaser uses. * * @class Phaser.GameObjectFactory * @constructor @@ -471,20 +411,8 @@ Phaser.GameObjectFactory = function (game) { Phaser.GameObjectFactory.prototype = { /** - * @property {Phaser.Game} game - A reference to the currently running Game. - * @default - */ - game: null, - - /** - * @property {Phaser.World} world - A reference to the game world. - * @default - */ - world: null, - - /** - * Description. - * @method existing. + * Adds an existing object to the game world. + * @method Phaser.GameObjectFactory#existing * @param {*} object - An instance of Phaser.Sprite, Phaser.Button or any other display object.. * @return {*} The child that was added to the Group. */ @@ -497,7 +425,7 @@ Phaser.GameObjectFactory.prototype = { /** * Create a new Sprite with specific position and sprite sheet key. * - * @method sprite + * @method Phaser.GameObjectFactory#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. @@ -513,7 +441,7 @@ Phaser.GameObjectFactory.prototype = { /** * Create a new Sprite with specific position and sprite sheet key that will automatically be added as a child of the given parent. * - * @method child + * @method Phaser.GameObjectFactory#child * @param {Phaser.Group} group - The Group to add this child to. * @param {number} x - X position of the new sprite. * @param {number} y - Y position of the new sprite. @@ -530,7 +458,7 @@ Phaser.GameObjectFactory.prototype = { /** * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. * - * @method tween + * @method Phaser.GameObjectFactory#tween * @param {object} obj - Object the tween will be run on. * @return {Phaser.Tween} Description. */ @@ -543,7 +471,7 @@ Phaser.GameObjectFactory.prototype = { /** * A Group is a container for display objects that allows for fast pooling, recycling and collision checks. * - * @method group + * @method Phaser.GameObjectFactory#group * @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any. * @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging. * @return {Phaser.Group} The newly created group. @@ -557,7 +485,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new instance of the Sound class. * - * @method audio + * @method Phaser.GameObjectFactory#audio * @param {string} key - The Game.cache key of the sound that this object will use. * @param {number} volume - The volume at which the sound will be played. * @param {boolean} loop - Whether or not the sound will loop. @@ -572,7 +500,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new <code>TileSprite</code>. * - * @method tileSprite + * @method Phaser.GameObjectFactory#tileSprite * @param {number} x - X position of the new tileSprite. * @param {number} y - Y position of the new tileSprite. * @param {number} width - the width of the tilesprite. @@ -590,7 +518,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new <code>Text</code>. * - * @method text + * @method Phaser.GameObjectFactory#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. @@ -606,7 +534,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new <code>Button</code> object. * - * @method button + * @method Phaser.GameObjectFactory#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. @@ -626,7 +554,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new <code>Graphics</code> object. * - * @method graphics + * @method Phaser.GameObjectFactory#graphics * @param {number} x - X position of the new graphics object. * @param {number} y - Y position of the new graphics object. * @return {Phaser.Graphics} The newly created graphics object. @@ -642,7 +570,7 @@ Phaser.GameObjectFactory.prototype = { * continuous effects like rain and fire. All it really does is launch Particle objects out * at set intervals, and fixes their positions and velocities accorindgly. * - * @method emitter + * @method Phaser.GameObjectFactory#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. @@ -657,7 +585,7 @@ Phaser.GameObjectFactory.prototype = { /** * * Create a new <code>BitmapText</code>. * - * @method bitmapText + * @method Phaser.GameObjectFactory#bitmapText * @param {number} x - X position of the new bitmapText object. * @param {number} y - Y position of the new bitmapText object. * @param {string} text - The actual text that will be written. @@ -671,9 +599,9 @@ Phaser.GameObjectFactory.prototype = { }, /** - * Description. + * Creates a new Tilemap object. * - * @method tilemap + * @method Phaser.GameObjectFactory#tilemap * @param {string} key - Asset key for the JSON file. * @return {Phaser.Tilemap} The newly created tilemap object. */ @@ -684,9 +612,9 @@ Phaser.GameObjectFactory.prototype = { }, /** - * Description. + * Creates a new Tileset object. * - * @method tileset + * @method Phaser.GameObjectFactory#tileset * @param {string} key - The image key as defined in the Game.Cache to use as the tileset. * @return {Phaser.Tileset} The newly created tileset object. */ @@ -697,15 +625,15 @@ Phaser.GameObjectFactory.prototype = { }, /** - * Description. - * - * @method tilemaplayer - * @param {number} x - X position of the new tilemapLayer. - * @param {number} y - Y position of the new tilemapLayer. - * @param {number} width - the width of the tilemapLayer. - * @param {number} height - the height of the tilemapLayer. - * @return {Phaser.TilemapLayer} The newly created tilemaplayer object. - */ + * Creates a new Tilemap Layer object. + * + * @method Phaser.GameObjectFactory#tilemapLayer + * @param {number} x - X position of the new tilemapLayer. + * @param {number} y - Y position of the new tilemapLayer. + * @param {number} width - the width of the tilemapLayer. + * @param {number} height - the height of the tilemapLayer. + * @return {Phaser.TilemapLayer} The newly created tilemaplayer object. + */ tilemapLayer: function (x, y, width, height, tileset, tilemap, layer) { return this.world.add(new Phaser.TilemapLayer(this.game, x, y, width, height, tileset, tilemap, layer)); @@ -713,9 +641,9 @@ Phaser.GameObjectFactory.prototype = { }, /** - * A dynamic initially blank canvas to which images can be drawn + * A dynamic initially blank canvas to which images can be drawn. * - * @method renderTexture + * @method Phaser.GameObjectFactory#renderTexture * @param {string} key - Asset key for the render texture. * @param {number} width - the width of the render texture. * @param {number} height - the height of the render texture. @@ -729,7 +657,7 @@ Phaser.GameObjectFactory.prototype = { return texture; - }, + } };
    @@ -752,7 +680,7 @@ Phaser.GameObjectFactory.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Graphics.js.html b/docs/Graphics.js.html index 332169a9..b8fc6189 100644 --- a/docs/Graphics.js.html +++ b/docs/Graphics.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -549,7 +489,7 @@ Object.defineProperty(Phaser.Graphics.prototype, 'y', { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Group.js.html b/docs/Group.js.html index 69a9974b..5c5bacc1 100644 --- a/docs/Group.js.html +++ b/docs/Group.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1716,7 +1656,7 @@ Object.defineProperty(Phaser.Group.prototype, "alpha", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Input.js.html b/docs/Input.js.html index 99543057..767ceaf5 100644 --- a/docs/Input.js.html +++ b/docs/Input.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1274,7 +1214,7 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/InputHandler.js.html b/docs/InputHandler.js.html index a7767a3b..c6af8455 100644 --- a/docs/InputHandler.js.html +++ b/docs/InputHandler.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1511,7 +1451,7 @@ Phaser.InputHandler.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Intro.js.html b/docs/IntroDocs.js.html similarity index 87% rename from docs/Intro.js.html rename to docs/IntroDocs.js.html index 82819e1a..51e51dca 100644 --- a/docs/Intro.js.html +++ b/docs/IntroDocs.js.html @@ -3,7 +3,7 @@ - Phaser Source: Intro.js + Phaser Source: IntroDocs.js + + + + + + + + +
    + + +
    + + +
    + +
    + + + +

    Class: Body

    +
    + +
    +

    + Phaser.Physics.Arcade. + + Body +

    + +

    Arcade Physics Body Constructor

    + +
    + +
    +
    + + + + +
    +

    new Body(sprite)

    + + +
    +
    + + +
    +

    The Physics Body is linked to a single Sprite. All physics operations should be performed against the body rather than +the Sprite itself. For example you can set the velocity, acceleration, bounce values etc all on the Body.

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

    The Sprite object this physics body belongs to.

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

    Members

    + +
    + +
    +

    acceleration

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    acceleration + + +Phaser.Point + + + +

    The velocity in pixels per second sq. of the Body.

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

    allowCollision

    + + +
    +
    + +
    +

    Set the allowCollision properties to control which directions collision is processed for this Body. +For example allowCollision.up = false means it won't collide when the collision happened while moving up.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    allowCollision + + +object + + + +

    An object containing allowed collision.

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

    allowGravity

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    allowGravity + + +boolean + + + +

    Allow this Body to be influenced by the global Gravity?

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

    allowRotation

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    allowRotation + + +boolean + + + +

    Allow this Body to be rotated? (via angularVelocity, etc)

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

    angularAcceleration

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    angularAcceleration + + +number + + + +

    The angular acceleration in pixels per second sq. of the Body.

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

    angularDrag

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    angularDrag + + +number + + + +

    The angular drag applied to the rotation of the Body.

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

    angularVelocity

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

    The angular velocity in pixels per second sq. of the Body.

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

    bottom

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

    The bottom value of this Body (same as Body.y + Body.height)

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

    bounce

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bounce + + +Phaser.Point + + + +

    The elasticitiy of the Body when colliding. bounce.x/y = 1 means full rebound, bounce.x/y = 0.5 means 50% rebound velocity.

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

    collideWorldBounds

    + + +
    +
    + +
    +

    A Body can be set to collide against the World bounds automatically and rebound back into the World if this is set to true. Otherwise it will leave the World.

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

    Should the Body collide with the World bounds?

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

    customSeparateX

    + + +
    +
    + +
    +

    This flag allows you to disable the custom x separation that takes place by Physics.Arcade.separate. +Used in combination with your own collision processHandler you can create whatever type of collision response you need.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    customSeparateX + + +boolean + + + +

    Use a custom separation system or the built-in one?

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

    customSeparateY

    + + +
    +
    + +
    +

    This flag allows you to disable the custom y separation that takes place by Physics.Arcade.separate. +Used in combination with your own collision processHandler you can create whatever type of collision response you need.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    customSeparateY + + +boolean + + + +

    Use a custom separation system or the built-in one?

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

    drag

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    drag + + +Phaser.Point + + + +

    The drag applied to the motion of the Body.

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

    embedded

    + + +
    +
    + +
    +

    If a body is overlapping with another body, but neither of them are moving (maybe they spawned on-top of each other?) this is set to true.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    embedded + + +boolean + + + +

    Body embed value.

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

    facing

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    facing + + +number + + + +

    A const reference to the direction the Body is traveling or facing.

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

    game

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

    Local reference to game.

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

    gravity

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

    A private Gravity setting for the Body.

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

    halfHeight

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

    The calculated height / 2 of the physics body.

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

    halfWidth

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

    The calculated width / 2 of the physics body.

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

    height

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    .numInternal + +

    ID cache

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

    hullX

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    hullX + + +Phaser.Rectangle + + + +

    The dynamically calculated hull used during collision.

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

    hullY

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    hullY + + +Phaser.Rectangle + + + +

    The dynamically calculated hull used during collision.

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

    immovable

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    immovable + + +boolean + + + +

    An immovable Body will not receive any impacts from other bodies.

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

    mass

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

    The mass of the Body.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 1
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    maxAngular

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    maxAngular + + +number + + + +

    The maximum angular velocity in pixels per second sq. that the Body can reach.

    +
    + + + + + + + + + + + + + + + + + + +
    Default Value:
    +
    • 1000
    + + + +
    Source:
    +
    + + + + + + + +
    + + + +
    + + + +
    +

    maxVelocity

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    maxVelocity + + +Phaser.Point + + + +

    The maximum velocity in pixels per second sq. that the Body can reach.

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

    moves

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    moves + + +boolean + + + +

    Set to true to allow the Physics system to move this Body, other false to move it manually.

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

    offset

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

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

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

    overlapX

    + + +
    +
    + +
    +

    When this body collides with another, the amount of overlap is stored here.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    overlapX + + +number + + + +

    The amount of horizontal overlap during the collision.

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

    overlapY

    + + +
    +
    + +
    +

    When this body collides with another, the amount of overlap is stored here.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    overlapY + + +number + + + +

    The amount of vertical overlap during the collision.

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

    <readonly> preRotation

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    preRotation + + +number + + + +

    The previous rotation of the physics body.

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

    <readonly> preX

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    preX + + +number + + + +

    The previous x position of the physics body.

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

    <readonly> preY

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    preY + + +number + + + +

    The previous y position of the physics body.

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

    <protected> quadTreeIDs

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    quadTreeIDs + + +Array + + + +

    Internal ID cache.

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

    <protected> quadTreeIndex

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    quadTreeIndex + + +number + + + +

    Internal ID cache.

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

    The right value of this Body (same as Body.x + Body.width)

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

    rotation

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

    The amount the Body is rotated.

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

    <readonly> screenX

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    screenX + + +number + + + +

    The x position of the physics body translated to screen space.

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

    <readonly> screenY

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    screenY + + +number + + + +

    The y position of the physics body translated to screen space.

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

    skipQuadTree

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    skipQuadTree + + +boolean + + + +

    If the Body is an irregular shape you can set this to true to avoid it being added to the World quad tree.

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

    <readonly> sourceHeight

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    sourceHeight + + +number + + + +

    The un-scaled original size.

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

    <readonly> sourceWidth

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    sourceWidth + + +number + + + +

    The un-scaled original size.

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

    sprite

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

    Reference to the parent Sprite.

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

    touching

    + + +
    +
    + +
    +

    This object is populated with boolean values when the Body collides with another. +touching.up = true means the collision happened to the top of this Body for example.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    touching + + +object + + + +

    An object containing touching results.

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

    velocity

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    velocity + + +Phaser.Point + + + +

    The velocity in pixels per second sq. of the Body.

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

    wasTouching

    + + +
    +
    + +
    +

    This object is populated with previous touching values from the bodies previous collision.

    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    wasTouching + + +object + + + +

    An object containing previous touching results.

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

    width

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

    The calculated width of the physics body.

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

    <readonly> x

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

    The x position of the physics body.

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

    <readonly> y

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

    The y position of the physics body.

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

    Methods

    + +
    + +
    +

    deltaAbsX() → {number}

    + + +
    +
    + + +
    +

    Returns the absolute delta x value.

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

    The absolute delta value.

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

    deltaAbsY() → {number}

    + + +
    +
    + + +
    +

    Returns the absolute delta y value.

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

    The absolute delta value.

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

    deltaX() → {number}

    + + +
    +
    + + +
    +

    Returns the delta x value.

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

    The delta value.

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

    deltaY() → {number}

    + + +
    +
    + + +
    +

    Returns the delta y value.

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

    The delta value.

    +
    + + + +
    +
    + Type +
    +
    + +number + + +
    +
    + + + + + +
    + +
    + + + + + +
    + +
    + + + + +
    + +
    +
    + + + + Phaser Copyright © 2012-2013 Photon Storm Ltd. + +
    + + + Documentation generated by JSDoc 3.3.0-dev + on Fri Oct 25 2013 17:05:29 GMT+0100 (BST) using the DocStrap template. + +
    +
    + + +
    +
    +
    + +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/Phaser.Physics.Arcade.html b/docs/Phaser.Physics.Arcade.html index 63aeeb4c..4ef62ed9 100644 --- a/docs/Phaser.Physics.Arcade.html +++ b/docs/Phaser.Physics.Arcade.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -583,6 +523,13 @@ +

    Classes

    + +
    +
    Body
    +
    +
    + @@ -592,33 +539,71 @@
    -

    maxLevels :number

    +

    bounds

    -
    -

    Used by the QuadTree to set the maximum number of levels

    -
    - -
    Type:
    -
      -
    • - -number - - -
    • -
    -
    +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    bounds + + +Phaser.Rectangle + + + +

    The bounds inside of which the physics world exists. Defaults to match the world bounds.

    +
    + + + @@ -638,7 +623,7 @@
    Source:
    @@ -656,33 +641,71 @@
    -

    maxObjects :number

    +

    game

    -
    -

    Used by the QuadTree to set the maximum number of objects

    -
    - -
    Type:
    -
      -
    • - -number - - -
    • -
    -
    +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    game + + +Phaser.Game + + + +

    Local reference to game.

    +
    + + + @@ -702,7 +725,619 @@
    Source:
    + + + + + + + +
    + + + +
    + + + +
    +

    gravity

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

    The World gravity setting. Defaults to x: 0, y: 0, or no gravity.

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

    maxLevels

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    maxLevels + + +number + + + +

    Used by the QuadTree to set the maximum number of iteration levels.

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

    maxObjects

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    maxObjects + + +number + + + +

    Used by the QuadTree to set the maximum number of objects per quad.

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

    OVERLAP_BIAS

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    OVERLAP_BIAS + + +number + + + +

    A value added to the delta values during collision checks.

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

    quadTree

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    quadTree + + +Phaser.QuadTree + + + +

    The world QuadTree.

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

    quadTreeID

    + + +
    +
    + + + + + +
    + + +
    Properties:
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescription
    quadTreeID + + +number + + + +

    The QuadTree ID.

    +
    + + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -987,7 +1622,7 @@ Note: The display object doesn't stop moving once it reaches the destination coo
    Source:
    @@ -1301,7 +1936,7 @@ Note: The display object doesn't stop moving once it reaches the destination coo
    Source:
    @@ -1648,7 +2283,7 @@ Note: The display object doesn't stop moving once it reaches the destination coo
    Source:
    @@ -1885,7 +2520,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi
    Source:
    @@ -2051,7 +2686,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi
    Source:
    @@ -2235,7 +2870,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi
    Source:
    @@ -2422,7 +3057,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi
    Source:
    @@ -2468,6 +3103,75 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi +
    + + + +
    +

    <protected> checkWorldBounds()

    + + +
    +
    + + +
    +

    Internal method.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + +
    @@ -2749,7 +3453,7 @@ The objects are also automatically separated.

    Source:
    @@ -2871,7 +3575,7 @@ The objects are also automatically separated.

    -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -3005,7 +3709,7 @@ The objects are also automatically separated.

    Source:
    @@ -3169,7 +3873,7 @@ The objects are also automatically separated.

    Source:
    @@ -3355,7 +4059,7 @@ If you need to calculate from the center of a display object instead use the met
    Source:
    @@ -3544,7 +4248,7 @@ If you need to calculate from the center of a display object instead use the met
    Source:
    @@ -3819,7 +4523,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    @@ -4095,7 +4799,7 @@ Note: The display object doesn't stop moving once it reaches the destination coo
    Source:
    @@ -4405,7 +5109,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    @@ -4569,7 +5273,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    @@ -4661,7 +5365,76 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    <protected> postUpdate()

    + + +
    +
    + + +
    +

    Internal method.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -4730,7 +5503,145 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    + + + + + + + +
    + + + + + + + + + + + + + +
    + + + +
    +

    <protected> preUpdate()

    + + +
    +
    + + +
    +

    Internal method.

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

    reset()

    + + +
    +
    + + +
    +

    Resets all Body values (velocity, acceleration, rotation, etc)

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    @@ -4806,7 +5717,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -4829,7 +5740,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -4871,7 +5782,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    @@ -4970,335 +5881,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set -Phaser.Physics.Arcade.Body - - - - - - - - - -

    The Body object to separate.

    - - - - - - - tile - - - - - -Phaser.Tile - - - - - - - - - -

    The tile to collide against.

    - - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if the bodies were separated, otherwise false.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - -
    - - - -
    -

    separateTileX(body1, tile) → {boolean}

    - - -
    -
    - - -
    -

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

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

    The Body object to separate.

    tile - - -Phaser.Tile - - - -

    The tile to collide against.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    Returns true if the bodies were separated, otherwise false.

    -
    - - - -
    -
    - Type -
    -
    - -boolean - - -
    -
    - - - - - -
    - - - -
    -

    separateTileY(body1, tile) → {boolean}

    - - -
    -
    - - -
    -

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

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    body1 - - -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -5384,6 +5967,334 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set +
    Returns:
    + + +
    +

    Returns true if the bodies were separated, otherwise false.

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

    separateTileX(body1, tile) → {boolean}

    + + +
    +
    + + +
    +

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

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

    The Body object to separate.

    tile + + +Phaser.Tile + + + +

    The tile to collide against.

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

    Returns true if the bodies were separated, otherwise false.

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

    separateTileY(body1, tile) → {boolean}

    + + +
    +
    + + +
    +

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

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

    The Body object to separate.

    tile + + +Phaser.Tile + + + +

    The tile to collide against.

    + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + +
    Returns:
    @@ -5462,7 +6373,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -5485,7 +6396,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -5527,7 +6438,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    @@ -5626,7 +6537,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -5649,7 +6560,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -5691,7 +6602,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    @@ -5737,6 +6648,333 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set + + + + +
    +

    setSize(width, height, offsetX, offsetY)

    + + +
    +
    + + +
    +

    You can modify the size of the physics Body to be any dimension you need. +So it could be smaller or larger than the parent Sprite. You can also control the x and y offset, which +is the position of the Body relative to the top-left of the Sprite.

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

    The width of the Body.

    height + + +number + + + +

    The height of the Body.

    offsetX + + +number + + + +

    The X offset of the Body from the Sprite position.

    offsetY + + +number + + + +

    The Y offset of the Body from the Sprite position.

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

    <protected> updateBounds()

    + + +
    +
    + + +
    +

    Internal method.

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

    <protected> updateHulls()

    + + +
    +
    + + +
    +

    Internal method.

    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + +
    Source:
    +
    + + + + + + + +
    + + + + + + + + + + + + +
    @@ -5790,7 +7028,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -5832,7 +7070,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
    Source:
    @@ -6046,7 +7284,7 @@ One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which wil
    Source:
    @@ -6285,7 +7523,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi
    Source:
    @@ -6361,7 +7599,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:29 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Physics.html b/docs/Phaser.Physics.html index 339633ee..a339c8db 100644 --- a/docs/Phaser.Physics.html +++ b/docs/Phaser.Physics.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -565,7 +505,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:47 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:29 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Plugin.html b/docs/Phaser.Plugin.html index f5257f37..835ea5ef 100644 --- a/docs/Phaser.Plugin.html +++ b/docs/Phaser.Plugin.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1827,7 +1767,7 @@ It is only called if active is set to true.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:29 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.PluginManager.html b/docs/Phaser.PluginManager.html index a4886e8d..4528a022 100644 --- a/docs/Phaser.PluginManager.html +++ b/docs/Phaser.PluginManager.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1457,7 +1397,7 @@ It only calls plugins who have active=true.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:29 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Point.html b/docs/Phaser.Point.html index 4ef47585..ddee290a 100644 --- a/docs/Phaser.Point.html +++ b/docs/Phaser.Point.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -5017,7 +4957,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:29 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Pointer.html b/docs/Phaser.Pointer.html index 15d132e6..ee5c62c9 100644 --- a/docs/Phaser.Pointer.html +++ b/docs/Phaser.Pointer.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -4860,7 +4800,7 @@ Default size of 44px (Apple's recommended "finger tip" size).

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.QuadTree.html b/docs/Phaser.QuadTree.html index 9947a438..b00f2216 100644 --- a/docs/Phaser.QuadTree.html +++ b/docs/Phaser.QuadTree.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1326,7 +1266,7 @@ Split the node into 4 subnodes

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.RandomDataGenerator.html b/docs/Phaser.RandomDataGenerator.html index c893b200..486e2b58 100644 --- a/docs/Phaser.RandomDataGenerator.html +++ b/docs/Phaser.RandomDataGenerator.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -2019,7 +1959,7 @@ Random number generator from Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Rectangle.html b/docs/Phaser.Rectangle.html index f7c069a4..e91b1134 100644 --- a/docs/Phaser.Rectangle.html +++ b/docs/Phaser.Rectangle.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -7404,7 +7344,7 @@ This method checks the x, y, width, and height properties of the Rectangles.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.RenderTexture.html b/docs/Phaser.RenderTexture.html index 4d406da5..62ab2199 100644 --- a/docs/Phaser.RenderTexture.html +++ b/docs/Phaser.RenderTexture.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1405,7 +1345,7 @@ once they update pixi to fix the typo, we'll fix it here too :)

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.RequestAnimationFrame.html b/docs/Phaser.RequestAnimationFrame.html index f2ef9d0d..29f60417 100644 --- a/docs/Phaser.RequestAnimationFrame.html +++ b/docs/Phaser.RequestAnimationFrame.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1329,7 +1269,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Signal.html b/docs/Phaser.Signal.html index f3235e32..c2a4313e 100644 --- a/docs/Phaser.Signal.html +++ b/docs/Phaser.Signal.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -2314,7 +2254,7 @@ already dispatched before.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Sound.html b/docs/Phaser.Sound.html index a9813371..c22be39b 100644 --- a/docs/Phaser.Sound.html +++ b/docs/Phaser.Sound.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -5747,7 +5687,7 @@ This allows you to bundle multiple sounds together into a single audio file and Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:48 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.SoundManager.html b/docs/Phaser.SoundManager.html index dedced84..7c994610 100644 --- a/docs/Phaser.SoundManager.html +++ b/docs/Phaser.SoundManager.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -2446,7 +2386,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Sprite.html b/docs/Phaser.Sprite.html index 2c251b46..a1212293 100644 --- a/docs/Phaser.Sprite.html +++ b/docs/Phaser.Sprite.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1275,7 +1215,7 @@ A culled sprite has its renderable property set to 'false'.

    -Phaser.Physics.Arcade.Body +Phaser.Physics.Arcade.Body @@ -7752,7 +7692,7 @@ It will dispatch the onRevived event, you can listen to Sprite.events.onRevived Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:30 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Stage.html b/docs/Phaser.Stage.html index e72d9ee0..87fb6ae4 100644 --- a/docs/Phaser.Stage.html +++ b/docs/Phaser.Stage.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1680,7 +1620,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.StageScaleMode.html b/docs/Phaser.StageScaleMode.html index 12f9e211..45c915d4 100644 --- a/docs/Phaser.StageScaleMode.html +++ b/docs/Phaser.StageScaleMode.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -3840,7 +3780,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 Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.State.html b/docs/Phaser.State.html index 40cf1e4c..37679159 100644 --- a/docs/Phaser.State.html +++ b/docs/Phaser.State.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -2594,7 +2534,7 @@ If you need to use the loader, you may need to use them here.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.StateManager.html b/docs/Phaser.StateManager.html index c85cda32..42ce6ae7 100644 --- a/docs/Phaser.StateManager.html +++ b/docs/Phaser.StateManager.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -3451,7 +3391,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Text.html b/docs/Phaser.Text.html index 0bedbd55..142961c0 100644 --- a/docs/Phaser.Text.html +++ b/docs/Phaser.Text.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1839,7 +1779,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.TileSprite.html b/docs/Phaser.TileSprite.html index 0fff887c..e07b7cae 100644 --- a/docs/Phaser.TileSprite.html +++ b/docs/Phaser.TileSprite.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1172,7 +1112,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Time.html b/docs/Phaser.Time.html index 6c4f3228..38ea3d32 100644 --- a/docs/Phaser.Time.html +++ b/docs/Phaser.Time.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -2915,7 +2855,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Touch.html b/docs/Phaser.Touch.html index dd046bcb..2967411e 100644 --- a/docs/Phaser.Touch.html +++ b/docs/Phaser.Touch.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -2566,7 +2506,7 @@ Doesn't appear to be supported by most browsers on a canvas element yet.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Tween.html b/docs/Phaser.Tween.html index 2bb08d08..0712f3ac 100644 --- a/docs/Phaser.Tween.html +++ b/docs/Phaser.Tween.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -3272,7 +3212,7 @@ Used in combination with repeat you can create endless loops.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.TweenManager.html b/docs/Phaser.TweenManager.html index ee5fce9b..b8ae3f5b 100644 --- a/docs/Phaser.TweenManager.html +++ b/docs/Phaser.TweenManager.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1628,7 +1568,7 @@ Please see https://github.com/sole/tw Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:49 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Utils.Debug.html b/docs/Phaser.Utils.Debug.html index 8ebe3b10..f5156051 100644 --- a/docs/Phaser.Utils.Debug.html +++ b/docs/Phaser.Utils.Debug.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -5981,7 +5921,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 Fri Oct 25 2013 16:16:50 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:32 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.Utils.html b/docs/Phaser.Utils.html index 218c7314..fde44034 100644 --- a/docs/Phaser.Utils.html +++ b/docs/Phaser.Utils.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1140,7 +1080,7 @@ dir = 1 (left), 2 (right), 3 (both)

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:50 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:31 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.World.html b/docs/Phaser.World.html index bfe1e906..685bc77d 100644 --- a/docs/Phaser.World.html +++ b/docs/Phaser.World.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -2115,7 +2055,7 @@ If you need to adjust the bounds of the world

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:50 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:32 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.html b/docs/Phaser.html index e0e7fa60..5b5da4f6 100644 --- a/docs/Phaser.html +++ b/docs/Phaser.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -708,7 +648,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Phaser.js.html b/docs/Phaser.js.html index 62ba15c6..9fc7b1fb 100644 --- a/docs/Phaser.js.html +++ b/docs/Phaser.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -504,7 +444,7 @@ PIXI.InteractionManager = function (dummy) { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Plugin.js.html b/docs/Plugin.js.html index 5fae9c1c..b823ed7f 100644 --- a/docs/Plugin.js.html +++ b/docs/Plugin.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -577,7 +517,7 @@ Phaser.Plugin.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/PluginManager.js.html b/docs/PluginManager.js.html index 3ee07220..e0a609ea 100644 --- a/docs/PluginManager.js.html +++ b/docs/PluginManager.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -694,7 +634,7 @@ Phaser.PluginManager.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Point.js.html b/docs/Point.js.html index e0b13c5b..f1a9a1a0 100644 --- a/docs/Point.js.html +++ b/docs/Point.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -859,7 +799,7 @@ Phaser.Point.rotate = function (a, x, y, angle, asDegrees, distance) { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Pointer.js.html b/docs/Pointer.js.html index 55c1a964..8a8a8b90 100644 --- a/docs/Pointer.js.html +++ b/docs/Pointer.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1151,7 +1091,7 @@ Object.defineProperty(Phaser.Pointer.prototype, "worldY", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/QuadTree.js.html b/docs/QuadTree.js.html index 2bcf4b56..b58109cf 100644 --- a/docs/QuadTree.js.html +++ b/docs/QuadTree.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -726,7 +666,7 @@ Phaser.QuadTree.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/RandomDataGenerator.js.html b/docs/RandomDataGenerator.js.html index 3b234790..aae4f2ff 100644 --- a/docs/RandomDataGenerator.js.html +++ b/docs/RandomDataGenerator.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -708,7 +648,7 @@ Phaser.RandomDataGenerator.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Rectangle.js.html b/docs/Rectangle.js.html index 5a8a1f65..3a2f95a2 100644 --- a/docs/Rectangle.js.html +++ b/docs/Rectangle.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1145,7 +1085,7 @@ Phaser.Rectangle.union = function (a, b, out) { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/RenderTexture.js.html b/docs/RenderTexture.js.html index 3880f0d0..ea651e4f 100644 --- a/docs/RenderTexture.js.html +++ b/docs/RenderTexture.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -531,7 +471,7 @@ Phaser.RenderTexture.prototype.constructor = Phaser.RenderTexture; Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/RequestAnimationFrame.js.html b/docs/RequestAnimationFrame.js.html index 55d15796..5672c631 100644 --- a/docs/RequestAnimationFrame.js.html +++ b/docs/RequestAnimationFrame.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -614,7 +554,7 @@ Phaser.RequestAnimationFrame.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Signal.js.html b/docs/Signal.js.html index e53e8c5a..12d883ad 100644 --- a/docs/Signal.js.html +++ b/docs/Signal.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -759,7 +699,7 @@ Phaser.Signal.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/SignalBinding.html b/docs/SignalBinding.html index 2579d39e..64277efe 100644 --- a/docs/SignalBinding.html +++ b/docs/SignalBinding.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -759,7 +699,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:50 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:32 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/SignalBinding.js.html b/docs/SignalBinding.js.html index 721fddf8..76457202 100644 --- a/docs/SignalBinding.js.html +++ b/docs/SignalBinding.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -624,7 +564,7 @@ Phaser.SignalBinding.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Sound.js.html b/docs/Sound.js.html index 72c02c51..e149bb2c 100644 --- a/docs/Sound.js.html +++ b/docs/Sound.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1289,7 +1229,7 @@ Object.defineProperty(Phaser.Sound.prototype, "volume", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/SoundManager.js.html b/docs/SoundManager.js.html index eaf2cba7..83d398a3 100644 --- a/docs/SoundManager.js.html +++ b/docs/SoundManager.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -911,7 +851,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Sprite.js.html b/docs/Sprite.js.html index c1d87190..3b07c29b 100644 --- a/docs/Sprite.js.html +++ b/docs/Sprite.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1587,7 +1527,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Stage.js.html b/docs/Stage.js.html index 4f2f1fce..f10ebda5 100644 --- a/docs/Stage.js.html +++ b/docs/Stage.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -638,7 +578,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/StageScaleMode.js.html b/docs/StageScaleMode.js.html index 045b5c29..31be6dd7 100644 --- a/docs/StageScaleMode.js.html +++ b/docs/StageScaleMode.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1033,7 +973,7 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/State.js.html b/docs/State.js.html index 1e6468f2..2d04c7dc 100644 --- a/docs/State.js.html +++ b/docs/State.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -631,7 +571,7 @@ Phaser.State.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/StateManager.js.html b/docs/StateManager.js.html index ba023349..2604fa8f 100644 --- a/docs/StateManager.js.html +++ b/docs/StateManager.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -987,7 +927,7 @@ Phaser.StateManager.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Text.js.html b/docs/Text.js.html index 35a2d3f6..5a0d9205 100644 --- a/docs/Text.js.html +++ b/docs/Text.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -683,7 +623,7 @@ Object.defineProperty(Phaser.Text.prototype, 'font', { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/TileSprite.js.html b/docs/TileSprite.js.html index 812d8964..9d88842c 100644 --- a/docs/TileSprite.js.html +++ b/docs/TileSprite.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -519,7 +459,7 @@ Phaser.TileSprite.prototype.constructor = Phaser.TileSprite; Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Time.js.html b/docs/Time.js.html index b616de5d..e43d0193 100644 --- a/docs/Time.js.html +++ b/docs/Time.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -733,7 +673,7 @@ Phaser.Time.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Touch.js.html b/docs/Touch.js.html index be9a5a3c..ff9954b2 100644 --- a/docs/Touch.js.html +++ b/docs/Touch.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -795,7 +735,7 @@ Phaser.Touch.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Tween.js.html b/docs/Tween.js.html index 16c1ae76..a03cbbfd 100644 --- a/docs/Tween.js.html +++ b/docs/Tween.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -1071,7 +1011,7 @@ Phaser.Tween.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/TweenManager.js.html b/docs/TweenManager.js.html index 7936a498..955b7745 100644 --- a/docs/TweenManager.js.html +++ b/docs/TweenManager.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -648,7 +588,7 @@ Phaser.TweenManager.prototype = { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/Utils.js.html b/docs/Utils.js.html index 6bd7466b..8383ee03 100644 --- a/docs/Utils.js.html +++ b/docs/Utils.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -689,7 +629,7 @@ if (typeof Function.prototype.bind != 'function') { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/World.js.html b/docs/World.js.html index 21d2ad92..37669ab3 100644 --- a/docs/World.js.html +++ b/docs/World.js.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -722,7 +662,7 @@ Object.defineProperty(Phaser.World.prototype, "randomY", { Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/build/conf.json b/docs/build/conf.json index 6bd6894c..4bbe4e6c 100644 --- a/docs/build/conf.json +++ b/docs/build/conf.json @@ -5,7 +5,7 @@ "source": { "include": [ "../../src/Phaser.js", - "../../src/Intro.js", + "../../src/IntroDocs.js", "../../src/animation/", "../../src/core/", "../../src/gameobjects/", @@ -15,10 +15,9 @@ "../../src/math/", "../../src/net/", "../../src/particles/", - "../../src/physics/", + "../../src/physics/arcade/", "../../src/sound/", "../../src/system/", - "../../src/tilemap/", "../../src/time/", "../../src/tween/", "../../src/utils/" diff --git a/docs/build/conf_dev.json b/docs/build/conf_dev.json index e5ba68ae..4bbe4e6c 100644 --- a/docs/build/conf_dev.json +++ b/docs/build/conf_dev.json @@ -5,7 +5,7 @@ "source": { "include": [ "../../src/Phaser.js", - "../../src/Intro.js", + "../../src/IntroDocs.js", "../../src/animation/", "../../src/core/", "../../src/gameobjects/", diff --git a/docs/classes.list.html b/docs/classes.list.html index b1682b66..f3bdbab2 100644 --- a/docs/classes.list.html +++ b/docs/classes.list.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -636,6 +576,9 @@
    Arcade
    +
    Body
    +
    +
    Plugin
    @@ -755,7 +698,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/global.html b/docs/global.html index 90667b5e..283e7b46 100644 --- a/docs/global.html +++ b/docs/global.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -505,405 +445,6 @@
    -
    -

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

    - - -
    -
    - - -
    -

    Creates a new instance of the Sound class.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    key - - -string - - - -

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

    volume - - -number - - - -

    The volume at which the sound will be played.

    loop - - -boolean - - - -

    Whether or not the sound will loop.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created text object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Sound - - -
    -
    - - - - - -
    - - - -
    -

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

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

    X position of the new bitmapText object.

    y - - -number - - - -

    Y position of the new bitmapText object.

    text - - -string - - - -

    The actual text that will be written.

    style - - -object - - - -

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

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created bitmapText object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.BitmapText - - -
    -
    - - - - - -
    - - -

    bottom() → {number}

    @@ -946,7 +487,7 @@
    Source:
    @@ -1083,7 +624,7 @@
    Source:
    @@ -1106,1426 +647,6 @@ - - - - -
    -

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

    - - -
    -
    - - -
    -

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

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

    X position of the new button object.

    y - - -number - - - - - - <optional>
    - - - - - -

    Y position of the new button object.

    key - - -string - - - - - - <optional>
    - - - - - -

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

    callback - - -function - - - - - - <optional>
    - - - - - -

    The function to call when this button is pressed

    callbackContext - - -object - - - - - - <optional>
    - - - - - -

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

    overFrame - - -string -| - -number - - - - - - <optional>
    - - - - - -

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

    outFrame - - -string -| - -number - - - - - - <optional>
    - - - - - -

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

    downFrame - - -string -| - -number - - - - - - <optional>
    - - - - - -

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

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created button object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Button - - -
    -
    - - - - - -
    - - - -
    -

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

    - - -
    -
    - - -
    -

    Create a new Sprite with specific position and sprite sheet key that will automatically be added as a child of the given parent.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeArgumentDescription
    group - - -Phaser.Group - - - - - - - - - -

    The Group to add this child to.

    x - - -number - - - - - - - - - -

    X position of the new sprite.

    y - - -number - - - - - - - - - -

    Y position of the new sprite.

    key - - -string -| - -RenderTexture - - - - - - <optional>
    - - - - - -

    The image key as defined in the Game.Cache to use as the texture for this sprite OR a RenderTexture.

    frame - - -string -| - -number - - - - - - <optional>
    - - - - - -

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

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    the newly created sprite object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Sprite - - -
    -
    - - - - - -
    - - - -
    -

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

    - - -
    -
    - - -
    -

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

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

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

    y - - -number - - - - - - <optional>
    - - - - - -
    - - 0 - -

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

    maxParticles - - -number - - - - - - <optional>
    - - - - - -
    - - 50 - -

    The total number of particles in this emitter.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created emitter object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Emitter - - -
    -
    - - - - - -
    - - - -
    -

    existing.(object) → {*}

    - - -
    -
    - - -
    -

    Description.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    object - - -* - - - -

    An instance of Phaser.Sprite, Phaser.Button or any other display object..

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The child that was added to the Group.

    -
    - - - -
    -
    - Type -
    -
    - -* - - -
    -
    - - - - - -
    - - - -
    -

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

    - - -
    -
    - - -
    -

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

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    x - - -number - - - -

    X position of the new graphics object.

    y - - -number - - - -

    Y position of the new graphics object.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created graphics object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Graphics - - -
    -
    - - - - - -
    - - - -
    -

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

    - - -
    -
    - - -
    -

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

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeArgumentDefaultDescription
    parent - - -* - - - - - - - - - - - -

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

    name - - -string - - - - - - <optional>
    - - - - - -
    - - group - -

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

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created group.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Group - - -
    -
    - - - - -
    @@ -2663,193 +784,6 @@ at set intervals, and fixes their positions and velocities accorindgly.

    - - - - -
    -

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

    - - -
    -
    - - -
    -

    A dynamic initially blank canvas to which images can be drawn

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    key - - -string - - - -

    Asset key for the render texture.

    width - - -number - - - -

    the width of the render texture.

    height - - -number - - - -

    the height of the render texture.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created renderTexture object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.RenderTexture - - -
    -
    - - - - -
    @@ -2897,7 +831,7 @@ However it does affect the width property.

    Source:
    @@ -3035,7 +969,7 @@ However it does affect the width property.

    Source:
    @@ -3058,1369 +992,6 @@ However it does affect the width property.

    - - - - -
    -

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

    - - -
    -
    - - -
    -

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

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeArgumentDescription
    x - - -number - - - - - - - - - -

    X position of the new sprite.

    y - - -number - - - - - - - - - -

    Y position of the new sprite.

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

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

    frame - - -string -| - -number - - - - - - <optional>
    - - - - - -

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

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    the newly created sprite object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Sprite - - -
    -
    - - - - - -
    - - - -
    -

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

    - - -
    -
    - - -
    -

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

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    x - - -number - - - -

    X position of the new text object.

    y - - -number - - - -

    Y position of the new text object.

    text - - -string - - - -

    The actual text that will be written.

    style - - -object - - - -

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

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created text object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Text - - -
    -
    - - - - - -
    - - - -
    -

    tilemap(key) → {Phaser.Tilemap}

    - - -
    -
    - - -
    -

    Description.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    key - - -string - - - -

    Asset key for the JSON file.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created tilemap object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Tilemap - - -
    -
    - - - - - -
    - - - -
    -

    tilemaplayer(x, y, width, height) → {Phaser.TilemapLayer}

    - - -
    -
    - - -
    -

    Description.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    x - - -number - - - -

    X position of the new tilemapLayer.

    y - - -number - - - -

    Y position of the new tilemapLayer.

    width - - -number - - - -

    the width of the tilemapLayer.

    height - - -number - - - -

    the height of the tilemapLayer.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created tilemaplayer object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.TilemapLayer - - -
    -
    - - - - - -
    - - - -
    -

    tileset(key) → {Phaser.Tileset}

    - - -
    -
    - - -
    -

    Description.

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    key - - -string - - - -

    The image key as defined in the Game.Cache to use as the tileset.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created tileset object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Tileset - - -
    -
    - - - - - -
    - - - -
    -

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

    - - -
    -
    - - -
    -

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

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    x - - -number - - - -

    X position of the new tileSprite.

    y - - -number - - - -

    Y position of the new tileSprite.

    width - - -number - - - -

    the width of the tilesprite.

    height - - -number - - - -

    the height of the tilesprite.

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

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

    frame - - -string -| - -number - - - -

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

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    The newly created tileSprite object.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.TileSprite - - -
    -
    - - - - - -
    - - - -
    -

    tween(obj) → {Phaser.Tween}

    - - -
    -
    - - -
    -

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

    -
    - - - - - - - -
    Parameters:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescription
    obj - - -object - - - -

    Object the tween will be run on.

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    Source:
    -
    - - - - - - - -
    - - - - - - - - - - - -
    Returns:
    - - -
    -

    Description.

    -
    - - - -
    -
    - Type -
    -
    - -Phaser.Tween - - -
    -
    - - - - -
    @@ -4449,7 +1020,7 @@ However it does affect the width property.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/docs/index.html b/docs/index.html index 513d1335..deb3dd24 100644 --- a/docs/index.html +++ b/docs/index.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -472,7 +412,7 @@

    - D:\wamp\www\phaser\src/Intro.js + D:\wamp\www\phaser\src/IntroDocs.js

    @@ -484,7 +424,7 @@

    Phaser - http://www.phaser.io

    -

    v<%= version %> - Built at: <%= buildDate %>

    +

    v1.1 - Released October 25th 2013.

    By Richard Davey http://www.photonstorm.com @photonstorm

    A feature-packed 2D HTML5 game framework born from the smouldering pits of Flixel and constructed via plenty of blood, sweat, tears and coffee by Richard Davey (@photonstorm).

    @@ -520,7 +460,7 @@ and my love of game development originate.

    Source:
    @@ -573,7 +513,7 @@ and my love of game development originate.

    Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template.
    diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html index 32b68635..9c0a911e 100644 --- a/docs/namespaces.list.html +++ b/docs/namespaces.list.html @@ -226,6 +226,10 @@ Arcade +
  • + Body +
  • +
  • Plugin
  • @@ -344,82 +348,18 @@ @@ -636,6 +576,9 @@
    Arcade
    +
    Body
    +
    +
    Plugin
    @@ -755,7 +698,7 @@ Documentation generated by JSDoc 3.3.0-dev - on Fri Oct 25 2013 16:16:43 GMT+0100 (BST) using the DocStrap template. + on Fri Oct 25 2013 17:05:24 GMT+0100 (BST) using the DocStrap template. diff --git a/src/IntroDocs.js b/src/IntroDocs.js new file mode 100644 index 00000000..27a04815 --- /dev/null +++ b/src/IntroDocs.js @@ -0,0 +1,29 @@ +/** +* @author Richard Davey +* @copyright 2013 Photon Storm Ltd. +* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} +*/ + +/** +* @overview +* +* Phaser - http://www.phaser.io +* +* v1.1 - Released October 25th 2013. +* +* By Richard Davey http://www.photonstorm.com @photonstorm +* +* A feature-packed 2D HTML5 game framework born from the smouldering pits of Flixel and +* constructed via plenty of blood, sweat, tears and coffee by Richard Davey (@photonstorm). +* +* Phaser uses Pixi.js for rendering, created by Mat Groves http://matgroves.com/ @Doormat23. +* +* Follow Phaser development progress at http://www.photonstorm.com +* +* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from both which Phaser +* and my love of game development originate. +* +* "If you want your children to be intelligent, read them fairy tales." +* "If you want them to be more intelligent, read them more fairy tales." +* -- Albert Einstein +*/ diff --git a/src/gameobjects/GameObjectFactory.js b/src/gameobjects/GameObjectFactory.js index ebd37ed5..9f1fd101 100644 --- a/src/gameobjects/GameObjectFactory.js +++ b/src/gameobjects/GameObjectFactory.js @@ -5,7 +5,7 @@ */ /** -* Description. +* The Game Object Factory is a quick way to create all of the different sorts of core objects that Phaser uses. * * @class Phaser.GameObjectFactory * @constructor @@ -28,20 +28,8 @@ Phaser.GameObjectFactory = function (game) { Phaser.GameObjectFactory.prototype = { /** - * @property {Phaser.Game} game - A reference to the currently running Game. - * @default - */ - game: null, - - /** - * @property {Phaser.World} world - A reference to the game world. - * @default - */ - world: null, - - /** - * Description. - * @method existing. + * Adds an existing object to the game world. + * @method Phaser.GameObjectFactory#existing * @param {*} object - An instance of Phaser.Sprite, Phaser.Button or any other display object.. * @return {*} The child that was added to the Group. */ @@ -54,7 +42,7 @@ Phaser.GameObjectFactory.prototype = { /** * Create a new Sprite with specific position and sprite sheet key. * - * @method sprite + * @method Phaser.GameObjectFactory#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. @@ -70,7 +58,7 @@ Phaser.GameObjectFactory.prototype = { /** * Create a new Sprite with specific position and sprite sheet key that will automatically be added as a child of the given parent. * - * @method child + * @method Phaser.GameObjectFactory#child * @param {Phaser.Group} group - The Group to add this child to. * @param {number} x - X position of the new sprite. * @param {number} y - Y position of the new sprite. @@ -87,7 +75,7 @@ Phaser.GameObjectFactory.prototype = { /** * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. * - * @method tween + * @method Phaser.GameObjectFactory#tween * @param {object} obj - Object the tween will be run on. * @return {Phaser.Tween} Description. */ @@ -100,7 +88,7 @@ Phaser.GameObjectFactory.prototype = { /** * A Group is a container for display objects that allows for fast pooling, recycling and collision checks. * - * @method group + * @method Phaser.GameObjectFactory#group * @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any. * @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging. * @return {Phaser.Group} The newly created group. @@ -114,7 +102,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new instance of the Sound class. * - * @method audio + * @method Phaser.GameObjectFactory#audio * @param {string} key - The Game.cache key of the sound that this object will use. * @param {number} volume - The volume at which the sound will be played. * @param {boolean} loop - Whether or not the sound will loop. @@ -129,7 +117,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new TileSprite. * - * @method tileSprite + * @method Phaser.GameObjectFactory#tileSprite * @param {number} x - X position of the new tileSprite. * @param {number} y - Y position of the new tileSprite. * @param {number} width - the width of the tilesprite. @@ -147,7 +135,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new Text. * - * @method text + * @method Phaser.GameObjectFactory#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. @@ -163,7 +151,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new Button object. * - * @method button + * @method Phaser.GameObjectFactory#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. @@ -183,7 +171,7 @@ Phaser.GameObjectFactory.prototype = { /** * Creates a new Graphics object. * - * @method graphics + * @method Phaser.GameObjectFactory#graphics * @param {number} x - X position of the new graphics object. * @param {number} y - Y position of the new graphics object. * @return {Phaser.Graphics} The newly created graphics object. @@ -199,7 +187,7 @@ Phaser.GameObjectFactory.prototype = { * continuous effects like rain and fire. All it really does is launch Particle objects out * at set intervals, and fixes their positions and velocities accorindgly. * - * @method emitter + * @method Phaser.GameObjectFactory#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. @@ -214,7 +202,7 @@ Phaser.GameObjectFactory.prototype = { /** * * Create a new BitmapText. * - * @method bitmapText + * @method Phaser.GameObjectFactory#bitmapText * @param {number} x - X position of the new bitmapText object. * @param {number} y - Y position of the new bitmapText object. * @param {string} text - The actual text that will be written. @@ -228,9 +216,9 @@ Phaser.GameObjectFactory.prototype = { }, /** - * Description. + * Creates a new Tilemap object. * - * @method tilemap + * @method Phaser.GameObjectFactory#tilemap * @param {string} key - Asset key for the JSON file. * @return {Phaser.Tilemap} The newly created tilemap object. */ @@ -241,9 +229,9 @@ Phaser.GameObjectFactory.prototype = { }, /** - * Description. + * Creates a new Tileset object. * - * @method tileset + * @method Phaser.GameObjectFactory#tileset * @param {string} key - The image key as defined in the Game.Cache to use as the tileset. * @return {Phaser.Tileset} The newly created tileset object. */ @@ -254,15 +242,15 @@ Phaser.GameObjectFactory.prototype = { }, /** - * Description. - * - * @method tilemaplayer - * @param {number} x - X position of the new tilemapLayer. - * @param {number} y - Y position of the new tilemapLayer. - * @param {number} width - the width of the tilemapLayer. - * @param {number} height - the height of the tilemapLayer. - * @return {Phaser.TilemapLayer} The newly created tilemaplayer object. - */ + * Creates a new Tilemap Layer object. + * + * @method Phaser.GameObjectFactory#tilemapLayer + * @param {number} x - X position of the new tilemapLayer. + * @param {number} y - Y position of the new tilemapLayer. + * @param {number} width - the width of the tilemapLayer. + * @param {number} height - the height of the tilemapLayer. + * @return {Phaser.TilemapLayer} The newly created tilemaplayer object. + */ tilemapLayer: function (x, y, width, height, tileset, tilemap, layer) { return this.world.add(new Phaser.TilemapLayer(this.game, x, y, width, height, tileset, tilemap, layer)); @@ -270,9 +258,9 @@ Phaser.GameObjectFactory.prototype = { }, /** - * A dynamic initially blank canvas to which images can be drawn + * A dynamic initially blank canvas to which images can be drawn. * - * @method renderTexture + * @method Phaser.GameObjectFactory#renderTexture * @param {string} key - Asset key for the render texture. * @param {number} width - the width of the render texture. * @param {number} height - the height of the render texture. @@ -286,6 +274,6 @@ Phaser.GameObjectFactory.prototype = { return texture; - }, + } }; \ No newline at end of file diff --git a/src/physics/arcade/ArcadePhysics.js b/src/physics/arcade/ArcadePhysics.js index 3aff9dcc..522e12cd 100644 --- a/src/physics/arcade/ArcadePhysics.js +++ b/src/physics/arcade/ArcadePhysics.js @@ -49,8 +49,6 @@ Phaser.Physics.Arcade = function (game) { */ this.OVERLAP_BIAS = 4; - // this.TILE_OVERLAP = false; - /** * @property {Phaser.QuadTree} quadTree - The world QuadTree. */ diff --git a/src/tilemap_old/Tile.js b/src/tilemap_old/Tile.js deleted file mode 100644 index 069f1b46..00000000 --- a/src/tilemap_old/Tile.js +++ /dev/null @@ -1,183 +0,0 @@ -/** -* @author Richard Davey -* @copyright 2013 Photon Storm Ltd. -* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} -* @module Phaser.Tile -*/ - - -/** -* Create a new Tile. -* -* @class Phaser.Tile -* @classdesc A Tile is a single representation of a tile within a Tilemap. -* @constructor -* @param {Phaser.Game} game - A reference to the currently running game. -* @param {Tilemap} tilemap - The tilemap this tile belongs to. -* @param {number} index - The index of this tile type in the core map data. -* @param {number} width - Width of the tile. -* @param {number} height - Height of the tile. -*/ -Phaser.Tile = function (game, tilemap, index, width, height) { - - /** - * @property {number} mass - The virtual mass of the tile. - * @default - */ - this.mass = 1.0; - - /** - * @property {boolean} collideNone - Indicating this Tile doesn't collide at all. - * @default - */ - this.collideNone = true; - - /** - * @property {boolean} collideLeft - Indicating collide with any object on the left. - * @default - */ - this.collideLeft = false; - - /** - * @property {boolean} collideRight - Indicating collide with any object on the right. - * @default - */ - this.collideRight = false; - - /** - * @property {boolean} collideUp - Indicating collide with any object on the top. - * @default - */ - this.collideUp = false; - - /** - * @property {boolean} collideDown - Indicating collide with any object on the bottom. - * @default - */ - this.collideDown = false; - - /** - * @property {boolean} separateX - Enable separation at x-axis. - * @default - */ - this.separateX = true; - - /** - * @property {boolean} separateY - Enable separation at y-axis. - * @default - */ - this.separateY = true; - - /** - * @property {Phaser.Game} game - A reference to the currently running game. - */ - this.game = game; - - /** - * @property {boolean} tilemap - The tilemap this tile belongs to. - */ - this.tilemap = tilemap; - - /** - * @property {number} index - The index of this tile type in the core map data. - */ - this.index = index; - - /** - * @property {number} width - The width of the tile. - */ - this.width = width; - - /** - * @property {number} height - The height of the tile. - */ - this.height = height; - -}; - -Phaser.Tile.prototype = { - - /** - * Clean up memory. - * @method destroy - */ - destroy: function () { - this.tilemap = null; - }, - - /** - * Set collision configs. - * @method setCollision - * @param {boolean} left - Indicating collide with any object on the left. - * @param {boolean} right - Indicating collide with any object on the right. - * @param {boolean} up - Indicating collide with any object on the top. - * @param {boolean} down - Indicating collide with any object on the bottom. - * @param {boolean} reset - Description. - * @param {boolean} separateX - Separate at x-axis. - * @param {boolean} separateY - Separate at y-axis. - */ - setCollision: function (left, right, up, down, reset, separateX, separateY) { - - if (reset) - { - this.resetCollision(); - } - - this.separateX = separateX; - this.separateY = separateY; - - this.collideNone = true; - this.collideLeft = left; - this.collideRight = right; - this.collideUp = up; - this.collideDown = down; - - if (left || right || up || down) - { - this.collideNone = false; - } - - }, - - /** - * Reset collision status flags. - * @method resetCollision - */ - resetCollision: function () { - - this.collideNone = true; - this.collideLeft = false; - this.collideRight = false; - this.collideUp = false; - this.collideDown = false; - - } - -}; - -Object.defineProperty(Phaser.Tile.prototype, "bottom", { - - /** - * The sum of the y and height properties. Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * @method bottom - * @return {number} - **/ - get: function () { - return this.y + this.height; - } - -}); - -Object.defineProperty(Phaser.Tile.prototype, "right", { - - /** - * The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties. - * However it does affect the width property. - * @method right - * @return {number} - **/ - get: function () { - return this.x + this.width; - } - -}); diff --git a/src/tilemap_old/Tilemap.js b/src/tilemap_old/Tilemap.js deleted file mode 100644 index ad19fd81..00000000 --- a/src/tilemap_old/Tilemap.js +++ /dev/null @@ -1,530 +0,0 @@ -/** -* @author Richard Davey -* @copyright 2013 Photon Storm Ltd. -* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License -* @module Phaser.Tilemap -*/ - - -/** -* Create a new Tilemap. -* @class Phaser.Tilemap -* @classdesc This GameObject allows for the display of a tilemap within the game world. Tile maps consist of an image, tile data and a size. -* Internally it creates a TilemapLayer for each layer in the tilemap. -* @constructor -* @param {Phaser.Game} game - Current game instance. -* @param {string} key - Asset key for this map. -* @param {object} x - Description. -* @param {object} y - Description. -* @param {boolean} resizeWorld - Resize the world bound automatically based on this tilemap? -* @param {number} tileWidth - Width of tiles in this map (used for CSV maps). -* @param {number} tileHeight - Height of tiles in this map (used for CSV maps). -*/ -Phaser.Tilemap = function (game, key, x, y, resizeWorld, tileWidth, tileHeight) { - - if (typeof resizeWorld === "undefined") { resizeWorld = true; } - if (typeof tileWidth === "undefined") { tileWidth = 0; } - if (typeof tileHeight === "undefined") { tileHeight = 0; } - - /** - * @property {Phaser.Game} game - A reference to the currently running game. - */ - this.game = game; - - /** - * @property {Description} group - Description. - */ - this.group = null; - - /** - * @property {string} name - The user defined name given to this Description. - * @default - */ - this.name = ''; - - /** - * @property {Description} key - Description. - */ - this.key = key; - - /** - * @property {number} renderOrderID - Render iteration counter - * @default - */ - this.renderOrderID = 0; - - /** - * @property {boolean} collisionCallback - Tilemap collision callback. - * @default - */ - this.collisionCallback = null; - - /** - * @property {boolean} exists - Description. - * @default - */ - this.exists = true; - - /** - * @property {boolean} visible - Description. - * @default - */ - this.visible = true; - - this.width = 0; - this.height = 0; - - /** - * @property {boolean} tiles - Description. - * @default - */ - this.tiles = []; - - /** - * @property {boolean} layers - Description. - * @default - */ - this.layers = []; - - var map = this.game.cache.getTilemap(key); - - PIXI.DisplayObjectContainer.call(this); - - /** - * @property {Description} position - Description. - */ - this.position.x = x; - this.position.y = y; - - /** - * @property {Description} type - Description. - */ - this.type = Phaser.TILEMAP; - - /** - * @property {Description} renderer - Description. - */ - this.renderer = new Phaser.TilemapRenderer(this.game); - - this.fixedToCamera = true; - - /** - * @property {Description} mapFormat - Description. - */ - this.mapFormat = map.format; - - switch (this.mapFormat) - { - case Phaser.Tilemap.CSV: - this.parseCSV(map.mapData, key, tileWidth, tileHeight); - break; - - case Phaser.Tilemap.JSON: - this.parseTiledJSON(map.mapData, key); - break; - } - - if (this.currentLayer && resizeWorld) - { - this.game.world.setBounds(0, 0, this.width, this.heightIn); - } - -}; - -// Needed to keep the PIXI.Sprite constructor in the prototype chain (as the core pixi renderer uses an instanceof check sadly) -Phaser.Tilemap.prototype = Object.create(PIXI.DisplayObjectContainer.prototype); -Phaser.Tilemap.prototype.constructor = Phaser.Tilemap; - -Phaser.Tilemap.CSV = 0; -Phaser.Tilemap.JSON = 1; - -/** -* Parse csv map data and generate tiles. -* -* @method Phaser.Tilemap.prototype.parseCSV -* @param {string} data - CSV map data. -* @param {string} key - Asset key for tileset image. -* @param {number} tileWidth - Width of its tile. -* @param {number} tileHeight - Height of its tile. -*/ -Phaser.Tilemap.prototype.parseCSV = function (data, key, tileWidth, tileHeight) { - - var layer = new Phaser.TilemapLayer(this, 0, key, Phaser.Tilemap.CSV, 'TileLayerCSV' + this.layers.length.toString(), tileWidth, tileHeight); - - // Trim any rogue whitespace from the data - data = data.trim(); - - var rows = data.split("\n"); - - for (var i = 0; i < rows.length; i++) - { - var column = rows[i].split(","); - - if (column.length > 0) - { - layer.addColumn(column); - } - } - - layer.updateBounds(); - layer.createCanvas(); - - var tileQuantity = layer.parseTileOffsets(); - - this.currentLayer = layer; - this.collisionLayer = layer; - this.layers.push(layer); - - this.width = this.currentLayer.widthInPixels; - this.height = this.currentLayer.heightInPixels; - - this.generateTiles(tileQuantity); - -}; - -/** -* Parse JSON map data and generate tiles. -* -* @method Phaser.Tilemap.prototype.parseTiledJSON -* @param {string} data - JSON map data. -* @param {string} key - Asset key for tileset image. -*/ -Phaser.Tilemap.prototype.parseTiledJSON = function (json, key) { - - for (var i = 0; i < json.layers.length; i++) - { - var layer = new Phaser.TilemapLayer(this, i, key, Phaser.Tilemap.JSON, json.layers[i].name, json.tilewidth, json.tileheight); - - // Check it's a data layer - if (!json.layers[i].data) - { - continue; - } - - // layer.createQuadTree(json.tilewidth * json.layers[i].width, json.tileheight * json.layers[i].height); - - layer.alpha = json.layers[i].opacity; - layer.visible = json.layers[i].visible; - layer.tileMargin = json.tilesets[0].margin; - layer.tileSpacing = json.tilesets[0].spacing; - - var c = 0; - var row; - - for (var t = 0; t < json.layers[i].data.length; t++) - { - if (c == 0) - { - row = []; - } - - row.push(json.layers[i].data[t]); - c++; - - if (c == json.layers[i].width) - { - layer.addColumn(row); - c = 0; - } - } - - layer.updateBounds(); - layer.createCanvas(); - - var tileQuantity = layer.parseTileOffsets(); - - this.currentLayer = layer; - this.collisionLayer = layer; - this.layers.push(layer); - - if (this.currentLayer.widthInPixels > this.width) - { - this.width = this.currentLayer.widthInPixels; - } - - if (this.currentLayer.heightInPixels > this.height) - { - this.height = this.currentLayer.heightInPixels; - } - } - - this.generateTiles(tileQuantity); - -}; - -/** -* Create tiles of given quantity. -* @method Phaser.Tilemap.prototype.generateTiles -* @param {number} qty - Quantity of tiles to be generated. -*/ -Phaser.Tilemap.prototype.generateTiles = function (qty) { - - for (var i = 0; i < qty; i++) - { - this.tiles.push(new Phaser.Tile(this.game, this, i, this.currentLayer.tileWidth, this.currentLayer.tileHeight)); - } - -}; - -/** -* Set callback to be called when this tilemap collides. -* -* @method Phaser.Tilemap.prototype.setCollisionCallback -* @param {object} context - Callback will be called with this context. -* @param {Function} callback - Callback function. -*/ -Phaser.Tilemap.prototype.setCollisionCallback = function (context, callback) { - - this.collisionCallbackContext = context; - this.collisionCallback = callback; - -}; - -/** -* Set collision configs of tiles in a range index. -* -* @method Phaser.Tilemap.prototype.setCollisionRange -* @param {number} start - First index of tiles. -* @param {number} end - Last index of tiles. -* @param {number} collision - Bit field of flags. (see Tile.allowCollision) -* @param {boolean} resetCollisions - Reset collision flags before set. -* @param {boolean} separateX - Enable separate at x-axis. -* @param {boolean} separateY - Enable separate at y-axis. -*/ -Phaser.Tilemap.prototype.setCollisionRange = function (start, end, left, right, up, down, resetCollisions, separateX, separateY) { - - if (typeof resetCollisions === "undefined") { resetCollisions = false; } - if (typeof separateX === "undefined") { separateX = true; } - if (typeof separateY === "undefined") { separateY = true; } - - for (var i = start; i < end; i++) - { - this.tiles[i].setCollision(left, right, up, down, resetCollisions, separateX, separateY); - } - -}; - -/** -* Set collision configs of tiles with given index. -* @param {number[]} values - Index array which contains all tile indexes. The tiles with those indexes will be setup with rest parameters. -* @param {number} collision - Bit field of flags (see Tile.allowCollision). -* @param {boolean} resetCollisions - Reset collision flags before set. -* @param {boolean} left - Indicating collide with any object on the left. -* @param {boolean} right - Indicating collide with any object on the right. -* @param {boolean} up - Indicating collide with any object on the top. -* @param {boolean} down - Indicating collide with any object on the bottom. -* @param {boolean} separateX - Enable separate at x-axis. -* @param {boolean} separateY - Enable separate at y-axis. -*/ -Phaser.Tilemap.prototype.setCollisionByIndex = function (values, left, right, up, down, resetCollisions, separateX, separateY) { - - if (typeof resetCollisions === "undefined") { resetCollisions = false; } - if (typeof separateX === "undefined") { separateX = true; } - if (typeof separateY === "undefined") { separateY = true; } - - for (var i = 0; i < values.length; i++) - { - this.tiles[values[i]].setCollision(left, right, up, down, resetCollisions, separateX, separateY); - } - -}; - -// Tile Management - -/** -* Get the tile by its index. -* @param {number} value - Index of the tile you want to get. -* @return {Tile} The tile with given index. -*/ -Phaser.Tilemap.prototype.getTileByIndex = function (value) { - - if (this.tiles[value]) - { - return this.tiles[value]; - } - - return null; - -}; - -/** -* Get the tile located at specific position and layer. -* @param {number} x - X position of this tile located. -* @param {number} y - Y position of this tile located. -* @param {number} [layer] - layer of this tile located. -* @return {Tile} The tile with specific properties. -*/ -Phaser.Tilemap.prototype.getTile = function (x, y, layer) { - - if (typeof layer === "undefined") { layer = this.currentLayer.ID; } - - return this.tiles[this.layers[layer].getTileIndex(x, y)]; - -}; - -/** -* Get the tile located at specific position (in world coordinate) and layer (thus you give a position of a point which is within the tile). -* @param {number} x - X position of the point in target tile. -* @param {number} y - Y position of the point in target tile. -* @param {number} [layer] - layer of this tile located. -* @return {Tile} The tile with specific properties. -*/ -Phaser.Tilemap.prototype.getTileFromWorldXY = function (x, y, layer) { - - if (typeof layer === "undefined") { layer = this.currentLayer.ID; } - - return this.tiles[this.layers[layer].getTileFromWorldXY(x, y)]; - -}; - -/** -* Gets the tile underneath the Input.x/y position. -* @param {number} layer - The layer to check, defaults to 0. -* @return {Tile} -*/ -Phaser.Tilemap.prototype.getTileFromInputXY = function (layer) { - - if (typeof layer === "undefined") { layer = this.currentLayer.ID; } - - return this.tiles[this.layers[layer].getTileFromWorldXY(this.game.input.worldX, this.game.input.worldY)]; - -}; - -/** -* Get tiles overlaps the given object. -* @param {GameObject} object - Tiles you want to get that overlaps this. -* @return {array} Array with tiles information (Each contains x, y and the tile). -*/ -Phaser.Tilemap.prototype.getTileOverlaps = function (object) { - - return this.currentLayer.getTileOverlaps(object); - -}; - -// COLLIDE - -/** -* Check whether this tilemap collides with the given game object or group of objects. -* @param {Function} objectOrGroup - Target object of group you want to check. -* @param {Function} callback - This is called if objectOrGroup collides the tilemap. -* @param {object} context - Callback will be called with this context. -* @return {boolean} Return true if this collides with given object, otherwise return false. -*/ -Phaser.Tilemap.prototype.collide = function (objectOrGroup, callback, context) { - - objectOrGroup = objectOrGroup || this.game.world.group; - callback = callback || null; - context = context || null; - - if (callback && context) - { - this.collisionCallback = callback; - this.collisionCallbackContext = context; - } - - if (objectOrGroup instanceof Phaser.Group) - { - objectOrGroup.forEachAlive(this.collideGameObject, this); - } - else - { - this.collideGameObject(objectOrGroup); - } - -}; - -/** -* Check whether this tilemap collides with the given game object. -* @param {GameObject} object - Target object you want to check. -* @return {boolean} Return true if this collides with given object, otherwise return false. -*/ -Phaser.Tilemap.prototype.collideGameObject = function (object) { - - if (object instanceof Phaser.Group || object instanceof Phaser.Tilemap) - { - return false; - } - - if (object.exists && object.body.allowCollision.none == false) - { - this._tempCollisionData = this.collisionLayer.getTileOverlaps(object); - - if (this.collisionCallback && this._tempCollisionData.length > 0) - { - this.collisionCallback.call(this.collisionCallbackContext, object, this._tempCollisionData); - } - - return true; - } - else - { - return false; - } - -}; - -/** -* Set a tile to a specific layer. -* @param {number} x - X position of this tile. -* @param {number} y - Y position of this tile. -* @param {number} index - The index of this tile type in the core map data. -* @param {number} [layer] - Which layer you want to set the tile to. -*/ -Phaser.Tilemap.prototype.putTile = function (x, y, index, layer) { - - if (typeof layer === "undefined") { layer = this.currentLayer.ID; } - - this.layers[layer].putTile(x, y, index); - -}; - -/** -* Calls the renderer. -*/ -Phaser.Tilemap.prototype.update = function () { - - this.renderer.render(this); - - if (this.fixedToCamera) - { - // this.displayObject.position.x = this.game.camera.view.x + this.x; - // this.displayObject.position.y = this.game.camera.view.y + this.y; - this.position.x = this.game.camera.view.x + 0; - this.position.y = this.game.camera.view.y + 0; - } - -}; - -/** -* Description. -*/ -Phaser.Tilemap.prototype.destroy = function () { - - this.tiles.length = 0; - this.layers.length = 0; - -}; - -/** -* Get width in pixels. -* @return {number} -*/ -Object.defineProperty(Phaser.Tilemap.prototype, "widthInPixels", { - - get: function () { - return this.currentLayer.widthInPixels; - } - -}); - -/** -* Get height in pixels. -* @return {number} -*/ -Object.defineProperty(Phaser.Tilemap.prototype, "heightInPixels", { - - get: function () { - return this.currentLayer.heightInPixels; - } - -}); diff --git a/src/tilemap_old/TilemapLayer.js b/src/tilemap_old/TilemapLayer.js deleted file mode 100644 index 80fd7516..00000000 --- a/src/tilemap_old/TilemapLayer.js +++ /dev/null @@ -1,662 +0,0 @@ -/** -* @author Richard Davey -* @copyright 2013 Photon Storm Ltd. -* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License -* @module Phaser.TilemapLayer -*/ - -/** -* Create a new TilemapLayer. -* @class Phaser.TilemapLayer -* @classdesc A Tilemap Layer. Tiled format maps can have multiple overlapping layers. -* @constructor -* @param parent {Tilemap} The tilemap that contains this layer. -* @param id {number} The ID of this layer within the Tilemap array. -* @param key {string} Asset key for this map. -* @param mapformat {number} Format of this map data, available: Tilemap.CSV or Tilemap.JSON. -* @param name {string} Name of this layer, so you can get this layer by its name. -* @param tileWidth {number} Width of tiles in this map. -* @param tileHeight {number} Height of tiles in this map. -*/ -Phaser.TilemapLayer = function (parent, id, key, mapFormat, name, tileWidth, tileHeight) { - - /** - * @property {boolean} exists - Controls whether update() and draw() are automatically called. - * @default - */ - this.exists = true; - - /** - * @property {boolean} visible - Controls whether draw() are automatically called. - * @default - */ - this.visible = true; - - /** - * How many tiles in each row. - * Read-only variable, do NOT recommend changing after the map is loaded! - * @property {number} widthInTiles - * @default - */ - this.widthInTiles = 0; - - /** - * How many tiles in each column. - * Read-only variable, do NOT recommend changing after the map is loaded! - * @property {number} heightInTiles - * @default - */ - this.heightInTiles = 0; - - /** - * Read-only variable, do NOT recommend changing after the map is loaded! - * @property {number} widthInPixels - * @default - */ - this.widthInPixels = 0; - - /** - * Read-only variable, do NOT recommend changing after the map is loaded! - * @property {number} heightInPixels - * @default - */ - this.heightInPixels = 0; - - /** - * Distance between REAL tiles to the tileset texture bound. - * @property {number} tileMargin - * @default - */ - this.tileMargin = 0; - - /** - * Distance between every 2 neighbor tile in the tileset texture. - * @property {number} tileSpacing - * @default - */ - this.tileSpacing = 0; - - /** - * @property {Description} parent - Description. - */ - this.parent = parent; - - /** - * @property {Phaser.Game} game - Description. - */ - this.game = parent.game; - - /** - * @property {Description} ID - Description. - */ - this.ID = id; - - /** - * @property {Description} name - Description. - */ - this.name = name; - - /** - * @property {Description} key - Description. - */ - this.key = key; - - /** - * @property {Description} type - Description. - */ - this.type = Phaser.TILEMAPLAYER; - - /** - * @property {tileWidth} mapFormat - Description. - */ - this.mapFormat = mapFormat; - - /** - * @property {Description} tileWidth - Description. - */ - this.tileWidth = tileWidth; - - /** - * @property {Description} tileHeight - Description. - */ - this.tileHeight = tileHeight; - - /** - * @property {Phaser.Rectangle} boundsInTiles - Description. - */ - this.boundsInTiles = new Phaser.Rectangle(); - - var map = this.game.cache.getTilemap(key); - - /** - * @property {Description} tileset - Description. - */ - this.tileset = map.data; - - /** - * @property {Description} _alpha - Description. - * @private - * @default - */ - this._alpha = 1; - - /** - * @property {Description} canvas - Description. - * @default - */ - this.canvas = null; - - /** - * @property {Description} context - Description. - * @default - */ - this.context = null; - - /** - * @property {Description} baseTexture - Description. - * @default - */ - this.baseTexture = null; - - /** - * @property {Description} texture - Description. - * @default - */ - this.texture = null; - - /** - * @property {Description} sprite - Description. - * @default - */ - this.sprite = null; - - /** - * @property {array} mapData - Description. - */ - this.mapData = []; - - /** - * @property {array} _tempTileBlock - Description. - * @private - */ - this._tempTileBlock = []; - - /** - * @property {array} _tempBlockResults - Description. - * @private - * - */ - this._tempBlockResults = []; - -}; - -Phaser.TilemapLayer.prototype = { - - /** - * Set a specific tile with its x and y in tiles. - * @method putTileWorldXY - * @param {number} x - X position of this tile in world coordinates. - * @param {number} y - Y position of this tile in world coordinates. - * @param {number} index - The index of this tile type in the core map data. - */ - putTileWorldXY: function (x, y, index) { - - x = this.game.math.snapToFloor(x, this.tileWidth) / this.tileWidth; - y = this.game.math.snapToFloor(y, this.tileHeight) / this.tileHeight; - - if (y >= 0 && y < this.mapData.length) - { - if (x >= 0 && x < this.mapData[y].length) - { - this.mapData[y][x] = index; - } - } - - }, - - /** - * Set a specific tile with its x and y in tiles. - * @method putTile - * @param {number} x - X position of this tile. - * @param {number} y - Y position of this tile. - * @param {number} index - The index of this tile type in the core map data. - */ - putTile: function (x, y, index) { - - if (y >= 0 && y < this.mapData.length) - { - if (x >= 0 && x < this.mapData[y].length) - { - this.mapData[y][x] = index; - } - } - - }, - - /** - * Swap tiles with 2 kinds of indexes. - * @method swapTile - * @param {number} tileA - First tile index. - * @param {number} tileB - Second tile index. - * @param {number} [x] - specify a Rectangle of tiles to operate. The x position in tiles of Rectangle's left-top corner. - * @param {number} [y] - specify a Rectangle of tiles to operate. The y position in tiles of Rectangle's left-top corner. - * @param {number} [width] - specify a Rectangle of tiles to operate. The width in tiles. - * @param {number} [height] - specify a Rectangle of tiles to operate. The height in tiles. - */ - swapTile: function (tileA, tileB, x, y, width, height) { - - x = x || 0; - y = y || 0; - width = width || this.widthInTiles; - height = height || this.heightInTiles; - - this.getTempBlock(x, y, width, height); - - for (var r = 0; r < this._tempTileBlock.length; r++) - { - // First sweep marking tileA as needing a new index - if (this._tempTileBlock[r].tile.index == tileA) - { - this._tempTileBlock[r].newIndex = true; - } - - // In the same pass we can swap tileB to tileA - if (this._tempTileBlock[r].tile.index == tileB) - { - this.mapData[this._tempTileBlock[r].y][this._tempTileBlock[r].x] = tileA; - } - } - - for (var r = 0; r < this._tempTileBlock.length; r++) - { - // And now swap our newIndex tiles for tileB - if (this._tempTileBlock[r].newIndex == true) - { - this.mapData[this._tempTileBlock[r].y][this._tempTileBlock[r].x] = tileB; - } - } - - }, - - /** - * Fill a tile block with a specific tile index. - * @method fillTile - * @param {number} index - Index of tiles you want to fill with. - * @param {number} [x] - X position (in tiles) of block's left-top corner. - * @param {number} [y] - Y position (in tiles) of block's left-top corner. - * @param {number} [width] - width of block. - * @param {number} [height] - height of block. - */ - fillTile: function (index, x, y, width, height) { - - x = x || 0; - y = y || 0; - width = width || this.widthInTiles; - height = height || this.heightInTiles; - - this.getTempBlock(x, y, width, height); - - for (var r = 0; r < this._tempTileBlock.length; r++) - { - this.mapData[this._tempTileBlock[r].y][this._tempTileBlock[r].x] = index; - } - - }, - - /** - * Set random tiles to a specific tile block. - * @method randomiseTiles - * @param {number[]} tiles - Tiles with indexes in this array will be randomly set to the given block. - * @param {number} [x] - X position (in tiles) of block's left-top corner. - * @param {number} [y] - Y position (in tiles) of block's left-top corner. - * @param {number} [width] - width of block. - * @param {number} [height] - height of block. - */ - randomiseTiles: function (tiles, x, y, width, height) { - - x = x || 0; - y = y || 0; - width = width || this.widthInTiles; - height = height || this.heightInTiles; - - this.getTempBlock(x, y, width, height); - - for (var r = 0; r < this._tempTileBlock.length; r++) - { - this.mapData[this._tempTileBlock[r].y][this._tempTileBlock[r].x] = this.game.math.getRandom(tiles); - } - - }, - - /** - * Replace one kind of tiles to another kind. - * @method replaceTile - * @param {number} tileA - First tile index. - * @param {number} tileB - Second tile index. - * @param {number} [x] - X position (in tiles) of block's left-top corner. - * @param {number} [y] - Y position (in tiles) of block's left-top corner. - * @param {number} [width] - width of block. - * @param {number} [height] - height of block. - */ - replaceTile: function (tileA, tileB, x, y, width, height) { - - x = x || 0; - y = y || 0; - width = width || this.widthInTiles; - height = height || this.heightInTiles; - - this.getTempBlock(x, y, width, height); - - for (var r = 0; r < this._tempTileBlock.length; r++) - { - if (this._tempTileBlock[r].tile.index == tileA) - { - this.mapData[this._tempTileBlock[r].y][this._tempTileBlock[r].x] = tileB; - } - } - - }, - - /** - * Get a tile block with specific position and size (both are in tiles). - * @method getTileBlock - * @param {number} [x] - X position (in tiles) of block's left-top corner. - * @param {number} [y] - Y position (in tiles) of block's left-top corner. - * @param {number} [width] - width of block. - * @param {number} [height] - height of block. - */ - getTileBlock: function (x, y, width, height) { - - var output = []; - - this.getTempBlock(x, y, width, height); - - for (var r = 0; r < this._tempTileBlock.length; r++) - { - output.push({ - x: this._tempTileBlock[r].x, - y: this._tempTileBlock[r].y, - tile: this._tempTileBlock[r].tile - }); - } - - return output; - - }, - - /** - * Get a tile with specific position (in world coordinate). (thus you give a position of a point which is within the tile) - * @method getTileFromWorldXY - * @param {number} [x] - X position (in tiles) of block's left-top corner. - * @param {number} [y] - Y position (in tiles) of block's left-top corner. - */ - getTileFromWorldXY: function (x, y) { - - x = Phaser.Math.snapToFloor(x, this.tileWidth) / this.tileWidth; - y = Phaser.Math.snapToFloor(y, this.tileHeight) / this.tileHeight; - - return this.getTileIndex(x, y); - - }, - - /** - * Get tiles overlaps the given object. - * @method getTileOverlaps - * @param {GameObject} object - Tiles you want to get that overlaps this. - * @return {array} Array with tiles informations (each contains x, y, and the tile). - */ - getTileOverlaps: function (object) { - - this._tempBlockResults.length = 0; - - // If the object is outside of the world coordinates then abort the check (tilemap has to exist within world bounds) - if (object.body.x < 0 || object.body.x > this.widthInPixels || object.body.y < 0 || object.body.bottom > this.heightInPixels) - { - return this._tempBlockResults; - } - - // What tiles do we need to check against? - this._tempTileX = this.game.math.snapToFloor(object.body.x, this.tileWidth) / this.tileWidth; - this._tempTileY = this.game.math.snapToFloor(object.body.y, this.tileHeight) / this.tileHeight; - this._tempTileW = (this.game.math.snapToCeil(object.body.width, this.tileWidth) + this.tileWidth) / this.tileWidth; - this._tempTileH = (this.game.math.snapToCeil(object.body.height, this.tileHeight) + this.tileHeight) / this.tileHeight; - - // Loop through the tiles we've got and check overlaps accordingly (the results are stored in this._tempTileBlock) - this.getTempBlock(this._tempTileX, this._tempTileY, this._tempTileW, this._tempTileH, true); - - for (var r = 0; r < this._tempTileBlock.length; r++) - { - // separateTile: function (object, x, y, width, height, mass, collideLeft, collideRight, collideUp, collideDown, separateX, separateY) - if (this.game.physics.separateTile(object, this._tempTileBlock[r].x * this.tileWidth, this._tempTileBlock[r].y * this.tileHeight, this.tileWidth, this.tileHeight, this._tempTileBlock[r].tile.mass, this._tempTileBlock[r].tile.collideLeft, this._tempTileBlock[r].tile.collideRight, this._tempTileBlock[r].tile.collideUp, this._tempTileBlock[r].tile.collideDown, this._tempTileBlock[r].tile.separateX, this._tempTileBlock[r].tile.separateY)) - { - this._tempBlockResults.push({ x: this._tempTileBlock[r].x, y: this._tempTileBlock[r].y, tile: this._tempTileBlock[r].tile }); - } - } - - return this._tempBlockResults; - - }, - - /** - * Get a tile block with its position and size (this method does not return, it'll set result to _tempTileBlock). - * @method getTempBlock - * @param {number} [x] - X position (in tiles) of block's left-top corner. - * @param {number} [y] - Y position (in tiles) of block's left-top corner. - * @param {number} [width] - width of block. - * @param {number} [height] - height of block. - * @param {boolean} collisionOnly - Whethor or not ONLY return tiles which will collide (its allowCollisions value is not Collision.NONE). - */ - getTempBlock: function (x, y, width, height, collisionOnly) { - - if (typeof collisionOnly === "undefined") { collisionOnly = false; } - - if (x < 0) - { - x = 0; - } - - if (y < 0) - { - y = 0; - } - - if (width > this.widthInTiles) - { - width = this.widthInTiles; - } - - if (height > this.heightInTiles) - { - height = this.heightInTiles; - } - - this._tempTileBlock = []; - - for (var ty = y; ty < y + height; ty++) - { - for (var tx = x; tx < x + width; tx++) - { - if (collisionOnly) - { - // We only want to consider the tile for checking if you can actually collide with it - if (this.mapData[ty] && this.mapData[ty][tx] && this.parent.tiles[this.mapData[ty][tx]].collideNone == false) - { - this._tempTileBlock.push({ - x: tx, - y: ty, - tile: this.parent.tiles[this.mapData[ty][tx]] - }); - } - } - else - { - if (this.mapData[ty] && this.mapData[ty][tx]) - { - this._tempTileBlock.push({ - x: tx, - y: ty, - tile: this.parent.tiles[this.mapData[ty][tx]] - }); - } - } - } - } - }, - - /** - * Get the tile index of specific position (in tiles). - * @method getTileIndex - * @param {number} x - X position of the tile. - * @param {number} y - Y position of the tile. - * @return {number} Index of the tile at that position. Return null if there isn't a tile there. - */ - getTileIndex: function (x, y) { - - if (y >= 0 && y < this.mapData.length) - { - if (x >= 0 && x < this.mapData[y].length) - { - return this.mapData[y][x]; - } - } - - return null; - - }, - - /** - * Add a column of tiles into the layer. - * @method addColumn - * @param {string[]|number[]} column - An array of tile indexes to be added. - */ - addColumn: function (column) { - - var data = []; - - for (var c = 0; c < column.length; c++) - { - data[c] = parseInt(column[c]); - } - - if (this.widthInTiles == 0) - { - this.widthInTiles = data.length; - this.widthInPixels = this.widthInTiles * this.tileWidth; - } - - this.mapData.push(data); - - this.heightInTiles++; - this.heightInPixels += this.tileHeight; - - }, - - /** - * Description. - * @method createCanvas - */ - createCanvas: function () { - - var width = this.game.width; - var height = this.game.height; - - if (this.widthInPixels < width) - { - width = this.widthInPixels; - } - - if (this.heightInPixels < height) - { - height = this.heightInPixels; - } - - this.canvas = Phaser.Canvas.create(width, height); - this.context = this.canvas.getContext('2d'); - - this.baseTexture = new PIXI.BaseTexture(this.canvas); - this.texture = new PIXI.Texture(this.baseTexture); - this.sprite = new PIXI.Sprite(this.texture); - - this.parent.addChild(this.sprite); - - }, - - createQuadTree: function (width, height) { - - this.quadTree = new Phaser.QuadTree(this, 0, 0, width, height, 20, 4); - - }, - - /** - * Update boundsInTiles with widthInTiles and heightInTiles. - * @method updateBounds - */ - updateBounds: function () { - - this.boundsInTiles.setTo(0, 0, this.widthInTiles, this.heightInTiles); - - }, - - /** - * Parse tile offsets from map data. - * Basically this creates a large array of objects that contain the x/y coordinates to grab each tile from - * for the entire map. Yes we could calculate this at run-time by using the tile index and some math, but we're - * trading a quite small bit of memory here to not have to process that in our main render loop. - * @method parseTileOffsets - * @return {number} Length of tileOffsets array. - */ - parseTileOffsets: function () { - - this.tileOffsets = []; - - var i = 0; - - if (this.mapFormat == Phaser.Tilemap.JSON) - { - // For some reason Tiled counts from 1 not 0 - this.tileOffsets[0] = null; - i = 1; - } - - for (var ty = this.tileMargin; ty < this.tileset.height; ty += (this.tileHeight + this.tileSpacing)) - { - for (var tx = this.tileMargin; tx < this.tileset.width; tx += (this.tileWidth + this.tileSpacing)) - { - this.tileOffsets[i] = { - x: tx, - y: ty - }; - i++; - } - } - - return this.tileOffsets.length; - - } - -}; - -/** -* Get -* @return {Description} -*//** -* Set -* @param {Description} value - Description. -*/ -Object.defineProperty(Phaser.TilemapLayer.prototype, 'alpha', { - - get: function() { - return this._alpha; - }, - - set: function(value) { - - if (this.sprite) - { - this.sprite.alpha = value; - } - - this._alpha = value; - } - -}); diff --git a/src/tilemap_old/TilemapRenderer.js b/src/tilemap_old/TilemapRenderer.js deleted file mode 100644 index b37dfbc4..00000000 --- a/src/tilemap_old/TilemapRenderer.js +++ /dev/null @@ -1,239 +0,0 @@ -/** -* @author Richard Davey -* @copyright 2013 Photon Storm Ltd. -* @license https://github.com/photonstorm/phaser/blob/master/license.txt MIT License -* @module Phaser.TilemapRenderer -*/ - -/** -* Tilemap renderer. -* -* @class Phaser.TilemapRenderer -* @constructor -* @param {Phaser.Game} game - A reference to the currently running game. -*/ -Phaser.TilemapRenderer = function (game) { - - /** - * @property {Phaser.Game} game - A reference to the currently running game. - */ - this.game = game; - - /** - * @property {number} _ga - Local rendering related temp vars to help avoid gc spikes through constant var creation. - * @private - * @default - */ - this._ga = 1; - - /** - * @property {number} _dx - Description. - * @private - * @default - */ - this._dx = 0; - - /** - * @property {number} _dy - Description. - * @private - * @default - */ - this._dy = 0; - - /** - * @property {number} _dw - Description. - * @private - * @default - */ - this._dw = 0; - - /** - * @property {number} _dh - Description. - * @private - * @default - */ - this._dh = 0; - - /** - * @property {number} _tx - Description. - * @private - * @default - */ - this._tx = 0; - - /** - * @property {number} _ty - Description. - * @private - * @default - */ - this._ty = 0; - - /** - * @property {number} _tl - Description. - * @private - * @default - */ - this._tl = 0; - - /** - * @property {number} _maxX - Description. - * @private - * @default - */ - this._maxX = 0; - - /** - * @property {number} _maxY - Description. - * @private - * @default - */ - this._maxY = 0; - - /** - * @property {number} _startX - Description. - * @private - * @default - */ - this._startX = 0; - - /** - * @property {number} _startY - Description. - * @private - * @default - */ - this._startY = 0; - -}; - -Phaser.TilemapRenderer.prototype = { - - /** - * Render a tilemap to a canvas. - * @method render - * @param tilemap {Tilemap} The tilemap data to render. - * @return {boolean} Description. - */ - render: function (tilemap) { - - // Loop through the layers - this._tl = tilemap.layers.length; - - for (var i = 0; i < this._tl; i++) - { - if (tilemap.layers[i].visible == false || tilemap.layers[i].alpha < 0.1) - { - continue; - } - - var layer = tilemap.layers[i]; - - // Work out how many tiles we can fit into our canvas and round it up for the edges - this._maxX = this.game.math.ceil(layer.canvas.width / layer.tileWidth) + 1; - this._maxY = this.game.math.ceil(layer.canvas.height / layer.tileHeight) + 1; - - // And now work out where in the tilemap the camera actually is - this._startX = this.game.math.floor(this.game.camera.x / layer.tileWidth); - this._startY = this.game.math.floor(this.game.camera.y / layer.tileHeight); - - // Tilemap bounds check - if (this._startX < 0) - { - this._startX = 0; - } - - if (this._startY < 0) - { - this._startY = 0; - } - - if (this._maxX > layer.widthInTiles) - { - this._maxX = layer.widthInTiles; - } - - if (this._maxY > layer.heightInTiles) - { - this._maxY = layer.heightInTiles; - } - - if (this._startX + this._maxX > layer.widthInTiles) - { - this._startX = layer.widthInTiles - this._maxX; - } - - if (this._startY + this._maxY > layer.heightInTiles) - { - this._startY = layer.heightInTiles - this._maxY; - } - - // Finally get the offset to avoid the blocky movement - this._dx = -(this.game.camera.x - (this._startX * layer.tileWidth)); - this._dy = -(this.game.camera.y - (this._startY * layer.tileHeight)); - - this._tx = this._dx; - this._ty = this._dy; - - // Alpha - if (layer.alpha !== 1) - { - this._ga = layer.context.globalAlpha; - layer.context.globalAlpha = layer.alpha; - } - - layer.context.clearRect(0, 0, layer.canvas.width, layer.canvas.height); - - for (var row = this._startY; row < this._startY + this._maxY; row++) - { - this._columnData = layer.mapData[row]; - - for (var tile = this._startX; tile < this._startX + this._maxX; tile++) - { - if (layer.tileOffsets[this._columnData[tile]]) - { - layer.context.drawImage( - layer.tileset, - layer.tileOffsets[this._columnData[tile]].x, - layer.tileOffsets[this._columnData[tile]].y, - layer.tileWidth, - layer.tileHeight, - this._tx, - this._ty, - layer.tileWidth, - layer.tileHeight - ); - - if (tilemap.tiles[this._columnData[tile]].collideNone == false) - { - layer.context.fillStyle = 'rgba(255,255,0,0.5)'; - layer.context.fillRect(this._tx, this._ty, layer.tileWidth, layer.tileHeight); - } - } - - - this._tx += layer.tileWidth; - - } - - this._tx = this._dx; - this._ty += layer.tileHeight; - - } - - if (this._ga > -1) - { - layer.context.globalAlpha = this._ga; - } - - // Only needed if running in WebGL, otherwise this array will never get cleared down I don't think! - if (this.game.renderType == Phaser.WEBGL) - { - PIXI.texturesToUpdate.push(layer.baseTexture); - } - - } - - return true; - - } - -}; \ No newline at end of file