Merged 1.2 branch into master for the final Phaser v2.0.0 release.

This commit is contained in:
photonstorm 2014-03-14 06:43:52 +00:00
commit 1746afe477
2219 changed files with 362483 additions and 289705 deletions

View file

@ -1,5 +1,5 @@
{ {
"globals" : { "Phaser": false, "PIXI": false }, "globals" : { "Phaser": false, "PIXI": false, "p2": false },
// Ignore Environment Globals // Ignore Environment Globals
"browser" : true, // Standard browser globals e.g. `window`, `document`. "browser" : true, // Standard browser globals e.g. `window`, `document`.
"couch" : false, "couch" : false,

View file

@ -11,7 +11,7 @@ It's important to us that you feel you can contribute towards the evolution of P
2. **Create an isolated and reproducible test case.** If you are reporting a bug, make sure you also have a minimal, runnable, code example that reproduces the problem you have. 2. **Create an isolated and reproducible test case.** If you are reporting a bug, make sure you also have a minimal, runnable, code example that reproduces the problem you have.
3. **Include a live example.** After narrowing your code down to only the problem areas, make use of[jsFiddle][1], [jsBin][2], or a link to your live site so that we can view a live example of the problem. 3. **Include a live example.** After narrowing your code down to only the problem areas, make use of [jsFiddle][1], [jsBin][2], or a link to your live site so that we can view a live example of the problem.
4. **Share as much information as possible.** Include browser version affected, your OS, version of the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed. 4. **Share as much information as possible.** Include browser version affected, your OS, version of the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed.
@ -35,7 +35,7 @@ The dev branch of Phaser is our 'current working' version. It is always ahead of
To take advantage of our grunt build script and jshint config it will be easiest for you if you have node.js and grunt installed locally. To take advantage of our grunt build script and jshint config it will be easiest for you if you have node.js and grunt installed locally.
You can download node.js from[nodejs.org][3]. After it has been installed open a console and run `npm i - g grunt - cli` to install the global `grunt` executable. You can download node.js from [nodejs.org][3]. After it has been installed open a console and run `npm i - g grunt - cli` to install the global `grunt` executable.
After that you can clone the repository and run `npm i` inside the cloned folder. This will install dependencies necessary for building the project. Once that is ready, After that you can clone the repository and run `npm i` inside the cloned folder. This will install dependencies necessary for building the project. Once that is ready,
make your changes and submit a Pull Request: make your changes and submit a Pull Request:

View file

@ -1,183 +1,381 @@
module.exports = function (grunt) { module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadTasks('./tasks'); grunt.loadNpmTasks('grunt-text-replace');
grunt.loadTasks('./tasks');
grunt.initConfig({ grunt.initConfig({
compile_dir: 'dist',
src: { pkg: grunt.file.readJSON('package.json'),
phaser: [
'src/Intro.js', banner: '/**\n' +
'src/pixi/Pixi.js', '* @author Richard Davey <rich@photonstorm.com>\n' +
'src/Phaser.js', '* @copyright 2014 Photon Storm Ltd.\n' +
'src/utils/Utils.js', '* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n' +
'src/pixi/core/Matrix.js', '*\n' +
'src/pixi/core/Point.js', '* @overview\n' +
'src/pixi/core/Rectangle.js', '*\n' +
'src/pixi/core/Polygon.js', '* Phaser - http://www.phaser.io\n' +
'src/pixi/display/DisplayObject.js', '*\n' +
'src/pixi/display/DisplayObjectContainer.js', '* v<%= pkg.version %> "<%= pkg.release %>" - Built: <%= grunt.template.today() %>\n' +
'src/pixi/display/Sprite.js', '*\n' +
'src/pixi/display/Stage.js', '* By Richard Davey http://www.photonstorm.com @photonstorm\n' +
'src/pixi/extras/CustomRenderable.js', '*\n' +
'src/pixi/extras/Strip.js', '* Phaser is a fun, free and fast 2D game framework for making HTML5 games \n' +
'src/pixi/extras/Rope.js', '* for desktop and mobile web browsers, supporting Canvas and WebGL.\n' +
'src/pixi/extras/TilingSprite.js', '*\n' +
'src/pixi/filters/AbstractFilter.js', '* Phaser uses Pixi.js for rendering, created by Mat Groves http://matgroves.com @Doormat23\n' +
'src/pixi/filters/FilterBlock.js', '* Phaser uses p2.js for full-body physics, created by Stefan Hedman https://github.com/schteppe/p2.js @schteppe\n' +
'src/pixi/primitives/Graphics.js', '* Phaser contains a port of N+ Physics, converted by Richard Davey, original by http://www.metanetsoftware.com\n' +
'src/pixi/renderers/canvas/CanvasGraphics.js', '*\n' +
'src/pixi/renderers/canvas/CanvasRenderer.js', '* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from which both Phaser\n' +
'src/pixi/renderers/webgl/PixiShader.js', '* and my love of framework development can be traced.\n' +
'src/pixi/renderers/webgl/PrimitiveShader.js', '*\n' +
'src/pixi/renderers/webgl/StripShader.js', '* Follow development at http://phaser.io and on our forum\n' +
'src/pixi/renderers/webgl/WebGLBatch.js', '*\n' +
'src/pixi/renderers/webgl/WebGLFilterManager.js', '* "If you want your children to be intelligent, read them fairy tales."\n' +
'src/pixi/renderers/webgl/WebGLGraphics.js', '* "If you want them to be more intelligent, read them more fairy tales."\n' +
'src/pixi/renderers/webgl/WebGLRenderer.js', '* -- Albert Einstein\n' +
'src/pixi/renderers/webgl/WebGLRenderGroup.js', '*/\n',
'src/pixi/renderers/webgl/WebGLShaders.js',
'src/pixi/text/BitmapText.js', release_dir: 'build',
'src/pixi/text/Text.js', compile_dir: 'dist',
'src/pixi/textures/BaseTexture.js',
'src/pixi/textures/Texture.js', pixi: [
'src/pixi/textures/RenderTexture.js', 'src/pixi/Intro.js',
'src/pixi/utils/EventTarget.js', 'src/pixi/Pixi.js',
'src/pixi/utils/Polyk.js', 'src/pixi/core/Point.js',
'src/core/Camera.js', 'src/pixi/core/Rectangle.js',
'src/core/State.js', 'src/pixi/core/Polygon.js',
'src/core/StateManager.js', 'src/pixi/core/Circle.js',
'src/core/LinkedList.js', 'src/pixi/core/Ellipse.js',
'src/core/Signal.js', 'src/pixi/core/Matrix.js',
'src/core/SignalBinding.js', 'src/pixi/display/DisplayObject.js',
'src/core/Filter.js', 'src/pixi/display/DisplayObjectContainer.js',
'src/core/Plugin.js', 'src/pixi/display/Sprite.js',
'src/core/PluginManager.js', 'src/pixi/display/SpriteBatch.js',
'src/core/Stage.js', 'src/pixi/filters/FilterBlock.js',
'src/core/Group.js', 'src/pixi/text/Text.js',
'src/core/World.js', 'src/pixi/text/BitmapText.js',
'src/core/Game.js', 'src/pixi/display/Stage.js',
'src/input/Input.js', 'src/pixi/utils/Utils.js',
'src/input/Key.js', 'src/pixi/utils/EventTarget.js',
'src/input/Keyboard.js', 'src/pixi/utils/Polyk.js',
'src/input/Mouse.js', 'src/pixi/renderers/webgl/utils/WebGLShaderUtils.js',
'src/input/MSPointer.js', 'src/pixi/renderers/webgl/shaders/PixiShader.js',
'src/input/Pointer.js', 'src/pixi/renderers/webgl/shaders/PixiFastShader.js',
'src/input/Touch.js', 'src/pixi/renderers/webgl/shaders/StripShader.js',
'src/input/InputHandler.js', 'src/pixi/renderers/webgl/shaders/PrimitiveShader.js',
'src/input/Gamepad.js', 'src/pixi/renderers/webgl/utils/WebGLGraphics.js',
'src/input/SinglePad.js', 'src/pixi/renderers/webgl/WebGLRenderer.js',
'src/input/GamepadButton.js', 'src/pixi/renderers/webgl/utils/WebGLMaskManager.js',
'src/gameobjects/Events.js', 'src/pixi/renderers/webgl/utils/WebGLShaderManager.js',
'src/gameobjects/GameObjectFactory.js', 'src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js',
'src/gameobjects/BitmapData.js', 'src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js',
'src/gameobjects/Sprite.js', 'src/pixi/renderers/webgl/utils/WebGLFilterManager.js',
'src/gameobjects/TileSprite.js', 'src/pixi/renderers/webgl/utils/FilterTexture.js',
'src/gameobjects/Text.js', 'src/pixi/renderers/canvas/utils/CanvasMaskManager.js',
'src/gameobjects/BitmapText.js', 'src/pixi/renderers/canvas/utils/CanvasTinter.js',
'src/gameobjects/Button.js', 'src/pixi/renderers/canvas/CanvasRenderer.js',
'src/gameobjects/Graphics.js', 'src/pixi/renderers/canvas/CanvasGraphics.js',
'src/gameobjects/RenderTexture.js', 'src/pixi/primitives/Graphics.js',
'src/system/Canvas.js', 'src/pixi/extras/TilingSprite.js',
'src/system/StageScaleMode.js', 'src/pixi/textures/BaseTexture.js',
'src/system/Device.js', 'src/pixi/textures/Texture.js',
'src/system/RequestAnimationFrame.js', 'src/pixi/textures/RenderTexture.js',
'src/math/RandomDataGenerator.js', 'src/pixi/Outro.js',
'src/math/Math.js', ],
'src/math/QuadTree.js',
'src/geom/Circle.js', phaser: [
'src/geom/Point.js', 'src/Intro.js',
'src/geom/Rectangle.js', 'src/Phaser.js',
'src/geom/Polygon.js', 'src/utils/Utils.js',
'src/geom/Line.js',
'src/net/Net.js', 'src/geom/Circle.js',
'src/tween/TweenManager.js', 'src/geom/Point.js',
'src/tween/Tween.js', 'src/geom/Rectangle.js',
'src/tween/Easing.js', 'src/geom/Line.js',
'src/time/Time.js', 'src/geom/Ellipse.js',
'src/time/Timer.js', 'src/geom/Polygon.js',
'src/time/TimerEvent.js',
'src/animation/AnimationManager.js', 'src/core/Camera.js',
'src/animation/Animation.js', 'src/core/State.js',
'src/animation/Frame.js', 'src/core/StateManager.js',
'src/animation/FrameData.js', 'src/core/LinkedList.js',
'src/animation/AnimationParser.js', 'src/core/Signal.js',
'src/loader/Cache.js', 'src/core/SignalBinding.js',
'src/loader/Loader.js', 'src/core/Filter.js',
'src/loader/LoaderParser.js', 'src/core/Plugin.js',
'src/sound/Sound.js', 'src/core/PluginManager.js',
'src/sound/SoundManager.js', 'src/core/Stage.js',
'src/utils/Debug.js', 'src/core/Group.js',
'src/utils/Color.js', 'src/core/World.js',
'src/physics/arcade/SAT.js', 'src/core/ScaleManager.js',
'src/physics/arcade/ArcadePhysics.js', 'src/core/Game.js',
'src/physics/arcade/Body.js',
'src/particles/Particles.js', 'src/input/Input.js',
'src/particles/arcade/ArcadeParticles.js', 'src/input/Key.js',
'src/particles/arcade/Emitter.js', 'src/input/Keyboard.js',
'src/tilemap/Tile.js', 'src/input/Mouse.js',
'src/tilemap/Tilemap.js', 'src/input/MSPointer.js',
'src/tilemap/TilemapLayer.js', 'src/input/Pointer.js',
'src/tilemap/TilemapParser.js', 'src/input/Touch.js',
'src/tilemap/Tileset.js', 'src/input/Gamepad.js',
'src/PixiPatch.js' 'src/input/SinglePad.js',
] 'src/input/GamepadButton.js',
}, 'src/input/InputHandler.js',
pkg: grunt.file.readJSON('package.json'),
clean: ['<%= compile_dir %>'], 'src/gameobjects/Events.js',
concat: { 'src/gameobjects/GameObjectFactory.js',
phaser: { 'src/gameobjects/GameObjectCreator.js',
options: { 'src/gameobjects/BitmapData.js',
process: { 'src/gameobjects/Sprite.js',
data: { 'src/gameobjects/Image.js',
version: '<%= pkg.version %>', 'src/gameobjects/TileSprite.js',
buildDate: '<%= grunt.template.today() %>' 'src/gameobjects/Text.js',
'src/gameobjects/BitmapText.js',
'src/gameobjects/Button.js',
'src/gameobjects/Graphics.js',
'src/gameobjects/RenderTexture.js',
'src/gameobjects/SpriteBatch.js',
'src/gameobjects/RetroFont.js',
'src/system/Canvas.js',
'src/system/Device.js',
'src/system/RequestAnimationFrame.js',
'src/math/Math.js',
'src/math/RandomDataGenerator.js',
'src/math/QuadTree.js',
'src/net/Net.js',
'src/tween/TweenManager.js',
'src/tween/Tween.js',
'src/tween/Easing.js',
'src/time/Time.js',
'src/time/Timer.js',
'src/time/TimerEvent.js',
'src/animation/AnimationManager.js',
'src/animation/Animation.js',
'src/animation/Frame.js',
'src/animation/FrameData.js',
'src/animation/AnimationParser.js',
'src/loader/Cache.js',
'src/loader/Loader.js',
'src/loader/LoaderParser.js',
'src/sound/Sound.js',
'src/sound/SoundManager.js',
'src/utils/Debug.js',
'src/utils/Color.js',
'src/physics/Physics.js',
'src/physics/arcade/World.js',
'src/physics/arcade/Body.js',
'src/particles/Particles.js',
'src/particles/arcade/ArcadeParticles.js',
'src/particles/arcade/Emitter.js',
'src/tilemap/Tile.js',
'src/tilemap/Tilemap.js',
'src/tilemap/TilemapLayer.js',
'src/tilemap/TilemapParser.js',
'src/tilemap/Tileset.js',
'src/Outro.js'
],
p2: [
'src/physics/p2/p2.js',
'src/physics/p2/World.js',
'src/physics/p2/PointProxy.js',
'src/physics/p2/InversePointProxy.js',
'src/physics/p2/Body.js',
'src/physics/p2/BodyDebug.js',
'src/physics/p2/Spring.js',
'src/physics/p2/Material.js',
'src/physics/p2/ContactMaterial.js',
'src/physics/p2/CollisionGroup.js',
'/src/physics/p2/DistanceConstraint.js',
'/src/physics/p2/GearConstraint.js',
'/src/physics/p2/LockConstraint.js',
'/src/physics/p2/PrismaticConstraint.js',
'/src/physics/p2/RevoluteConstraint.js'
],
ninja: [
'src/physics/ninja/World.js',
'src/physics/ninja/Body.js',
'src/physics/ninja/AABB.js',
'src/physics/ninja/Tile.js',
'src/physics/ninja/Circle.js'
],
// If we've updated pixi or p2 then their UMD wrappers will be wrong, this will fix it:
replace: {
pixi: {
src: ['src/pixi/Outro.js'],
dest: 'src/pixi/Outro.js',
replacements: [{
from: "define(PIXI);",
to: "define('PIXI', (function() { return root.PIXI = PIXI; })() );"
}]
},
p2: {
src: ['src/physics/p2/p2.js'],
dest: 'src/physics/p2/p2.js',
replacements: [{
from: '!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.p2=e():"undefined"!=typeof global?self.p2=e():"undefined"!=typeof self&&(self.p2=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module \'"+o+"\'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){',
to: '!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(\'p2\', (function() { return this.p2 = e(); })()):"undefined"!=typeof window?window.p2=e():"undefined"!=typeof global?self.p2=e():"undefined"!=typeof self&&(self.p2=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module \'"+o+"\'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){'
}]
} }
}
},
src: ['<%= src.phaser %>'],
dest: '<%= compile_dir %>/phaser.js'
}
},
umd: {
phaser: {
src: '<%= concat.phaser.dest %>',
dest: '<%= umd.phaser.src %>'
}
},
uglify: {
phaser: {
options: {
banner: '/*! Phaser v<%= pkg.version %> | (c) 2013 Photon Storm Ltd. */\n'
},
src: ['<%= umd.phaser.dest %>'],
dest: '<%= compile_dir %>/phaser.min.js'
}
},
examples: {
all: {
options: {
base: 'examples',
excludes: ['_site', 'assets', 'states', 'wip']
},
src: ['examples/**/*.js'],
dest: 'examples/_site/examples.json'
}
},
connect: {
root: {
options: {
keepalive: true
}
}
}
});
grunt.registerTask('default', ['build', 'examples']); },
grunt.registerTask('build', ['clean', 'concat', 'umd', 'uglify']);
clean: ['<%= compile_dir %>'],
concat: {
// Our custom version of p2
p2: {
src: ['<%= p2 %>'],
dest: '<%= compile_dir %>/p2.js'
},
// Our custom version of Pixi
pixi: {
src: ['<%= pixi %>'],
dest: '<%= compile_dir %>/pixi.js'
},
// Our custom version of Ninja Physics
ninja: {
src: ['<%= ninja %>'],
dest: '<%= compile_dir %>/ninja.js'
},
// Phaser with no bundled libs
phaser: {
options: {
banner: '<%= banner %>'
},
src: ['<%= phaser %>'],
dest: '<%= compile_dir %>/phaser-no-libs.js'
},
// One ring to rule them all
standalone: {
options: {
banner: '<%= banner %>'
},
src: ['<%= compile_dir %>/pixi.js', '<%= compile_dir %>/phaser-no-libs.js', '<%= compile_dir %>/ninja.js', '<%= compile_dir %>/p2.js'],
dest: '<%= compile_dir %>/phaser.js'
}
},
uglify: {
p2: {
options: {
banner: '/* p2.js custom build for Phaser v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.p2.dest %>'],
dest: '<%= compile_dir %>/p2.min.js'
},
pixi: {
options: {
banner: '/* Pixi.js custom build for Phaser v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.pixi.dest %>'],
dest: '<%= compile_dir %>/pixi.min.js'
},
ninja: {
options: {
banner: '/* Ninja Physics for Phaser v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.ninja.dest %>'],
dest: '<%= compile_dir %>/ninja.min.js'
},
phaser: {
options: {
banner: '/* Phaser (no libs) v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.phaser.dest %>'],
dest: '<%= compile_dir %>/phaser-no-libs.min.js'
},
standalone: {
options: {
sourceMap: true,
sourceMapName: '<%= compile_dir %>/phaser.map',
banner: '/* Phaser v<%= pkg.version %> - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */\n'
},
src: ['<%= concat.standalone.dest %>'],
dest: '<%= compile_dir %>/phaser.min.js'
}
},
copy: {
main: {
files: [
{ src: ['dist/phaser.js'], dest: 'build/phaser.js' },
{ src: ['dist/phaser.min.js'], dest: 'build/phaser.min.js' },
{ src: ['dist/phaser.map'], dest: 'build/phaser.map' },
{ src: ['dist/p2.js'], dest: 'build/custom/p2.js' },
{ src: ['dist/p2.min.js'], dest: 'build/custom/p2.min.js' },
{ src: ['dist/phaser-no-libs.js'], dest: 'build/custom/phaser-no-libs.js' },
{ src: ['dist/phaser-no-libs.min.js'], dest: 'build/custom/phaser-no-libs.min.js' },
{ src: ['dist/pixi.js'], dest: 'build/custom/pixi.js' },
{ src: ['dist/pixi.min.js'], dest: 'build/custom/pixi.min.js' },
{ src: ['dist/ninja.js'], dest: 'build/custom/ninja.js' },
{ src: ['dist/ninja.min.js'], dest: 'build/custom/ninja.min.js' }
]
}
},
examples: {
all: {
options: {
base: 'examples',
excludes: ['_site', 'assets', 'states', 'wip']
},
src: ['examples/**/*.js'],
dest: 'examples/_site/examples.json'
}
},
connect: {
root: {
options: {
keepalive: true,
hostname: '*'
}
}
}
});
grunt.registerTask('default', ['build', 'examples']);
grunt.registerTask('build', ['clean', 'concat', 'uglify']);
grunt.registerTask('dist', ['clean', 'concat', 'uglify', 'copy']);
}; };

240
README.md
View file

@ -1,19 +1,21 @@
![Phaser Logo](http://www.photonstorm.com/wp-content/uploads/2013/09/phaser_10_release.jpg) ![Phaser 2.0](http://www.phaser.io/images/phaser2-github.png)
Phaser 1.1.6 Phaser 2.0.0
============ ============
Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering. Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering.
Version: 1.1.6 "Shienar" - Released: 24th February 2014 Version: 2.0.0 "Aes Sedai" - Released: March 13th 2014
By Richard Davey, [Photon Storm](http://www.photonstorm.com) By Richard Davey, [Photon Storm](http://www.photonstorm.com)
* View the [Official Website](http://phaser.io) * View the [Official Website](http://phaser.io)
* Follow on [Twitter](https://twitter.com/photonstorm) * Follow on [Twitter](https://twitter.com/photonstorm)
* Join the [Forum](http://www.html5gamedevs.com/forum/14-phaser/) * Join the [Forum](http://www.html5gamedevs.com/forum/14-phaser/)
* Try out 220+ [Phaser Examples](http://examples.phaser.io) * Source code for 250+ [Phaser Examples](https://github.com/photonstorm/phaser-examples)
* Read the [documentation online](http://docs.phaser.io) * Read the [documentation online](http://docs.phaser.io)
* Browse the [Examples online](http://examples.phaser.io)
* Join our [#phaserio IRC channel](http://www.html5gamedevs.com/topic/4470-official-phaserio-irc-channel-phaserio-on-freenode/) on freenode
[Subscribe to our new Phaser Newsletter](https://confirmsubscription.com/h/r/369DE48E3E86AF1E). We'll email you when new versions are released as well as send you our regular Phaser game making magazine. [Subscribe to our new Phaser Newsletter](https://confirmsubscription.com/h/r/369DE48E3E86AF1E). We'll email you when new versions are released as well as send you our regular Phaser game making magazine.
@ -23,35 +25,17 @@ By Richard Davey, [Photon Storm](http://www.photonstorm.com)
Welcome to Phaser Welcome to Phaser
----------------- -----------------
1.1.6 is the final point release before Phaser 2.0 is released this March. Exactly 6 months ago we released Phaser 1.0 into the world. Suffice to say that since then we've been overwhelmed at the huge surge of developers taking to it! Our github repository is consistently in the top JavaScript lists, we've over 3200 stars at the time of writing, and a wonderful, vibrant and friendly community. Phaser 2 is a natural evolution of what we started. We've focused specifically on performance and expansion with this release. Lots of developers have already reported to us considerably speed increases just by swapping to Phaser 2 (reports of 200% faster speeds on mobile aren't unheard of!). There's also a full-body physics system available now, in the form of the excellent p2.js. The upgrade to Pixi 1.5 under the hood bought lots of new visual effects in, including blend modes and tints.
As you may know we had planned to release 1.1.4 at the end of 2013. For various reasons this didn't quite happen, but we're happy to announce it's finally out! There have been some dramatic changes internally, and if you make use of either the physics systems or tilemaps then you are going to need to update your code. Hopefully only a little bit, but there have been a number of core API changes which we detail below. There are also a host of new features, the headliners being: And we're also really pleased to have closed down over 550 issues reported on github. We literally went through every last bug reported to us, and fixed it. All kinds of little things that as a whole make the library that much more solid. With the 2.0 release we're now freezing the API. Before we have to admit that the API changed somewhat on a whim, and we moved things around and changed things without too much consideration for fellow developers. With 2.0 that stops - we've spent long enough on this release that we're now extremely happy with the organisation of classes and methods, and while we may still need to make small tweaks in the future, none of them will be API breaking without prior community approval first. This means if you're using Phaser to teach in classes, or writing a book / tutorials around it, this is the version to base off.
* New Physics system. Uses SAT.js internally so physics bodies can now be rectangles, circles or polygons and support rotation. If you want to port a Phaser 1.x game over to 2 then please see our [Migration Guide](https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md) for help.
* New Tilemap system. Brand new collision system for tiles, much more advanced layer handling, tile properties, multiple tilesets of layer and more.
* New Timer. This handy new class lets you create timed events easily.
* Your Game can now be configured from an external configuration object.
* Over 150 new features and updates and over 30 reported bug fixes.
This release also brings the TypeScript definitions file as bang up to date as possible. There are still a few areas that need looking at, but with your help hopefully we can iron those final few bits out and have a 100% accruate defs file on offer. So what's next? We do have a roadmap (which you can find at the bottom of this document), but we're going to sit back and take stock for a while, building up the tutorials and sample games. We will of course jump on bug fixes quickly, and we appreciate that our TypeScript definitions are now slightly out of date again (an eternal quest we appear to be on!), but this is definitely the best release of Phaser ever. The most features, the fastest, the most stable and just generally the most fun to use.
There is a new Contributors Guide which we'd urge you to follow if you wish to help with Phaser development, and we've updated the doc files and added lots more details into key areas. The Examples have grown too! Now over 220 of them including several great ones from the community. Happy coding everyone! See you on the forums.
We're going to settle on this build for a short while as we do some quick iteration bug fixing, so expect to see some small point releases very soon that do nothing but address any issues you may find. But in parallel to this we are also now rebuilding our core to bring it in-line with the latest version of Pixi.js, which has had some dramatic changes under the hood, changes will impact a lot of what Phaser does internally. But the changes are all for the better and once we upgrade Pixi you'll have a significantly faster renderer and a smaller codebase too, as we do away with stacks of linked list code :) ![boogie](http://www.phaser.io/images/spacedancer.gif)
As always we offer a heart-felt "Thank you!" to everyone who has encouraged us along the way. To those of you who worked with Phaser during its various incarnations. The number of games being released that were made with Phaser is staggering and we really love to see how you use it! You are our heroes. It's your kind words and enthusiasm that has keeps us going.
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 still only just scratched the surface of what we have planned for it.
![MiniCybernoid](http://www.photonstorm.com/wp-content/uploads/2013/10/phaser-cybernoid-640x480.png)
Help Test 2.0
-------------
Originally we were going to release Phaser 1.2 next, however after working solidly on it for a while we realise it's such a large and API breaking/changing update that we need to step-up the version to 2.0 to avoid any possible confusion. Progress has been rapid and we'd love for you to help test it. You'll notice a new [1.2 branch](https://github.com/photonstorm/phaser/tree/1.2) on github - we're going to keep the branch name as 1.2 as we're nearly at the end of development now, but please understand this is what will actually be the 2.0 release.
Please help test out 1.2/2.0 as much as you can. It features the brand new Pixi 1.5 internally as well as nearly complete integration with p2.js for all physics (dropping ArcadePhysics entirely). New versions are being pushed several times a day, so be sure to update and pull often. Don't expect to just run old games right under it yet, but please do check out the new tests, experiment and poke it around as much as you can - thank you!
Getting Started Guides Getting Started Guides
@ -64,36 +48,161 @@ There is a comprehensive [How to Learn Phaser](http://gamedevelopment.tutsplus.c
There is also an [un-official Getting Started Guide](http://www.antonoffplus.com/coding-an-html5-game-for-30-minutes-or-an-introduction-to-the-phaser-framework). There is also an [un-official Getting Started Guide](http://www.antonoffplus.com/coding-an-html5-game-for-30-minutes-or-an-introduction-to-the-phaser-framework).
![Phaser Logo](http://www.photonstorm.com/wp-content/uploads/2013/09/phaser_10_release.jpg)
Change Log Change Log
---------- ----------
Version 1.1.6 - "Shienar" - 24th February 2014 (amended 21:34 GMT) Version 2.0.0 - "Aes Sedai" - March 13th 2014
New Examples: There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md) available. In the guide we detail the API breaking changes and approach to our new physics system. The following is a list of all the other new features, updates and bug fixes present in this release.
* Added lovely new little mini golf game by jpcloud. New features:
* Phaser.Image is a brand new display object perfect for logos, backgrounds, etc. You can scale, rotate, tint, blend an get input events from an Image, but it has no animation or physics body.
* You can now use the hitArea property on Sprites and Image objects. hitArea can be a geometry object (Rectangle, Circle, Polygon, Ellipse) and is used in pointerOver checks.
* InputManager.getLocalPosition(displayObject, pointer, output) will return the local coordinates of the specified displayObject and pointer.
* InputManager.hitTest will test for pointer hits against a Sprite/Image, its hitArea (if set) or any of its children.
* Text has lots of new methods to help style it: Text.fill, Text.align, Text.stroke, etc.
* Text now works happily with font names with spaces in them.
* Text.setShadow applies a drop shadow to the Text being rendered. Control the x, y, color and blur.
* Text.lineSpacing allows you to set additional spacing between each line that is rendered.
* Text.inputEnabled allows you to enable all input events over Text objects: dragging, clicking, etc - anything that works on a Sprite works on Text now too.
* Phaser.Ellipse added. A fully compatible port of the PIXI.Ellipse class, can be used in Sprite/Image hitArea tests.
* Phaser.Polygon added. A fully compatible port of the PIXI.Polygon class, can be used in Sprite/Image hitArea tests.
* InputHandler.pixelPerfectOver - performs a pixel perfect check to see if any pointer is over the current object (warning: very expensive!)
* InputHandler.pixelPerfectClick - performs a pixel perfect check but only when the pointer touches/clicks on the current object.
* TileSprite can now use a frame from a texture atlas or a sprite sheet.
* TileSprites can now be animated. See new example :)
* TileSprites have a new method: autoScroll(x, y) which sets an automatic scroll running (until stopped with TileSprite.stopScroll).
* BitmapText now uses the new XML parser which should work under CocoonJS without clashes.
* BitmapText signature changed so you can support fonts with spaces in their names.
* Loader.bitmapFont now has 2 extra parameters: xSpacing and ySpacing. These allow you to add extra spacing to each letter or line of the font.
* Added the new RetroFont class. This is for rendering fixed-width bitmap fonts into an Image object. It's a texture you can apply to a Sprite/Image.
* Added Cache.updateFrameData which is really useful for swapping FrameData blocks in the cache.
* Loader.physics now lets you load Lime + Corona JSON Physics data, which can be used with Body.loadPolygon and Body.loadData.
* Cache.addPhysicsData and Cache.getPhysicsData allow you to store parsed JSON physics data in the cache, for sharing between Bodies.
* fixedToCamera now works across all display objects. When enabled it will fix at its current x/y coordinate, but can be changed via cameraOffset.
* fixedToCamrea now works for Groups as well :) You can fix a Group to the camera and it will influence its children.
* Tilemap.createCollisionObjects will parse Tiled data for objectgroups and convert polyline instances into physics objects you can collide with in the world.
* Loader can now load JSON files specifically (game.load.json) and they are parsed and stored in the Game.Cache. Retrieve with game.cache.getJSON(key).
* TileSprites can now receive full Input events, dragging, etc and be positioned in-world and fixed to cameras.
* The StateManager now looks for a function called 'resumed' which is called when a game un-pauses.
* Key.onHold added. This event is dispatched every time the browser sends a keydown event and the key is already being held down.
* Stage.smoothed allows you to set if sprites will be smoothed when rendered. Set to false if you're using pixel art in your game. Default is true. Works in Canvas and WebGL.
* Sprite.smoothed and Image.smoothed allows you to set per-Sprite smoothing, perfect if you just want to keep a few sprites smoothed (or not)
* StateManager.start can now have as many parameters as you like. The order is: start(key, clearWorld, clearCache, ...) - they are passed to State.init() (NOT create!)
* Loader.script now has callback (and callbackContext) parameters, so you can specify a function to run once the JS has been injected into the body.
* Phaser.Timer.stop has a new parameter: clearEvents (default true), if true all the events in Timer will be cleared, otherwise they will remain (fixes #383)
* All GameObjects now have a 'destroyChildren' boolean as a parameter to their destroy method. It's default is true and the value propogates down its children.
* Pixi GrayFilter ported over (thanks nickryall #404)
* Animation.speed added. You can now change the animation speed on the fly, without re-starting the animation (feature request #458)
* Brand new Grunt task - creates each core library as its own file and a combined phaser.js.
* New build script now cleanly splits Phaser, Pixi and p2 so they are each UMD wrapped and each available in the global scope (now more requireJS friendly!).
* phaser-no-libs.js allows you to use your own version of p2.js or pixi.js with Phaser. Warning: This is totally unsupported. If you hit bugs, you fix them yourself.
* Group.sendToBottom(child) is the handy opposite of Group.bringToTop()
* Group.moveUp(child) will move a child up the display list, swapping with the child above it.
* Group.moveDown(child) will move a child down the display list, swapping with the child below it.
* Device.windowsPhone is now tested for.
* The Debug panel now works in WebGL mode. Pay attention to the warning at the top of the Debug docs (feature request #499)
* You can now create blank Tilemaps and then populate them with data later.
* A single Animation object now has 3 new events: onStart, onLoop and onComplete.
* Animation.loopCount holds the number of times the animation has looped since it last started.
* Tween.generateData(frameRate) allows you to generate tween data into an array, which can then be used however you wish (see new examples)
* Group.xy(index, x, y) allows you to set the x and y coordinates of a Group child at the given index.
* Group.reverse() reverses the display order of all children in the Group.
* Tweens are now bound to their own TweenManager, not always the global game one. So you can create your own managers now (for you clark :)
* ScaleManager.fullScreenTarget allows you to change the DOM element that the fullscreen API is called on (feature request #526)
* Merged Georges p2 BodyDebug and reformatted for jshint pass. Looks awesome :)
* ArcadePhysics.Body has a new gravityScale property, which is a modifier multiplied against the world gravity value on a Body.
* Line.coordinatesOnLine will return all coordinates on the line using Bresenhams line algorithm.
* Line now has x, y, width, height, top, bottom, left and right properties, so you can effectively get its bounds.
* TilemapLayer.getRayCastTiles will let you get all tiles that hit the given line for further processing.
Updates: Updates:
* Loader can now load JSON files natively (thanks lucas) * Massive thanks to clark-stevenson for doing an amazing job update the TypeScript definitions file.
* TilemapParser now errors if the tileset isn't the right size * Debug.renderRectangle has a new parameter: filled. If true it renders as with fillRect, if false strokeRect.
* Phaser.AnimationParser now sets the trimmed data directly for Pixi Texture frames. Tested across JSON Hash, JSON Data, Sprite Sheet and XML.
* Game.add.renderTexture now has the addToCache parameter. If set the texture will be stored in Game.Cache and can be retrieved with Cache.getTexture(key).
* Game.add.bitmapData now has the addToCache parameter. If set the texture will be stored in Game.Cache and can be retrieved with Cache.getBitmapData(key).
* The InputManager now sets the canvas style cursor to 'inherit' instead of 'default'.
* World.reset now calls Camera.reset which sends the camera back to 0,0 and un-follows any object it may have been tracking.
* Added hostname: '*' to the grunt-connect in Gruntfile.js (fixes #426)
* Device, Canvas and GamePad classes all updated for better CocoonJS support (thanks Videlais)
* BitmapData.alphaMask will draw the given image onto a BitmapData using an image as an alpha mask.
* The new GameObjectCreator (which you access via game.make or State.make) lets you easily create an object but NOT add it to the display list.
* TilemapParser will now throw a warning if the tileset image isn't the right size for the tile dimensions.
* We now force IE11 into Canvas mode to avoid a Pixi bug with pre-multiplied alpha. Will remove once that is fixed, sorry, but it's better than no game at all, right? :(
* Loader.setPreloadSprite() will now set sprite.visible = true once the crop has been applied. Should help avoid issues (#430) on super-slow connections.
* Updated the way the page visibility is checked, should now be more compatible across more browsers.
* Phaser.Input.Key.isUp now defaults to 'true', as does GamepadButton.isUp (#474)
* Vastly improved visibility API support + pageshow/pagehide + focus/blur. Working across Chrome, IE, Firefox, iOS, Android (also fixes #161)
* Pausing the game will now mute audio and resuming will un-mute, unless it was muted via the game (fixes #439)
* ScaleManager has 2 new events: ScaleManager.enterFullScreen and ScaleManager.leaveFullScreen, so you can respond to fullscreen changes directly.
* RandomDataGenerator.integerInRange(min, max) now includes both `min` and `max` within its range (#501)
* Tween no longer copies all the object properties into the `_valuesStart` object on creation.
* Completely empty Tilemaps can now be created. This allows for dynamic map generation at runtime.
* Keyboard.event now stores the most recent DOM keyboard event.
* Animation.stop has a new parameter: dispatchComplete. If true it'll dispatch an Animation.onComplete event.
* TileSprites now have a physics body property and call it in the pre and post updates. As with all physics bodies it's null by default.
* json is now the default tilemap format when not defined (thanks RyanDansie, #528)
* The Particle Emitter now remembers the frames given to it and resets it when a new particle is emitted.
* Game.focusLoss and focusGain methods and onBlur and onFocus Signals added, allowing for more fine-grained control over game pause vs. focus loss.
* Keyboard.removeKey method added (thanks qdrj, #550)
* Key.event now stores the most recent DOM event that triggered it.
Bug Fixes: Bug Fixes:
* Physics.processRebound now takes Body direction into account, helps with body-body collision bounces (thanks ram64) * Explicitly paused Timer continues if you un-focus and focus the browser window (thanks georgiee)
* Fixed the Example / physics / mass velocity test. * Added TimerEvent.pendingDelete and checks in Timer.update, so that removing an event in a callback no longer throws an exception (thanks georgiee)
* Updated Physics.Body.applyDamping so that velocity is reduced down to zero properly (thanks caezs) * Fixed TypeScript defs on lines 1741-1748 (thanks wombatbuddy)
* ArcadePhysics.collideSpriteVsTilemapLayer wouldn't call the process or collide callbacks if only 1 tile was involved in the check (thanks mandarinx) * Previously if you used Sprite.crop() it would crop all Sprites that shared the same base image. It now takes a local copy of the texture data and crops just that.
* Lots of documentation fixes (thanks nhowell) * Tilemap had the wrong @method signatures so most were missing from the docs.
* Fix for PixiPatch so it renders masks again (thanks georgios) * Fixed bug where changing State would cause the camera to not reset if it was following an object.
* Modified ArcadePhysics.intersects so it returns a value as well as asigns (thanks bunnyhero) * Tile had 2 properties (callback and callbackContext) that were never assigned, updated to use the proper names (thanks ratkingsimon)
* Lots of TypeScript defs fixes (thanks clark) * Fixed an error that would occur if you used InputHandler.onInputUp and the Sprite destroys itself during the event.
* IE11 didn't populate the Device.ieVersion value. Now extracted from Trident revision, but still use Device.trident instead for IE11+ checks.
* Fixed bug in Math.angleBetween where it was using the coordinates in the wrong order.
* Previously using a Pixel Perfect check didn't work if the Sprite was rotated or had a non-zero anchor point, now works under all conditions + atlas frames.
* If pixelPerfect Input Sprites overlapped each other the pixel check wasn't taken into consieration in the Pointer move method.
* Updated Input.Mouse to use event.button not event.which, so the const reference from input.mouse.button is correct (thanks grimor)
* Text that was fixedToCamera would 'jitter' if the world scrolled. Now works as expected across all fixed objects.
* Fixed a bug where Sound.play wouldn't pick-up the local loop setting if not specified in the parameter.
* Active animations now monitor if the game pauses, and resume normally when the game un-pauses (fixes #179)
* Swapping between tabs will now pause the game correctly on mobile browsers (iOS7+)
* Swapping between tabs will pause and resume tweens correctly, allowing their onComplete events to still fire (fixes #292)
* Fullscreen mode now uses window.outerWidth/Height when using EXACT_FIT as the scale mode, which fixes input coordinate errors (fixes #232)
* Fullscreen mode now works in Internet Explorer and uses the new fullscreen non-prefix call.
* Fixed TilemapParser - would spit out a tileset warning if margin/spacing were set (fix #485, thanks Cybolic)
* AnimationParser.spriteSheet wasn't taking the margin or spacing into account when calculating the numbers of sprites per row/column, nor was it allowing for extra power-of-two padding at the end (fix #482, thanks yig)
* AnimationManager.add documentation said that 'frames' could be null, but the code couldn't handle this so it defaults to an empty array if none given (thanks yig)
* Fixed issue stopping SoundManager.volume from working correctly on a global volume basis (fixes #488)
* Phaser.Timer will no longer create negative ticks during game boot, no matter how small the Timer delay is (fixes #366)
* Phaser.Timer will no longer resume if it was previously paused and the game loses focus and then resumes (fixes #383)
* Tweens now resume correctly if the game pauses (focus loss) while they are paused.
* Tweens don't double pause if they were already paused and the game pauses.
* Buttons are now cleanly destroyed if part of a Group without leaving their InputHandler running.
* You can now safely destroy a Group and the 'destroyChildren' boolean will propogate fully down the display list.
* Calling destroy on an already destroyed object would throw a run-time error. Now checked for and aborted.
* Calling destroy while in an Input Event callback now works for either the parent Group or the calling object itself.
* Loader.replaceInFileList wouldn't over-write the previous entry correctly, which caused the Loader.image overwrite parameter to fail (thanks basoko, fixes #493)
* If the game was set to NO_SCALE and you swapped orientation, it would pause and resize, then fail to resize when you swapped back (thanks starnut, fixes #258)
* Device no longer things a Windows Phone or Windows Tablet are desktop devices (thanks wombatbuddy, fixes #506)
* Sound.onMarkerComplete event is now dispatched when a marker stops. See Sound.onLoop for a looping marker event (thanks registered99, fixes #500)
* Events.onInputUp would be dispatched twice if the Sprite had drag enabled, now only dispatched once (thanks Overbryd, fixes #502)
* You can now load in CSV Tilemaps again and they get created properly (fixes #391)
* Tilemap.putTile can now insert a tile into a null/blank area of the map (before it could only replace existing tiles)
* Tilemap.putTile now correctly re-calculates the collision data based on the new collideIndexes array (fixes #371)
* Circle.circumferencePoint using the asDegrees parameter would apply degToRad instead of radToDeg (thanks Ziriax, fixes #509)
* InputHandler.enableSnap now correctly assigns the snap offset parameters (fixes #515)
* Objects that are 'fixedToCamera' are now still correctly placed even if the camera is scaled (#512)
* Changed the define function calls to use named modules, allows pixi, phaser and p2 to reside in 1 file and still be located by requirejs (thanks brejep, #531)
* Cache.destroy fixed to clear up properly (thanks Dumtard, #537)
See the full Change Log for all the 1.1.4 and 1.1.5 updates and API changes (as there were a lot of them!)
You can view the Change Log for all previous versions at https://github.com/photonstorm/phaser/changelog.md You can view the Change Log for all previous versions at https://github.com/photonstorm/phaser/changelog.md
@ -104,7 +213,9 @@ We provide a fully compiled version of Phaser in the `build` directory, in both
We also provide a Grunt script that will build Phaser from source along with all the examples. We also provide a Grunt script that will build Phaser from source along with all the examples.
Run `grunt` in the phaser folder for a list of command-line options. Run `grunt` to perform a default build to the `dist` folder and update the examples.
If you replace Pixi or p2 then run `grunt replace` to patch their UMD strings so they work properly with Phaser and requireJS.
Koding Koding
@ -130,11 +241,11 @@ CDNJS
Thanks to a community member Phaser is now available on [CDNJS](http://cdnjs.com). You can include the following in your html: Thanks to a community member Phaser is now available on [CDNJS](http://cdnjs.com). You can include the following in your html:
`http://cdnjs.cloudflare.com/ajax/libs/phaser/1.1.5/phaser.min.js` `http://cdnjs.cloudflare.com/ajax/libs/phaser/2.0.0/phaser.min.js`
Or if you prefer you can leave the protocol off, so it works via http and https: Or if you prefer you can leave the protocol off, so it works via http and https:
`//cdnjs.cloudflare.com/ajax/libs/phaser/1.1.5/phaser.min.js` `//cdnjs.cloudflare.com/ajax/libs/phaser/2.0.0/phaser.min.js`
Requirements Requirements
@ -144,13 +255,19 @@ 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. 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 321 KB minified and 72 KB gzipped. Phaser is 576 KB minified (including all 3 physics engines, 311 KB without) and 128 KB gzipped (67 KB without physics libs).
Learn By Example Learn By Example
---------------- ----------------
Phaser comes with an ever growing suite of Examples. Personally I feel that we learn better by looking at small refined code examples, so we created over 200 of them and create new ones to test every new feature added. Inside the `examples` folder you'll find the current set. If you write a particularly good example then please send it to us. Ever since we started Phaser we've been growing and expanding our extensive set of Examples. Currently over 250 of them!
They used to be bundled in the main Phaser repo, but because they got so large and in order to help with versioning we've moved them to their own repo.
Please go and checkout https://github.com/photonstorm/phaser-examples
Phaser comes with an ever growing suite of Examples. Personally I feel that we learn better by looking at small refined code examples, so we created over 250 of them and create new ones to test every new feature added. Inside the `examples` repo you'll find the current set. If you write a particularly good example then please send it to us.
The examples need to be run through a local web server (in order to avoid file access permission errors from your browser). You can use your own web server, or start the included web server using grunt. The examples need to be run through a local web server (in order to avoid file access permission errors from your browser). You can use your own web server, or start the included web server using grunt.
@ -162,7 +279,7 @@ Alternatively in order to start the included web server, after you've cloned the
There is a new 'Side View' example viewer as well. This loads all the examples into a left-hand frame for faster navigation. There is a new 'Side View' example viewer as well. This loads all the examples into a left-hand frame for faster navigation.
You can also browse all [Phaser Examples](http://gametest.mobi/phaser/) online. You can also browse all [Phaser Examples](http://examples.phaser.io) online.
Features Features
@ -174,11 +291,11 @@ Phaser uses both a Canvas and WebGL renderer internally and can automatically sw
**Preloader** **Preloader**
We've made the loading of assets as simple as one line of code. Images, Sounds, Sprite Sheets, Tilemaps, JSON data, XML and JavaScrtip files - all parsed and handled automatically, ready for use in game and stored in a global Cache for Sprites to share. We've made the loading of assets as simple as one line of code. Images, Sounds, Sprite Sheets, Tilemaps, JSON data, XML and JavaScript files - all parsed and handled automatically, ready for use in game and stored in a global Cache for Sprites to share.
**Physics** **Physics**
Phaser ships with our Arcade Physics system. A SAT based collision and physics library perfect for low-powered devices and fast collision response. Control velocity, acceleration, bounce, damping and full collision and separation control. As of version 1.1.4 we now support rectangles, circles and polygon collision with full rotation. Phaser ships with our Arcade Physics system, Ninja Physics and P2.JS - a full body physics system. Arcade Physics is for high-speed AABB collision only. Ninja Physics allows for complex tiles and slopes, perfect for level scenery, and P2.JS is a full-body physics system, with constraints, springs, polygon support and more.
**Sprites** **Sprites**
@ -231,7 +348,7 @@ We use Phaser every day on our many client projects. As a result it's constantly
**Battle Tested** **Battle Tested**
Although Phaser 1.0 is a brand new release it is born from years of experience building some of the biggest mobile 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 <em>fast</em> and we stay on-top of the changing browser landscape. Phaser has been used to create hundreds of games, which receive millions of plays per month. We're not saying it is 100% bug free, but we use it for our client work every day, so issues get resolved <em>fast</em> and we stay on-top of the changing browser landscape.
![FruitParty](http://www.photonstorm.com/wp-content/uploads/2013/10/phaser_fruit_particles-640x480.png) ![FruitParty](http://www.photonstorm.com/wp-content/uploads/2013/10/phaser_fruit_particles-640x480.png)
@ -239,17 +356,6 @@ Although Phaser 1.0 is a brand new release it is born from years of experience b
Road Map Road Map
-------- --------
Here is what's on our road map for the coming months:
March 2014 will see Phaser 2.0 ("Aes Sedai") Released. The new features and fixes already implemented are vast, and include:
* Update to Pixi 1.5 - this newly released build has lots of internal changes and new features we want to take advantage of.
* Integration of the p2.js physics system and removal of the old ArcadePhysics. Full body dynamics are go!
* Better CocoonJS packaging features (screencanvas, audio checks, etc)
* Fixed width bitmap font support, plus enhanced Bitmap font rendering.
* Significantly optimised render and update loops. We're seeing significant fps improvements across the board.
* Literally hundreds of bug fixes across all core classes.
Beyond version 2.0 here are some of the features planned for the future: Beyond version 2.0 here are some of the features planned for the future:
Version 2.1 ("Shienar") Version 2.1 ("Shienar")
@ -274,6 +380,14 @@ Beyond version 2.2
* Look at HiDPI Canvas settings. * Look at HiDPI Canvas settings.
* Multiple Camera support. * Multiple Camera support.
* DragonBones support. * DragonBones support.
* Cache to localStorage using If-Modified-Since. [See github request](https://github.com/photonstorm/phaser/issues/495)
* Allow for complex assets like Bitmap Fonts to be stored within a texture atlas.
Nadion
------
[Nadion](https://github.com/jcd-as/nadion) is a set of powerful enhancements for Phaser that makes level building even easier. It includes features such as Trigger, Area, Alarms and Emitters, debug panels, state machines, parallax layer scrolling, 'developer mode' short-cuts and more.
Contributing Contributing

View file

@ -1,6 +1,6 @@
{ {
"name": "phaser", "name": "phaser",
"version": "1.1.6", "version": "2.0.0",
"homepage": "http://phaser.io", "homepage": "http://phaser.io",
"authors": [ "authors": [
"photonstorm <rich@photonstorm.com>" "photonstorm <rich@photonstorm.com>"

View file

@ -1,82 +0,0 @@
<?php
// NOTE: This script is deprecated. The build process is managed by grunt now.
// Keeping this file here for those that I know use it, but if you're trying to build fresh, use grunt.
date_default_timezone_set('Europe/London');
// Get the version number
// VERSION: '1.0.5',
$vf = file_get_contents(dirname(__FILE__) . '/../src/Phaser.js');
$version = substr($vf, strpos($vf, 'VERSION: ') + 10, 5);
$buildLog = "Building version $version \n\n";
$header = "";
$js = file(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.php');
$output = "";
for ($i = 0; $i < count($js); $i++)
{
// <script src="../src/Phaser.js"></script>
$line = trim($js[$i]);
if (strpos($line, '<script') !== false)
{
$line = str_replace('<script src="', '', $line);
$line = dirname(__FILE__) . DIRECTORY_SEPARATOR . str_replace('"></script>', '', $line);
$filename = substr($line, strrpos($line, '/') + 1);
$buildLog .= $line . "\n";
// echo $filename . "\n";
// Read the file in
if (file_exists($line))
{
$source = file_get_contents($line);
if ($filename == 'Intro.js')
{
// Built at: {buildDate}
$source = str_replace('{buildDate}', date('r'), $source);
// {version}
$source = str_replace('{version}', $version, $source);
// Set the header
$header = $source;
}
else
{
$output .= $source . "\n";
}
}
}
}
// Create a UMD wrapper, to allow Phaser to be exposed to AMD, Node and Browsers
$template = <<<EOT
%s(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.Phaser = factory();
}
}(this, function (b) {
%s
return Phaser;
}));
EOT;
file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'phaser.js', sprintf($template, $header, $output));
if(php_sapi_name() == 'cli' || empty($_SERVER['REMOTE_ADDR'])) {
echo "\ndone\n\n";
return;
}
?>
<a href="http://yui.2clics.net/">Minify it</a><br />
<textarea style="width: 800px; height: 800px">
<?php echo $buildLog; ?>
</textarea>

View file

@ -1,6 +1,4 @@
<?php <?php
// All JS files in build order.
// Much easier for debugging re: line numbers
if (!isset($path)) if (!isset($path))
{ {
$path = '..'; $path = '..';
@ -8,52 +6,58 @@
echo <<<EOL echo <<<EOL
<script src="$path/src/Intro.js"></script> <script src="$path/src/physics/p2/p2.js"></script>
<script src="$path/src/pixi/Pixi.js"></script>
<script src="$path/src/Phaser.js"></script>
<script src="$path/src/utils/Utils.js"></script>
<script src="$path/src/pixi/core/Matrix.js"></script> <script src="$path/src/pixi/Pixi.js"></script>
<script src="$path/src/pixi/core/Point.js"></script> <script src="$path/src/pixi/core/Point.js"></script>
<script src="$path/src/pixi/core/Rectangle.js"></script> <script src="$path/src/pixi/core/Rectangle.js"></script>
<script src="$path/src/pixi/core/Polygon.js"></script> <script src="$path/src/pixi/core/Polygon.js"></script>
<script src="$path/src/pixi/core/Circle.js"></script>
<script src="$path/src/pixi/core/Ellipse.js"></script>
<script src="$path/src/pixi/core/Matrix.js"></script>
<script src="$path/src/pixi/display/DisplayObject.js"></script> <script src="$path/src/pixi/display/DisplayObject.js"></script>
<script src="$path/src/pixi/display/DisplayObjectContainer.js"></script> <script src="$path/src/pixi/display/DisplayObjectContainer.js"></script>
<script src="$path/src/pixi/display/Sprite.js"></script> <script src="$path/src/pixi/display/Sprite.js"></script>
<script src="$path/src/pixi/display/Stage.js"></script> <script src="$path/src/pixi/display/SpriteBatch.js"></script>
<script src="$path/src/pixi/extras/CustomRenderable.js"></script>
<script src="$path/src/pixi/extras/Strip.js"></script>
<script src="$path/src/pixi/extras/Rope.js"></script>
<script src="$path/src/pixi/extras/TilingSprite.js"></script>
<script src="$path/src/pixi/filters/AbstractFilter.js"></script>
<script src="$path/src/pixi/filters/FilterBlock.js"></script> <script src="$path/src/pixi/filters/FilterBlock.js"></script>
<script src="$path/src/pixi/primitives/Graphics.js"></script>
<script src="$path/src/pixi/renderers/canvas/CanvasGraphics.js"></script>
<script src="$path/src/pixi/renderers/canvas/CanvasRenderer.js"></script>
<script src="$path/src/pixi/renderers/webgl/PixiShader.js"></script>
<script src="$path/src/pixi/renderers/webgl/PrimitiveShader.js"></script>
<script src="$path/src/pixi/renderers/webgl/StripShader.js"></script>
<script src="$path/src/pixi/renderers/webgl/WebGLBatch.js"></script>
<script src="$path/src/pixi/renderers/webgl/WebGLFilterManager.js"></script>
<script src="$path/src/pixi/renderers/webgl/WebGLGraphics.js"></script>
<script src="$path/src/pixi/renderers/webgl/WebGLRenderer.js"></script>
<script src="$path/src/pixi/renderers/webgl/WebGLRenderGroup.js"></script>
<script src="$path/src/pixi/renderers/webgl/WebGLShaders.js"></script>
<script src="$path/src/pixi/text/BitmapText.js"></script>
<script src="$path/src/pixi/text/Text.js"></script> <script src="$path/src/pixi/text/Text.js"></script>
<script src="$path/src/pixi/text/BitmapText.js"></script>
<script src="$path/src/pixi/textures/BaseTexture.js"></script> <script src="$path/src/pixi/display/Stage.js"></script>
<script src="$path/src/pixi/textures/Texture.js"></script> <script src="$path/src/pixi/utils/Utils.js"></script>
<script src="$path/src/pixi/utils/EventTarget.js"></script> <script src="$path/src/pixi/utils/EventTarget.js"></script>
<script src="$path/src/pixi/utils/Polyk.js"></script> <script src="$path/src/pixi/utils/Polyk.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/WebGLShaderUtils.js"></script>
<script src="$path/src/pixi/renderers/webgl/shaders/PixiShader.js"></script>
<script src="$path/src/pixi/renderers/webgl/shaders/PixiFastShader.js"></script>
<script src="$path/src/pixi/renderers/webgl/shaders/StripShader.js"></script>
<script src="$path/src/pixi/renderers/webgl/shaders/PrimitiveShader.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/WebGLGraphics.js"></script>
<script src="$path/src/pixi/renderers/webgl/WebGLRenderer.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/WebGLMaskManager.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/WebGLShaderManager.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/WebGLSpriteBatch.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/WebGLFilterManager.js"></script>
<script src="$path/src/pixi/renderers/webgl/utils/FilterTexture.js"></script>
<script src="$path/src/pixi/renderers/canvas/utils/CanvasMaskManager.js"></script>
<script src="$path/src/pixi/renderers/canvas/utils/CanvasTinter.js"></script>
<script src="$path/src/pixi/renderers/canvas/CanvasRenderer.js"></script>
<script src="$path/src/pixi/renderers/canvas/CanvasGraphics.js"></script>
<script src="$path/src/pixi/primitives/Graphics.js"></script>
<script src="$path/src/pixi/extras/TilingSprite.js"></script>
<script src="$path/src/pixi/textures/BaseTexture.js"></script>
<script src="$path/src/pixi/textures/Texture.js"></script>
<script src="$path/src/pixi/textures/RenderTexture.js"></script>
<script src="$path/src/Phaser.js"></script>
<script src="$path/src/utils/Utils.js"></script>
<script src="$path/src/geom/Circle.js"></script>
<script src="$path/src/geom/Point.js"></script>
<script src="$path/src/geom/Rectangle.js"></script>
<script src="$path/src/geom/Line.js"></script>
<script src="$path/src/geom/Ellipse.js"></script>
<script src="$path/src/geom/Polygon.js"></script>
<script src="$path/src/core/Camera.js"></script> <script src="$path/src/core/Camera.js"></script>
<script src="$path/src/core/State.js"></script> <script src="$path/src/core/State.js"></script>
@ -68,6 +72,7 @@
<script src="$path/src/core/Group.js"></script> <script src="$path/src/core/Group.js"></script>
<script src="$path/src/core/World.js"></script> <script src="$path/src/core/World.js"></script>
<script src="$path/src/core/Game.js"></script> <script src="$path/src/core/Game.js"></script>
<script src="$path/src/core/ScaleManager.js"></script>
<script src="$path/src/input/Input.js"></script> <script src="$path/src/input/Input.js"></script>
<script src="$path/src/input/Key.js"></script> <script src="$path/src/input/Key.js"></script>
@ -82,30 +87,28 @@
<script src="$path/src/input/InputHandler.js"></script> <script src="$path/src/input/InputHandler.js"></script>
<script src="$path/src/gameobjects/Events.js"></script> <script src="$path/src/gameobjects/Events.js"></script>
<script src="$path/src/gameobjects/GameObjectCreator.js"></script>
<script src="$path/src/gameobjects/GameObjectFactory.js"></script> <script src="$path/src/gameobjects/GameObjectFactory.js"></script>
<script src="$path/src/gameobjects/BitmapData.js"></script> <script src="$path/src/gameobjects/BitmapData.js"></script>
<script src="$path/src/gameobjects/Sprite.js"></script> <script src="$path/src/gameobjects/Sprite.js"></script>
<script src="$path/src/gameobjects/Image.js"></script>
<script src="$path/src/gameobjects/TileSprite.js"></script> <script src="$path/src/gameobjects/TileSprite.js"></script>
<script src="$path/src/gameobjects/Text.js"></script> <script src="$path/src/gameobjects/Text.js"></script>
<script src="$path/src/gameobjects/BitmapText.js"></script> <script src="$path/src/gameobjects/BitmapText.js"></script>
<script src="$path/src/gameobjects/Button.js"></script> <script src="$path/src/gameobjects/Button.js"></script>
<script src="$path/src/gameobjects/Graphics.js"></script> <script src="$path/src/gameobjects/Graphics.js"></script>
<script src="$path/src/gameobjects/RenderTexture.js"></script> <script src="$path/src/gameobjects/RenderTexture.js"></script>
<script src="$path/src/gameobjects/SpriteBatch.js"></script>
<script src="$path/src/gameobjects/RetroFont.js"></script>
<script src="$path/src/system/Canvas.js"></script> <script src="$path/src/system/Canvas.js"></script>
<script src="$path/src/system/StageScaleMode.js"></script>
<script src="$path/src/system/Device.js"></script> <script src="$path/src/system/Device.js"></script>
<script src="$path/src/system/RequestAnimationFrame.js"></script> <script src="$path/src/system/RequestAnimationFrame.js"></script>
<script src="$path/src/math/RandomDataGenerator.js"></script>
<script src="$path/src/math/Math.js"></script> <script src="$path/src/math/Math.js"></script>
<script src="$path/src/math/RandomDataGenerator.js"></script>
<script src="$path/src/math/QuadTree.js"></script> <script src="$path/src/math/QuadTree.js"></script>
<script src="$path/src/geom/Circle.js"></script>
<script src="$path/src/geom/Point.js"></script>
<script src="$path/src/geom/Rectangle.js"></script>
<script src="$path/src/geom/Line.js"></script>
<script src="$path/src/net/Net.js"></script> <script src="$path/src/net/Net.js"></script>
<script src="$path/src/tween/TweenManager.js"></script> <script src="$path/src/tween/TweenManager.js"></script>
@ -132,10 +135,32 @@
<script src="$path/src/utils/Debug.js"></script> <script src="$path/src/utils/Debug.js"></script>
<script src="$path/src/utils/Color.js"></script> <script src="$path/src/utils/Color.js"></script>
<script src="$path/src/physics/arcade/SAT.js"></script> <script src="$path/src/physics/Physics.js"></script>
<script src="$path/src/physics/arcade/ArcadePhysics.js"></script>
<script src="$path/src/physics/arcade/World.js"></script>
<script src="$path/src/physics/arcade/Body.js"></script> <script src="$path/src/physics/arcade/Body.js"></script>
<script src="$path/src/physics/ninja/World.js"></script>
<script src="$path/src/physics/ninja/Body.js"></script>
<script src="$path/src/physics/ninja/AABB.js"></script>
<script src="$path/src/physics/ninja/Tile.js"></script>
<script src="$path/src/physics/ninja/Circle.js"></script>
<script src="$path/src/physics/p2/World.js"></script>
<script src="$path/src/physics/p2/PointProxy.js"></script>
<script src="$path/src/physics/p2/InversePointProxy.js"></script>
<script src="$path/src/physics/p2/Body.js"></script>
<script src="$path/src/physics/p2/BodyDebug.js"></script>
<script src="$path/src/physics/p2/Spring.js"></script>
<script src="$path/src/physics/p2/Material.js"></script>
<script src="$path/src/physics/p2/ContactMaterial.js"></script>
<script src="$path/src/physics/p2/CollisionGroup.js"></script>
<script src="$path/src/physics/p2/DistanceConstraint.js"></script>
<script src="$path/src/physics/p2/GearConstraint.js"></script>
<script src="$path/src/physics/p2/LockConstraint.js"></script>
<script src="$path/src/physics/p2/PrismaticConstraint.js"></script>
<script src="$path/src/physics/p2/RevoluteConstraint.js"></script>
<script src="$path/src/particles/Particles.js"></script> <script src="$path/src/particles/Particles.js"></script>
<script src="$path/src/particles/arcade/ArcadeParticles.js"></script> <script src="$path/src/particles/arcade/ArcadeParticles.js"></script>
<script src="$path/src/particles/arcade/Emitter.js"></script> <script src="$path/src/particles/arcade/Emitter.js"></script>
@ -145,7 +170,10 @@
<script src="$path/src/tilemap/TilemapLayer.js"></script> <script src="$path/src/tilemap/TilemapLayer.js"></script>
<script src="$path/src/tilemap/TilemapParser.js"></script> <script src="$path/src/tilemap/TilemapParser.js"></script>
<script src="$path/src/tilemap/Tileset.js"></script> <script src="$path/src/tilemap/Tileset.js"></script>
<script src="$path/src/PixiPatch.js"></script>
EOL; EOL;
?>
/*
*/
?>

5570
build/custom/ninja.js Normal file

File diff suppressed because it is too large Load diff

3
build/custom/ninja.min.js vendored Normal file

File diff suppressed because one or more lines are too long

14907
build/custom/p2.js Normal file

File diff suppressed because it is too large Load diff

6
build/custom/p2.min.js vendored Normal file

File diff suppressed because one or more lines are too long

40955
build/custom/phaser-no-libs.js Normal file

File diff suppressed because it is too large Load diff

11
build/custom/phaser-no-libs.min.js vendored Normal file

File diff suppressed because one or more lines are too long

9567
build/custom/pixi.js Normal file

File diff suppressed because it is too large Load diff

4
build/custom/pixi.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1899
build/phaser.d.ts vendored

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

1
build/phaser.map Normal file

File diff suppressed because one or more lines are too long

35
build/phaser.min.js vendored

File diff suppressed because one or more lines are too long

1581
docs/AABB.js.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -447,9 +525,9 @@
* @param {Phaser.FrameData} frameData - The FrameData object that contains all frames used by this Animation. * @param {Phaser.FrameData} frameData - The FrameData object that contains all frames used by this Animation.
* @param {(Array.&lt;number>|Array.&lt;string>)} frames - An array of numbers or strings indicating which frames to play in which order. * @param {(Array.&lt;number>|Array.&lt;string>)} frames - An array of numbers or strings indicating which frames to play in which order.
* @param {number} delay - The time between each frame of the animation, given in ms. * @param {number} delay - The time between each frame of the animation, given in ms.
* @param {boolean} looped - Should this animation loop or play through once. * @param {boolean} loop - Should this animation loop when it reaches the end or play through once.
*/ */
Phaser.Animation = function (game, parent, name, frameData, frames, delay, looped) { Phaser.Animation = function (game, parent, name, frameData, frames, delay, loop) {
/** /**
* @property {Phaser.Game} game - A reference to the currently running Game. * @property {Phaser.Game} game - A reference to the currently running Game.
@ -486,9 +564,14 @@ Phaser.Animation = function (game, parent, name, frameData, frames, delay, loope
this.delay = 1000 / delay; this.delay = 1000 / delay;
/** /**
* @property {boolean} looped - The loop state of the Animation. * @property {boolean} loop - The loop state of the Animation.
*/ */
this.looped = looped; this.loop = loop;
/**
* @property {number} loopCount - The number of times the animation has looped since it was last started.
*/
this.loopCount = 0;
/** /**
* @property {boolean} killOnComplete - Should the parent of this Animation be killed when the animation completes? * @property {boolean} killOnComplete - Should the parent of this Animation be killed when the animation completes?
@ -546,6 +629,25 @@ Phaser.Animation = function (game, parent, name, frameData, frames, delay, loope
* @property {Phaser.Frame} currentFrame - The currently displayed frame of the Animation. * @property {Phaser.Frame} currentFrame - The currently displayed frame of the Animation.
*/ */
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]); this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
/**
* @property {Phaser.Signal} onStart - This event is dispatched when this Animation starts playback.
*/
this.onStart = new Phaser.Signal();
/**
* @property {Phaser.Signal} onComplete - This event is dispatched when this Animation completes playback. If the animation is set to loop this is never fired, listen for onAnimationLoop instead.
*/
this.onComplete = new Phaser.Signal();
/**
* @property {Phaser.Signal} onLoop - This event is dispatched when this Animation loops.
*/
this.onLoop = new Phaser.Signal();
// Set-up some event listeners
this.game.onPause.add(this.onPause, this);
this.game.onResume.add(this.onResume, this);
}; };
@ -572,7 +674,7 @@ Phaser.Animation.prototype = {
if (typeof loop === 'boolean') if (typeof loop === 'boolean')
{ {
// If they set a new loop value then use it, otherwise use the one set on creation // If they set a new loop value then use it, otherwise use the one set on creation
this.looped = loop; this.loop = loop;
} }
if (typeof killOnComplete !== 'undefined') if (typeof killOnComplete !== 'undefined')
@ -584,6 +686,7 @@ Phaser.Animation.prototype = {
this.isPlaying = true; this.isPlaying = true;
this.isFinished = false; this.isFinished = false;
this.paused = false; this.paused = false;
this.loopCount = 0;
this._timeLastFrame = this.game.time.now; this._timeLastFrame = this.game.time.now;
this._timeNextFrame = this.game.time.now + this.delay; this._timeNextFrame = this.game.time.now + this.delay;
@ -593,11 +696,16 @@ Phaser.Animation.prototype = {
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]); this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
if (this._parent.events) // TODO: Double check if required
if (this._parent.__tilePattern)
{ {
this._parent.events.onAnimationStart.dispatch(this._parent, this); this._parent.__tilePattern = false;
this._parent.tilingTexture = false;
} }
this._parent.events.onAnimationStart.dispatch(this._parent, this);
this.onStart.dispatch(this._parent, this);
return this; return this;
}, },
@ -613,6 +721,7 @@ Phaser.Animation.prototype = {
this.isPlaying = true; this.isPlaying = true;
this.isFinished = false; this.isFinished = false;
this.paused = false; this.paused = false;
this.loopCount = 0;
this._timeLastFrame = this.game.time.now; this._timeLastFrame = this.game.time.now;
this._timeNextFrame = this.game.time.now + this.delay; this._timeNextFrame = this.game.time.now + this.delay;
@ -621,18 +730,23 @@ Phaser.Animation.prototype = {
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]); this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
this.onStart.dispatch(this._parent, this);
}, },
/** /**
* Stops playback of this animation and set it to a finished state. If a resetFrame is provided it will stop playback and set frame to the first in the animation. * Stops playback of this animation and set it to a finished state. If a resetFrame is provided it will stop playback and set frame to the first in the animation.
* If `dispatchComplete` is true it will dispatch the complete events, otherwise they'll be ignored.
* *
* @method Phaser.Animation#stop * @method Phaser.Animation#stop
* @memberof Phaser.Animation * @memberof Phaser.Animation
* @param {boolean} [resetFrame=false] - If true after the animation stops the currentFrame value will be set to the first frame in this animation. * @param {boolean} [resetFrame=false] - If true after the animation stops the currentFrame value will be set to the first frame in this animation.
* @param {boolean} [dispatchComplete=false] - Dispatch the Animation.onComplete and parent.onAnimationComplete events?
*/ */
stop: function (resetFrame) { stop: function (resetFrame, dispatchComplete) {
if (typeof resetFrame === 'undefined') { resetFrame = false; } if (typeof resetFrame === 'undefined') { resetFrame = false; }
if (typeof dispatchComplete === 'undefined') { dispatchComplete = false; }
this.isPlaying = false; this.isPlaying = false;
this.isFinished = true; this.isFinished = true;
@ -643,6 +757,42 @@ Phaser.Animation.prototype = {
this.currentFrame = this._frameData.getFrame(this._frames[0]); this.currentFrame = this._frameData.getFrame(this._frames[0]);
} }
if (dispatchComplete)
{
this._parent.events.onAnimationComplete.dispatch(this._parent, this);
this.onComplete.dispatch(this._parent, this);
}
},
/**
* Called when the Game enters a paused state.
*
* @method Phaser.Animation#onPause
* @memberof Phaser.Animation
*/
onPause: function () {
if (this.isPlaying)
{
this._frameDiff = this._timeNextFrame - this.game.time.now;
}
},
/**
* Called when the Game resumes from a paused state.
*
* @method Phaser.Animation#onResume
* @memberof Phaser.Animation
*/
onResume: function () {
if (this.isPlaying)
{
this._timeNextFrame = this.game.time.now + this._frameDiff;
}
}, },
/** /**
@ -682,7 +832,7 @@ Phaser.Animation.prototype = {
if (this._frameIndex >= this._frames.length) if (this._frameIndex >= this._frames.length)
{ {
if (this.looped) if (this.loop)
{ {
this._frameIndex %= this._frames.length; this._frameIndex %= this._frames.length;
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]); this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
@ -690,13 +840,21 @@ Phaser.Animation.prototype = {
if (this.currentFrame) if (this.currentFrame)
{ {
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
if (this._parent.__tilePattern)
{
this._parent.__tilePattern = false;
this._parent.tilingTexture = false;
}
} }
this.loopCount++;
this._parent.events.onAnimationLoop.dispatch(this._parent, this); this._parent.events.onAnimationLoop.dispatch(this._parent, this);
this.onLoop.dispatch(this._parent, this);
} }
else else
{ {
this.onComplete(); this.complete();
} }
} }
else else
@ -706,6 +864,12 @@ Phaser.Animation.prototype = {
if (this.currentFrame) if (this.currentFrame)
{ {
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
if (this._parent.__tilePattern)
{
this._parent.__tilePattern = false;
this._parent.tilingTexture = false;
}
} }
} }
@ -731,24 +895,31 @@ Phaser.Animation.prototype = {
this.currentFrame = null; this.currentFrame = null;
this.isPlaying = false; this.isPlaying = false;
this.onStart.destroy();
this.onLoop.destroy();
this.onComplete.destroy();
this.game.onPause.remove(this.onPause, this);
this.game.onResume.remove(this.onResume, this);
}, },
/** /**
* Called internally when the animation finishes playback. Sets the isPlaying and isFinished states and dispatches the onAnimationComplete event if it exists on the parent. * Called internally when the animation finishes playback.
* Sets the isPlaying and isFinished states and dispatches the onAnimationComplete event if it exists on the parent and local onComplete event.
* *
* @method Phaser.Animation#onComplete * @method Phaser.Animation#complete
* @memberof Phaser.Animation * @memberof Phaser.Animation
*/ */
onComplete: function () { complete: function () {
this.isPlaying = false; this.isPlaying = false;
this.isFinished = true; this.isFinished = true;
this.paused = false; this.paused = false;
if (this._parent.events) this._parent.events.onAnimationComplete.dispatch(this._parent, this);
{
this._parent.events.onAnimationComplete.dispatch(this._parent, this); this.onComplete.dispatch(this._parent, this);
}
if (this.killOnComplete) if (this.killOnComplete)
{ {
@ -829,7 +1000,7 @@ Object.defineProperty(Phaser.Animation.prototype, 'frame', {
set: function (value) { set: function (value) {
this.currentFrame = this._frameData.getFrame(value); this.currentFrame = this._frameData.getFrame(this._frames[value]);
if (this.currentFrame !== null) if (this.currentFrame !== null)
{ {
@ -841,6 +1012,29 @@ Object.defineProperty(Phaser.Animation.prototype, 'frame', {
}); });
/**
* @name Phaser.Animation#speed
* @property {number} speed - Gets or sets the current speed of the animation, the time between each frame of the animation, given in ms. Takes effect from the NEXT frame. Minimum value is 1.
*/
Object.defineProperty(Phaser.Animation.prototype, 'speed', {
get: function () {
return Math.round(1000 / this.delay);
},
set: function (value) {
if (value >= 1)
{
this.delay = 1000 / value;
}
}
});
/** /**
* Really handy function for when you are creating arrays of animation data but it's using frame names and not numbers. * Really handy function for when you are creating arrays of animation data but it's using frame names and not numbers.
* For example imagine you've got 30 frames named: 'explosion_0001-large' to 'explosion_0030-large' * For example imagine you've got 30 frames named: 'explosion_0001-large' to 'explosion_0030-large'
@ -923,7 +1117,7 @@ Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zer
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -950,6 +1144,9 @@ Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zer
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -532,6 +610,7 @@ Phaser.AnimationManager.prototype = {
return; return;
} }
frames = frames || [];
frameRate = frameRate || 60; frameRate = frameRate || 60;
if (typeof loop === 'undefined') { loop = false; } if (typeof loop === 'undefined') { loop = false; }
@ -566,6 +645,12 @@ Phaser.AnimationManager.prototype = {
this.currentFrame = this.currentAnim.currentFrame; this.currentFrame = this.currentAnim.currentFrame;
this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
if (this.sprite.__tilePattern)
{
this.__tilePattern = false;
this.tilingTexture = false;
}
return this._anims[name]; return this._anims[name];
}, },
@ -676,7 +761,7 @@ Phaser.AnimationManager.prototype = {
*/ */
update: function () { update: function () {
if (this.updateIfVisible && this.sprite.visible === false) if (this.updateIfVisible && !this.sprite.visible)
{ {
return false; return false;
} }
@ -684,7 +769,6 @@ Phaser.AnimationManager.prototype = {
if (this.currentAnim && this.currentAnim.update() === true) if (this.currentAnim && this.currentAnim.update() === true)
{ {
this.currentFrame = this.currentAnim.currentFrame; this.currentFrame = this.currentAnim.currentFrame;
this.sprite.currentFrame = this.currentFrame;
return true; return true;
} }
@ -701,7 +785,7 @@ Phaser.AnimationManager.prototype = {
*/ */
getAnimation: function (name) { getAnimation: function (name) {
if (typeof name == 'string') if (typeof name === 'string')
{ {
if (this._anims[name]) if (this._anims[name])
{ {
@ -720,9 +804,14 @@ Phaser.AnimationManager.prototype = {
*/ */
refreshFrame: function () { refreshFrame: function () {
this.sprite.currentFrame = this.currentFrame;
this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
if (this.sprite.__tilePattern)
{
this.__tilePattern = false;
this.tilingTexture = false;
}
}, },
/** /**
@ -818,9 +907,18 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', {
if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null) if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null)
{ {
this.currentFrame = this._frameData.getFrame(value); this.currentFrame = this._frameData.getFrame(value);
this._frameIndex = value;
this.sprite.currentFrame = this.currentFrame; if (this.currentFrame)
this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); {
this._frameIndex = value;
this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
if (this.sprite.__tilePattern)
{
this.__tilePattern = false;
this.tilingTexture = false;
}
}
} }
} }
@ -847,9 +945,18 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', {
if (typeof value === 'string' && this._frameData && this._frameData.getFrameByName(value) !== null) if (typeof value === 'string' && this._frameData && this._frameData.getFrameByName(value) !== null)
{ {
this.currentFrame = this._frameData.getFrameByName(value); this.currentFrame = this._frameData.getFrameByName(value);
this._frameIndex = this.currentFrame.index;
this.sprite.currentFrame = this.currentFrame; if (this.currentFrame)
this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); {
this._frameIndex = this.currentFrame.index;
this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
if (this.sprite.__tilePattern)
{
this.__tilePattern = false;
this.tilingTexture = false;
}
}
} }
else else
{ {
@ -879,7 +986,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -906,6 +1013,9 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -478,8 +556,8 @@ Phaser.AnimationParser = {
frameHeight = Math.floor(-height / Math.min(-1, frameHeight)); frameHeight = Math.floor(-height / Math.min(-1, frameHeight));
} }
var row = Math.round(width / frameWidth); var row = Math.floor((width - margin) / (frameWidth + spacing));
var column = Math.round(height / frameHeight); var column = Math.floor((height - margin) / (frameHeight + spacing));
var total = row * column; var total = row * column;
if (frameMax !== -1) if (frameMax !== -1)
@ -514,7 +592,7 @@ Phaser.AnimationParser = {
x += frameWidth + spacing; x += frameWidth + spacing;
if (x === width) if (x + frameWidth > width)
{ {
x = margin; x = margin;
y += frameHeight + spacing; y += frameHeight + spacing;
@ -584,12 +662,9 @@ Phaser.AnimationParser = {
frames[i].spriteSourceSize.h frames[i].spriteSourceSize.h
); );
// We had to hack Pixi to get this to work :( PIXI.TextureCache[uuid].trim = new Phaser.Rectangle(frames[i].spriteSourceSize.x, frames[i].spriteSourceSize.y, frames[i].sourceSize.w, frames[i].sourceSize.h);
PIXI.TextureCache[uuid].trimmed = true;
PIXI.TextureCache[uuid].trim.x = frames[i].spriteSourceSize.x;
PIXI.TextureCache[uuid].trim.y = frames[i].spriteSourceSize.y;
} }
} }
return data; return data;
@ -656,11 +731,7 @@ Phaser.AnimationParser = {
frames[key].spriteSourceSize.h frames[key].spriteSourceSize.h
); );
// We had to hack Pixi to get this to work :( PIXI.TextureCache[uuid].trim = new Phaser.Rectangle(frames[key].spriteSourceSize.x, frames[key].spriteSourceSize.y, frames[key].sourceSize.w, frames[key].sourceSize.h);
PIXI.TextureCache[uuid].trimmed = true;
PIXI.TextureCache[uuid].trim.x = frames[key].spriteSourceSize.x;
PIXI.TextureCache[uuid].trim.y = frames[key].spriteSourceSize.y;
} }
i++; i++;
@ -742,12 +813,7 @@ Phaser.AnimationParser = {
{ {
newFrame.setTrim(true, width, height, frameX, frameY, frameWidth, frameHeight); newFrame.setTrim(true, width, height, frameX, frameY, frameWidth, frameHeight);
PIXI.TextureCache[uuid].realSize = { x: frameX, y: frameY, w: frameWidth, h: frameHeight }; PIXI.TextureCache[uuid].trim = new Phaser.Rectangle(frameX, frameY, width, height);
// We had to hack Pixi to get this to work :(
PIXI.TextureCache[uuid].trimmed = true;
PIXI.TextureCache[uuid].trim.x = frameX;
PIXI.TextureCache[uuid].trim.y = frameY;
} }
} }
@ -777,7 +843,7 @@ Phaser.AnimationParser = {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -804,6 +870,9 @@ Phaser.AnimationParser = {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -443,22 +521,24 @@
* @classdesc BitmapText objects work by taking a texture file and an XML file that describes the font layout. * @classdesc BitmapText objects work by taking a texture file and an XML file that describes the font layout.
* *
* On Windows you can use the free app BMFont: http://www.angelcode.com/products/bmfont/ * On Windows you can use the free app BMFont: http://www.angelcode.com/products/bmfont/
*
* On OS X we recommend Glyph Designer: http://www.71squared.com/en/glyphdesigner * On OS X we recommend Glyph Designer: http://www.71squared.com/en/glyphdesigner
* For Web there is the great Littera: http://kvazars.com/littera/
* *
* @constructor * @constructor
* @param {Phaser.Game} game - A reference to the currently running game. * @param {Phaser.Game} game - A reference to the currently running game.
* @param {number} x - X position of the new bitmapText object. * @param {number} x - X position of the new bitmapText object.
* @param {number} y - Y position of the new bitmapText object. * @param {number} y - Y position of the new bitmapText object.
* @param {string} text - The actual text that will be written. * @param {string} font - The key of the BitmapFont as stored in Game.Cache.
* @param {object} style - The style object containing style attributes like font, font size , etc. * @param {string} [text=''] - The actual text that will be rendered. Can be set later via BitmapText.text.
* @param {number} [size=32] - The size the font will be rendered in, in pixels.
*/ */
Phaser.BitmapText = function (game, x, y, text, style) { Phaser.BitmapText = function (game, x, y, font, text, size) {
x = x || 0; x = x || 0;
y = y || 0; y = y || 0;
font = font || '';
text = text || ''; text = text || '';
style = style || ''; size = size || 32;
/** /**
* @property {Phaser.Game} game - A reference to the currently running Game. * @property {Phaser.Game} game - A reference to the currently running Game.
@ -471,17 +551,6 @@ Phaser.BitmapText = function (game, x, y, text, style) {
*/ */
this.exists = true; this.exists = true;
/**
* @property {boolean} alive - This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering.
* @default
*/
this.alive = true;
/**
* @property {Phaser.Group} group - The parent Group of this BitmapText.
*/
this.group = null;
/** /**
* @property {string} name - The user defined name given to this BitmapText. * @property {string} name - The user defined name given to this BitmapText.
* @default * @default
@ -494,62 +563,79 @@ Phaser.BitmapText = function (game, x, y, text, style) {
*/ */
this.type = Phaser.BITMAPTEXT; this.type = Phaser.BITMAPTEXT;
PIXI.BitmapText.call(this, text, style); /**
* @property {number} z - The z-depth value of this object within its Group (remember the World is a Group as well). No two objects in a Group can have the same z value.
*/
this.z = 0;
/** /**
* @property {number} position.x - The x position of this object. * @property {Phaser.Point} world - The world coordinates of this Sprite. This differs from the x/y coordinates which are relative to the Sprites container.
*/ */
this.position.x = x; this.world = new Phaser.Point(x, y);
/**
* @property {number} position.y - The y position of this object.
*/
this.position.y = y;
/** /**
* The anchor sets the origin point of the texture. * @property {string} _text - Internal cache var.
* The default is 0,0 this means the textures origin is the top left
* Setting than anchor to 0.5,0.5 means the textures origin is centered
* Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
*
* @property {Phaser.Point} anchor - The anchor around which rotation and scaling takes place.
*/
this.anchor = new Phaser.Point();
/**
* @property {Phaser.Point} scale - The scale of the object when rendered. By default it's set to 1 (no scale). You can modify it via scale.x or scale.y or scale.setTo(x, y). A value of 1 means no change to the scale, 0.5 means "half the size", 2 means "twice the size", etc.
*/
this.scale = new Phaser.Point(1, 1);
/**
* @property {object} _cache - A mini cache for storing all of the calculated values.
* @private * @private
*/ */
this._cache = { this._text = text;
dirty: false, /**
* @property {string} _font - Internal cache var.
* @private
*/
this._font = font;
// Transform cache /**
a00: 1, * @property {number} _fontSize - Internal cache var.
a01: 0, * @private
a02: x, */
a10: 0, this._fontSize = size;
a11: 1,
a12: y,
id: 1,
// The previous calculated position /**
x: -1, * @property {string} _align - Internal cache var.
y: -1, * @private
*/
this._align = 'left';
// The actual scale values based on the worldTransform /**
scaleX: 1, * @property {number} _tint - Internal cache var.
scaleY: 1 * @private
*/
this._tint = 0xFFFFFF;
}; /**
* @property {Phaser.Events} events - The Events you can subscribe to that are dispatched when certain things happen on this Sprite or its components.
*/
this.events = new Phaser.Events(this);
this._cache.x = this.x; /**
this._cache.y = this.y; * @property {Phaser.InputHandler|null} input - The Input Handler for this object. Needs to be enabled with image.inputEnabled = true before you can use it.
*/
this.input = null;
/**
* @property {Phaser.Point} cameraOffset - If this object is fixedToCamera then this stores the x/y offset that its drawn at, from the top-left of the camera view.
*/
this.cameraOffset = new Phaser.Point();
PIXI.BitmapText.call(this, text);
this.position.set(x, y);
/**
* A small internal cache:
* 0 = previous position.x
* 1 = previous position.y
* 2 = previous rotation
* 3 = renderID
* 4 = fresh? (0 = no, 1 = yes)
* 5 = outOfBoundsFired (0 = no, 1 = yes)
* 6 = exists (0 = no, 1 = yes)
* 7 = fixed to camera (0 = no, 1 = yes)
* @property {Int16Array} _cache
* @private
*/
this._cache = new Int16Array([0, 0, 0, 0, 1, 0, 1, 0]);
}; };
@ -557,61 +643,177 @@ Phaser.BitmapText.prototype = Object.create(PIXI.BitmapText.prototype);
Phaser.BitmapText.prototype.constructor = Phaser.BitmapText; Phaser.BitmapText.prototype.constructor = Phaser.BitmapText;
/** /**
* Automatically called by World.update * @method Phaser.BitmapText.prototype.setStyle
* @private
*/
Phaser.BitmapText.prototype.setStyle = function() {
this.style = { align: this._align };
this.fontName = this._font;
this.fontSize = this._fontSize;
this.dirty = true;
};
/**
* Automatically called by World.preUpdate.
* @method Phaser.BitmapText.prototype.preUpdate
*/
Phaser.BitmapText.prototype.preUpdate = function () {
this._cache[0] = this.world.x;
this._cache[1] = this.world.y;
this._cache[2] = this.rotation;
if (!this.exists || !this.parent.exists)
{
this.renderOrderID = -1;
return false;
}
if (this.autoCull)
{
// Won't get rendered but will still get its transform updated
this.renderable = this.game.world.camera.screenView.intersects(this.getBounds());
}
this.world.setTo(this.game.camera.x + this.worldTransform[2], this.game.camera.y + this.worldTransform[5]);
if (this.visible)
{
this._cache[3] = this.game.stage.currentRenderOrderID++;
}
return true;
}
/**
* Override and use this function in your own custom objects to handle any update requirements you may have.
*
* @method Phaser.BitmapText.prototype.update * @method Phaser.BitmapText.prototype.update
*/ */
Phaser.BitmapText.prototype.update = function() { Phaser.BitmapText.prototype.update = function() {
if (!this.exists) }
/**
* Automatically called by World.postUpdate.
* @method Phaser.BitmapText.prototype.postUpdate
*/
Phaser.BitmapText.prototype.postUpdate = function () {
// Fixed to Camera?
if (this._cache[7] === 1)
{ {
return; this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
} }
this._cache.dirty = false;
this._cache.x = this.x;
this._cache.y = this.y;
if (this.position.x != this._cache.x || this.position.y != this._cache.y)
{
this.position.x = this._cache.x;
this.position.y = this._cache.y;
this._cache.dirty = true;
}
this.pivot.x = this.anchor.x * this.width;
this.pivot.y = this.anchor.y * this.height;
} }
/** /**
* Destroy this BitmapText instance. This will remove any filters and un-parent any children.
* @method Phaser.BitmapText.prototype.destroy * @method Phaser.BitmapText.prototype.destroy
* @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called?
*/ */
Phaser.BitmapText.prototype.destroy = function() { Phaser.BitmapText.prototype.destroy = function(destroyChildren) {
if (this.group) if (this.game === null) { return; }
if (typeof destroyChildren === 'undefined') { destroyChildren = true; }
if (this.parent)
{ {
this.group.remove(this); if (this.parent instanceof Phaser.Group)
{
this.parent.remove(this);
}
else
{
this.parent.removeChild(this);
}
} }
if (this.canvas && this.canvas.parentNode) var i = this.children.length;
if (destroyChildren)
{ {
this.canvas.parentNode.removeChild(this.canvas); while (i--)
{
if (this.children[i].destroy)
{
this.children[i].destroy(destroyChildren);
}
else
{
this.removeChild(this.children[i]);
}
}
} }
else else
{ {
this.canvas = null; while (i--)
this.context = null; {
this.removeChild(this.children[i]);
}
} }
this.exists = false; this.exists = false;
this.visible = false;
this.group = null; this.filters = null;
this.mask = null;
this.game = null;
} }
/** /**
* Indicates the rotation of the BitmapText, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * @name Phaser.BitmapText#align
* @property {string} align - Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text.
*/
Object.defineProperty(Phaser.BitmapText.prototype, 'align', {
get: function() {
return this._align;
},
set: function(value) {
if (value !== this._align)
{
this._align = value;
this.setStyle();
}
}
});
/**
* @name Phaser.BitmapText#tint
* @property {number} tint - The tint applied to the BitmapText. This is a hex value. Set to white to disable (0xFFFFFF)
*/
Object.defineProperty(Phaser.BitmapText.prototype, 'tint', {
get: function() {
return this._tint;
},
set: function(value) {
if (value !== this._tint)
{
this._tint = value;
this.dirty = true;
}
}
});
/**
* Indicates the rotation of the Text, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
* Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90.
* If you wish to work in radians instead of degrees use the property Sprite.rotation instead. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead.
* @name Phaser.BitmapText#angle * @name Phaser.BitmapText#angle
@ -630,35 +832,139 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'angle', {
}); });
/** /**
* The x coordinate of this object in world space. * @name Phaser.BitmapText#font
* @name Phaser.BitmapText#x * @property {string} font - The font the text will be rendered in, i.e. 'Arial'. Must be loaded in the browser before use.
* @property {number} x - The x coordinate of this object in world space.
*/ */
Object.defineProperty(Phaser.BitmapText.prototype, 'x', { Object.defineProperty(Phaser.BitmapText.prototype, 'font', {
get: function() { get: function() {
return this.position.x; return this._font;
}, },
set: function(value) { set: function(value) {
this.position.x = value;
if (value !== this._font)
{
this._font = value.trim();
this.style.font = this._fontSize + "px '" + this._font + "'";
this.dirty = true;
}
} }
}); });
/** /**
* The y coordinate of this object in world space. * @name Phaser.BitmapText#fontSize
* @name Phaser.BitmapText#y * @property {number} fontSize - The size of the font in pixels.
* @property {number} y - The y coordinate of this object in world space.
*/ */
Object.defineProperty(Phaser.BitmapText.prototype, 'y', { Object.defineProperty(Phaser.BitmapText.prototype, 'fontSize', {
get: function() { get: function() {
return this.position.y; return this._fontSize;
}, },
set: function(value) { set: function(value) {
this.position.y = value;
value = parseInt(value, 10);
if (value !== this._fontSize)
{
this._fontSize = value;
this.style.font = this._fontSize + "px '" + this._font + "'";
this.dirty = true;
}
}
});
/**
* The text string to be displayed by this Text object, taking into account the style settings.
* @name Phaser.BitmapText#text
* @property {string} text - The text string to be displayed by this Text object, taking into account the style settings.
*/
Object.defineProperty(Phaser.BitmapText.prototype, 'text', {
get: function() {
return this._text;
},
set: function(value) {
if (value !== this._text)
{
this._text = value.toString() || ' ';
this.dirty = true;
}
}
});
/**
* By default a Text object won't process any input events at all. By setting inputEnabled to true the Phaser.InputHandler is
* activated for this object and it will then start to process click/touch events and more.
*
* @name Phaser.BitmapText#inputEnabled
* @property {boolean} inputEnabled - Set to true to allow this object to receive input events.
*/
Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", {
get: function () {
return (this.input && this.input.enabled);
},
set: function (value) {
if (value)
{
if (this.input === null)
{
this.input = new Phaser.InputHandler(this);
this.input.start();
}
}
else
{
if (this.input && this.input.enabled)
{
this.input.stop();
}
}
}
});
/**
* An BitmapText that is fixed to the camera uses its x/y coordinates as offsets from the top left of the camera. These are stored in BitmapText.cameraOffset.
* Note that the cameraOffset values are in addition to any parent in the display list.
* So if this BitmapText was in a Group that has x: 200, then this will be added to the cameraOffset.x
*
* @name Phaser.BitmapText#fixedToCamera
* @property {boolean} fixedToCamera - Set to true to fix this BitmapText to the Camera at its current world coordinates.
*/
Object.defineProperty(Phaser.BitmapText.prototype, "fixedToCamera", {
get: function () {
return !!this._cache[7];
},
set: function (value) {
if (value)
{
this._cache[7] = 1;
this.cameraOffset.set(this.x, this.y);
}
else
{
this._cache[7] = 0;
}
} }
}); });
@ -683,7 +989,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'y', {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -710,6 +1016,9 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'y', {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

File diff suppressed because it is too large Load diff

1107
docs/Body.js_.html Normal file

File diff suppressed because it is too large Load diff

2244
docs/Body.js__.html Normal file

File diff suppressed because it is too large Load diff

1000
docs/BodyDebug.js.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -448,6 +526,7 @@
* You can set a unique texture frame and Sound for any of these states. * You can set a unique texture frame and Sound for any of these states.
* *
* @constructor * @constructor
* @extends Phaser.Image
* *
* @param {Phaser.Game} game Current game instance. * @param {Phaser.Game} game Current game instance.
* @param {number} [x=0] - X position of the Button. * @param {number} [x=0] - X position of the Button.
@ -468,7 +547,7 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
callback = callback || null; callback = callback || null;
callbackContext = callbackContext || this; callbackContext = callbackContext || this;
Phaser.Sprite.call(this, game, x, y, key, outFrame); Phaser.Image.call(this, game, x, y, key, outFrame);
/** /**
* @property {number} type - The Phaser Object Type. * @property {number} type - The Phaser Object Type.
@ -611,6 +690,10 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
*/ */
this.forceOut = false; this.forceOut = false;
this.inputEnabled = true;
this.input.start(0, true);
this.setFrames(overFrame, outFrame, downFrame, upFrame); this.setFrames(overFrame, outFrame, downFrame, upFrame);
if (callback !== null) if (callback !== null)
@ -618,8 +701,6 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
this.onInputUp.add(callback, callbackContext); this.onInputUp.add(callback, callbackContext);
} }
this.input.start(0, true);
// Redirect the input events to here so we can handle animation updates, etc // Redirect the input events to here so we can handle animation updates, etc
this.events.onInputOver.add(this.onInputOverHandler, this); this.events.onInputOver.add(this.onInputOverHandler, this);
this.events.onInputOut.add(this.onInputOutHandler, this); this.events.onInputOut.add(this.onInputOutHandler, this);
@ -628,8 +709,7 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
}; };
Phaser.Button.prototype = Object.create(Phaser.Sprite.prototype); Phaser.Button.prototype = Object.create(Phaser.Image.prototype);
Phaser.Button.prototype = Phaser.Utils.extend(true, Phaser.Button.prototype, Phaser.Sprite.prototype, PIXI.Sprite.prototype);
Phaser.Button.prototype.constructor = Phaser.Button; Phaser.Button.prototype.constructor = Phaser.Button;
/** /**
@ -1085,7 +1165,7 @@ Phaser.Button.prototype.setState = function (newState) {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1112,6 +1192,9 @@ Phaser.Button.prototype.setState = function (newState) {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -480,6 +558,18 @@ Phaser.Cache = function (game) {
*/ */
this._text = {}; this._text = {};
/**
* @property {object} _text - Text key-value container.
* @private
*/
this._json = {};
/**
* @property {object} _physics - Physics data key-value container.
* @private
*/
this._physics = {};
/** /**
* @property {object} _tilemaps - Tilemap key-value container. * @property {object} _tilemaps - Tilemap key-value container.
* @private * @private
@ -498,6 +588,12 @@ Phaser.Cache = function (game) {
*/ */
this._bitmapDatas = {}; this._bitmapDatas = {};
/**
* @property {object} _bitmapFont - BitmapFont key-value container.
* @private
*/
this._bitmapFont = {};
this.addDefaultImage(); this.addDefaultImage();
this.addMissingImage(); this.addMissingImage();
@ -508,10 +604,77 @@ Phaser.Cache = function (game) {
}; };
/**
* @constant
* @type {number}
*/
Phaser.Cache.CANVAS = 1;
/**
* @constant
* @type {number}
*/
Phaser.Cache.IMAGE = 2;
/**
* @constant
* @type {number}
*/
Phaser.Cache.TEXTURE = 3;
/**
* @constant
* @type {number}
*/
Phaser.Cache.SOUND = 4;
/**
* @constant
* @type {number}
*/
Phaser.Cache.TEXT = 5;
/**
* @constant
* @type {number}
*/
Phaser.Cache.PHYSICS = 6;
/**
* @constant
* @type {number}
*/
Phaser.Cache.TILEMAP = 7;
/**
* @constant
* @type {number}
*/
Phaser.Cache.BINARY = 8;
/**
* @constant
* @type {number}
*/
Phaser.Cache.BITMAPDATA = 9;
/**
* @constant
* @type {number}
*/
Phaser.Cache.BITMAPFONT = 10;
/**
* @constant
* @type {number}
*/
Phaser.Cache.JSON = 11;
Phaser.Cache.prototype = { Phaser.Cache.prototype = {
/** /**
* Add a new canvas object in to the cache. * Add a new canvas object in to the cache.
*
* @method Phaser.Cache#addCanvas * @method Phaser.Cache#addCanvas
* @param {string} key - Asset key for this canvas. * @param {string} key - Asset key for this canvas.
* @param {HTMLCanvasElement} canvas - Canvas DOM element. * @param {HTMLCanvasElement} canvas - Canvas DOM element.
@ -525,6 +688,7 @@ Phaser.Cache.prototype = {
/** /**
* Add a binary object in to the cache. * Add a binary object in to the cache.
*
* @method Phaser.Cache#addBinary * @method Phaser.Cache#addBinary
* @param {string} key - Asset key for this binary data. * @param {string} key - Asset key for this binary data.
* @param {object} binaryData - The binary object to be addded to the cache. * @param {object} binaryData - The binary object to be addded to the cache.
@ -537,6 +701,7 @@ Phaser.Cache.prototype = {
/** /**
* Add a BitmapData object in to the cache. * Add a BitmapData object in to the cache.
*
* @method Phaser.Cache#addBitmapData * @method Phaser.Cache#addBitmapData
* @param {string} key - Asset key for this BitmapData. * @param {string} key - Asset key for this BitmapData.
* @param {Phaser.BitmapData} bitmapData - The BitmapData object to be addded to the cache. * @param {Phaser.BitmapData} bitmapData - The BitmapData object to be addded to the cache.
@ -590,7 +755,7 @@ Phaser.Cache.prototype = {
}, },
/** /**
* Add a new tilemap. * Add a new tilemap to the Cache.
* *
* @method Phaser.Cache#addTilemap * @method Phaser.Cache#addTilemap
* @param {string} key - The unique key by which you will reference this object. * @param {string} key - The unique key by which you will reference this object.
@ -605,7 +770,7 @@ Phaser.Cache.prototype = {
}, },
/** /**
* Add a new texture atlas. * Add a new texture atlas to the Cache.
* *
* @method Phaser.Cache#addTextureAtlas * @method Phaser.Cache#addTextureAtlas
* @param {string} key - The unique key by which you will reference this object. * @param {string} key - The unique key by which you will reference this object.
@ -637,23 +802,39 @@ Phaser.Cache.prototype = {
}, },
/** /**
* Add a new Bitmap Font. * Add a new Bitmap Font to the Cache.
* *
* @method Phaser.Cache#addBitmapFont * @method Phaser.Cache#addBitmapFont
* @param {string} key - The unique key by which you will reference this object. * @param {string} key - The unique key by which you will reference this object.
* @param {string} url - URL of this font xml file. * @param {string} url - URL of this font xml file.
* @param {object} data - Extra font data. * @param {object} data - Extra font data.
* @param xmlData {object} Texture atlas frames data. * @param {object} xmlData - Texture atlas frames data.
* @param {number} [xSpacing=0] - If you'd like to add additional horizontal spacing between the characters then set the pixel value here.
* @param {number} [ySpacing=0] - If you'd like to add additional vertical spacing between the lines then set the pixel value here.
*/ */
addBitmapFont: function (key, url, data, xmlData) { addBitmapFont: function (key, url, data, xmlData, xSpacing, ySpacing) {
this._images[key] = { url: url, data: data, spriteSheet: true }; this._images[key] = { url: url, data: data, spriteSheet: true };
PIXI.BaseTextureCache[key] = new PIXI.BaseTexture(data); PIXI.BaseTextureCache[key] = new PIXI.BaseTexture(data);
PIXI.TextureCache[key] = new PIXI.Texture(PIXI.BaseTextureCache[key]); PIXI.TextureCache[key] = new PIXI.Texture(PIXI.BaseTextureCache[key]);
Phaser.LoaderParser.bitmapFont(this.game, xmlData, key); Phaser.LoaderParser.bitmapFont(this.game, xmlData, key, xSpacing, ySpacing);
// this._images[key].frameData = Phaser.AnimationParser.XMLData(this.game, xmlData, key);
},
/**
* Add a new physics data object to the Cache.
*
* @method Phaser.Cache#addTilemap
* @param {string} key - The unique key by which you will reference this object.
* @param {string} url - URL of the physics json data.
* @param {object} JSONData - The physics data object (a JSON file).
* @param {number} format - The format of the physics data.
*/
addPhysicsData: function (key, url, JSONData, format) {
this._physics[key] = { url: url, data: JSONData, format: format };
}, },
@ -661,6 +842,7 @@ Phaser.Cache.prototype = {
* Adds a default image to be used in special cases such as WebGL Filters. Is mapped to the key __default. * Adds a default image to be used in special cases such as WebGL Filters. Is mapped to the key __default.
* *
* @method Phaser.Cache#addDefaultImage * @method Phaser.Cache#addDefaultImage
* @protected
*/ */
addDefaultImage: function () { addDefaultImage: function () {
@ -679,6 +861,7 @@ Phaser.Cache.prototype = {
* Adds an image to be used when a key is wrong / missing. Is mapped to the key __missing. * Adds an image to be used when a key is wrong / missing. Is mapped to the key __missing.
* *
* @method Phaser.Cache#addMissingImage * @method Phaser.Cache#addMissingImage
* @protected
*/ */
addMissingImage: function () { addMissingImage: function () {
@ -703,10 +886,21 @@ Phaser.Cache.prototype = {
*/ */
addText: function (key, url, data) { addText: function (key, url, data) {
this._text[key] = { this._text[key] = { url: url, data: data };
url: url,
data: data },
};
/**
* Add a new json object into the cache.
*
* @method Phaser.Cache#addJSON
* @param {string} key - Asset key for the text data.
* @param {string} url - URL of this text data file.
* @param {object} data - Extra text data.
*/
addJSON: function (key, url, data) {
this._json[key] = { url: url, data: data };
}, },
@ -863,6 +1057,64 @@ Phaser.Cache.prototype = {
}, },
/**
* Get a BitmapFont object from the cache by its key.
*
* @method Phaser.Cache#getBitmapFont
* @param {string} key - Asset key of the BitmapFont object to retrieve from the Cache.
* @return {Phaser.BitmapFont} The requested BitmapFont object if found, or null if not.
*/
getBitmapFont: function (key) {
if (this._bitmapFont[key])
{
return this._bitmapFont[key];
}
else
{
console.warn('Phaser.Cache.getBitmapFont: Invalid key: "' + key + '"');
}
},
/**
* Get a physics data object from the cache by its key. You can get either the entire data set or just a single object from it.
*
* @method Phaser.Cache#getPhysicsData
* @param {string} key - Asset key of the physics data object to retrieve from the Cache.
* @param {string} [object=null] - If specified it will return just the physics object that is part of the given key, if null it will return them all.
* @return {object} The requested physics object data if found.
*/
getPhysicsData: function (key, object) {
if (typeof object === 'undefined' || object === null)
{
// Get 'em all
if (this._physics[key])
{
return this._physics[key].data;
}
else
{
console.warn('Phaser.Cache.getPhysicsData: Invalid key: "' + key + '"');
}
}
else
{
if (this._physics[key] && this._physics[key].data[object])
{
return this._physics[key].data[object];
}
else
{
console.warn('Phaser.Cache.getPhysicsData: Invalid key/object: "' + key + ' / ' + object + '"');
}
}
return null;
},
/** /**
* Checks if an image key exists. * Checks if an image key exists.
* *
@ -938,6 +1190,23 @@ Phaser.Cache.prototype = {
return null; return null;
}, },
/**
* Replaces a set of frameData with a new Phaser.FrameData object.
*
* @method Phaser.Cache#updateFrameData
* @param {string} key - The unique key by which you will reference this object.
* @param {number} frameData - The new FrameData.
*/
updateFrameData: function (key, frameData) {
if (this._images[key])
{
this._images[key].spriteSheet = true;
this._images[key].frameData = frameData;
}
},
/** /**
* Get a single frame out of a frameData set by key. * Get a single frame out of a frameData set by key.
* *
@ -1133,6 +1402,26 @@ Phaser.Cache.prototype = {
}, },
/**
* Get a JSON object by key from the cache.
*
* @method Phaser.Cache#getJSON
* @param {string} key - Asset key of the json object to retrieve from the Cache.
* @return {object} The JSON object.
*/
getJSON: function (key) {
if (this._json[key])
{
return this._json[key].data;
}
else
{
console.warn('Phaser.Cache.getJSON: Invalid key: "' + key + '"');
}
},
/** /**
* Get binary data by key. * Get binary data by key.
* *
@ -1154,14 +1443,67 @@ Phaser.Cache.prototype = {
}, },
/** /**
* Get the cache keys from a given array of objects. * Gets all keys used by the Cache for the given data type.
* Normally you don't call this directly but instead use getImageKeys, getSoundKeys, etc.
* *
* @method Phaser.Cache#getKeys * @method Phaser.Cache#getKeys
* @param {Array} array - An array of items to return the keys for. * @param {number} [type=Phaser.Cache.IMAGE] - The type of Cache keys you wish to get. Can be Cache.CANVAS, Cache.IMAGE, Cache.SOUND, etc.
* @return {Array} The array of item keys. * @return {Array} The array of item keys.
*/ */
getKeys: function (array) { getKeys: function (type) {
var array = null;
switch (type)
{
case Phaser.Cache.CANVAS:
array = this._canvases;
break;
case Phaser.Cache.IMAGE:
array = this._images;
break;
case Phaser.Cache.TEXTURE:
array = this._textures;
break;
case Phaser.Cache.SOUND:
array = this._sounds;
break;
case Phaser.Cache.TEXT:
array = this._text;
break;
case Phaser.Cache.PHYSICS:
array = this._physics;
break;
case Phaser.Cache.TILEMAP:
array = this._tilemaps;
break;
case Phaser.Cache.BINARY:
array = this._binary;
break;
case Phaser.Cache.BITMAPDATA:
array = this._bitmapDatas;
break;
case Phaser.Cache.BITMAPFONT:
array = this._bitmapFont;
break;
case Phaser.Cache.JSON:
array = this._json;
break;
}
if (!array)
{
return;
}
var output = []; var output = [];
@ -1177,36 +1519,6 @@ Phaser.Cache.prototype = {
}, },
/**
* Returns an array containing all of the keys of Images in the Cache.
*
* @method Phaser.Cache#getImageKeys
* @return {Array} The string based keys in the Cache.
*/
getImageKeys: function () {
return this.getKeys(this._images);
},
/**
* Returns an array containing all of the keys of Sounds in the Cache.
*
* @method Phaser.Cache#getSoundKeys
* @return {Array} The string based keys in the Cache.
*/
getSoundKeys: function () {
return this.getKeys(this._sounds);
},
/**
* Returns an array containing all of the keys of Text Files in the Cache.
*
* @method Phaser.Cache#getTextKeys
* @return {Array} The string based keys in the Cache.
*/
getTextKeys: function () {
return this.getKeys(this._text);
},
/** /**
* Removes a canvas from the cache. * Removes a canvas from the cache.
* *
@ -1247,6 +1559,66 @@ Phaser.Cache.prototype = {
delete this._text[key]; delete this._text[key];
}, },
/**
* Removes a json object from the cache.
*
* @method Phaser.Cache#removeJSON
* @param {string} key - Key of the asset you want to remove.
*/
removeJSON: function (key) {
delete this._json[key];
},
/**
* Removes a physics data file from the cache.
*
* @method Phaser.Cache#removePhysics
* @param {string} key - Key of the asset you want to remove.
*/
removePhysics: function (key) {
delete this._physics[key];
},
/**
* Removes a tilemap from the cache.
*
* @method Phaser.Cache#removeTilemap
* @param {string} key - Key of the asset you want to remove.
*/
removeTilemap: function (key) {
delete this._tilemaps[key];
},
/**
* Removes a binary file from the cache.
*
* @method Phaser.Cache#removeBinary
* @param {string} key - Key of the asset you want to remove.
*/
removeBinary: function (key) {
delete this._binary[key];
},
/**
* Removes a bitmap data from the cache.
*
* @method Phaser.Cache#removeBitmapData
* @param {string} key - Key of the asset you want to remove.
*/
removeBitmapData: function (key) {
delete this._bitmapDatas[key];
},
/**
* Removes a bitmap font from the cache.
*
* @method Phaser.Cache#removeBitmapFont
* @param {string} key - Key of the asset you want to remove.
*/
removeBitmapFont: function (key) {
delete this._bitmapFont[key];
},
/** /**
* Clears the cache. Removes every local cache object reference. * Clears the cache. Removes every local cache object reference.
* *
@ -1256,23 +1628,62 @@ Phaser.Cache.prototype = {
for (var item in this._canvases) for (var item in this._canvases)
{ {
delete this._canvases[item['key']]; delete this._canvases[item];
} }
for (var item in this._images) for (var item in this._images)
{ {
delete this._images[item['key']]; if (item !== '__default' && item !== '__missing')
{
delete this._images[item];
}
} }
for (var item in this._sounds) for (var item in this._sounds)
{ {
delete this._sounds[item['key']]; delete this._sounds[item];
} }
for (var item in this._text) for (var item in this._text)
{ {
delete this._text[item['key']]; delete this._text[item];
} }
for (var item in this._json)
{
delete this._json[item];
}
for (var item in this._textures)
{
delete this._textures[item];
}
for (var item in this._physics)
{
delete this._physics[item];
}
for (var item in this._tilemaps)
{
delete this._tilemaps[item];
}
for (var item in this._binary)
{
delete this._binary[item];
}
for (var item in this._bitmapDatas)
{
delete this._bitmapDatas[item];
}
for (var item in this._bitmapFont)
{
delete this._bitmapFont[item];
}
} }
}; };
@ -1299,7 +1710,7 @@ Phaser.Cache.prototype.constructor = Phaser.Cache;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1326,6 +1737,9 @@ Phaser.Cache.prototype.constructor = Phaser.Cache;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -521,6 +599,11 @@ Phaser.Camera = function (game, id, x, y, width, height) {
* @property {PIXI.DisplayObject} displayObject - The display object to which all game objects are added. Set by World.boot * @property {PIXI.DisplayObject} displayObject - The display object to which all game objects are added. Set by World.boot
*/ */
this.displayObject = null; this.displayObject = null;
/**
* @property {Phaser.Point} scale - The scale of the display object to which all game objects are added. Set by World.boot
*/
this.scale = null;
}; };
@ -553,8 +636,8 @@ Phaser.Camera.prototype = {
/** /**
* Tells this camera which sprite to follow. * Tells this camera which sprite to follow.
* @method Phaser.Camera#follow * @method Phaser.Camera#follow
* @param {Phaser.Sprite} target - The object you want the camera to track. Set to null to not follow anything. * @param {Phaser.Sprite|Phaser.Image|Phaser.Text} target - The object you want the camera to track. Set to null to not follow anything.
* @param {number} [style] Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow(). * @param {number} [style] - Leverage one of the existing "deadzone" presets. If you use a custom deadzone, ignore this parameter and manually specify the deadzone after calling follow().
*/ */
follow: function (target, style) { follow: function (target, style) {
@ -701,25 +784,25 @@ Phaser.Camera.prototype = {
this.atLimit.y = false; this.atLimit.y = false;
// Make sure we didn't go outside the cameras bounds // Make sure we didn't go outside the cameras bounds
if (this.view.x &lt; this.bounds.x) if (this.view.x &lt;= this.bounds.x)
{ {
this.atLimit.x = true; this.atLimit.x = true;
this.view.x = this.bounds.x; this.view.x = this.bounds.x;
} }
if (this.view.right > this.bounds.right) if (this.view.right >= this.bounds.right)
{ {
this.atLimit.x = true; this.atLimit.x = true;
this.view.x = this.bounds.right - this.width; this.view.x = this.bounds.right - this.width;
} }
if (this.view.y &lt; this.bounds.top) if (this.view.y &lt;= this.bounds.top)
{ {
this.atLimit.y = true; this.atLimit.y = true;
this.view.y = this.bounds.top; this.view.y = this.bounds.top;
} }
if (this.view.bottom > this.bounds.bottom) if (this.view.bottom >= this.bounds.bottom)
{ {
this.atLimit.y = true; this.atLimit.y = true;
this.view.y = this.bounds.bottom - this.height; this.view.y = this.bounds.bottom - this.height;
@ -761,6 +844,19 @@ Phaser.Camera.prototype = {
this.view.width = width; this.view.width = width;
this.view.height = height; this.view.height = height;
},
/**
* Resets the camera back to 0,0 and un-follows any object it may have been tracking.
*
* @method Phaser.Camera#reset
*/
reset: function () {
this.target = null;
this.view.x = 0;
this.view.y = 0;
} }
}; };
@ -867,7 +963,7 @@ Object.defineProperty(Phaser.Camera.prototype, "height", {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -894,6 +990,9 @@ Object.defineProperty(Phaser.Camera.prototype, "height", {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -450,16 +528,26 @@ Phaser.Canvas = {
* @param {number} [width=256] - The width of the canvas element. * @param {number} [width=256] - The width of the canvas element.
* @param {number} [height=256] - The height of the canvas element.. * @param {number} [height=256] - The height of the canvas element..
* @param {string} [id=''] - If given this will be set as the ID of the canvas element, otherwise no ID will be set. * @param {string} [id=''] - If given this will be set as the ID of the canvas element, otherwise no ID will be set.
* @param {boolean} [noCocoon=false] - CocoonJS only allows 1 screencanvas object, which should be your game. If you need to create another canvas (i.e. for a texture) set this to 'true'.
* @return {HTMLCanvasElement} The newly created canvas element. * @return {HTMLCanvasElement} The newly created canvas element.
*/ */
create: function (width, height, id) { create: function (width, height, id, noCocoon) {
if (typeof noCocoon === 'undefined') { noCocoon = false; }
width = width || 256; width = width || 256;
height = height || 256; height = height || 256;
var canvas = document.createElement('canvas'); if (noCocoon)
{
var canvas = document.createElement('canvas');
}
else
{
var canvas = document.createElement(navigator.isCocoonJS ? 'screencanvas' : 'canvas');
}
if (typeof id === 'string') if (typeof id === 'string' && id !== '')
{ {
canvas.id = id; canvas.id = id;
} }
@ -736,7 +824,7 @@ Phaser.Canvas = {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -763,6 +851,9 @@ Phaser.Canvas = {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -502,11 +580,14 @@ Phaser.Circle.prototype = {
* @return {Circle} This circle object. * @return {Circle} This circle object.
*/ */
setTo: function (x, y, diameter) { setTo: function (x, y, diameter) {
this.x = x; this.x = x;
this.y = y; this.y = y;
this._diameter = diameter; this._diameter = diameter;
this._radius = diameter * 0.5; this._radius = diameter * 0.5;
return this; return this;
}, },
/** /**
@ -516,7 +597,9 @@ Phaser.Circle.prototype = {
* @return {Circle} This Circle object. * @return {Circle} This Circle object.
*/ */
copyFrom: function (source) { copyFrom: function (source) {
return this.setTo(source.x, source.y, source.diameter); return this.setTo(source.x, source.y, source.diameter);
}, },
/** /**
@ -525,11 +608,14 @@ Phaser.Circle.prototype = {
* @param {any} dest - The object to copy to. * @param {any} dest - The object to copy to.
* @return {Object} This dest object. * @return {Object} This dest object.
*/ */
copyTo: function(dest) { copyTo: function (dest) {
dest.x = this.x; dest.x = this.x;
dest.y = this.y; dest.y = this.y;
dest.diameter = this._diameter; dest.diameter = this._diameter;
return dest; return dest;
}, },
/** /**
@ -561,11 +647,18 @@ Phaser.Circle.prototype = {
* @param {Phaser.Circle} out - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned. * @param {Phaser.Circle} out - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
* @return {Phaser.Circle} The cloned Circle object. * @return {Phaser.Circle} The cloned Circle object.
*/ */
clone: function(out) { clone: function (out) {
if (typeof out === "undefined") { out = new Phaser.Circle(); } if (typeof out === "undefined")
{
out = new Phaser.Circle(this.x, this.y, this.diameter);
}
else
{
out.setTo(this.x, this.y, this.diameter);
}
return out.setTo(this.x, this.y, this.diameter); return out;
}, },
@ -577,7 +670,9 @@ Phaser.Circle.prototype = {
* @return {boolean} True if the coordinates are within this circle, otherwise false. * @return {boolean} True if the coordinates are within this circle, otherwise false.
*/ */
contains: function (x, y) { contains: function (x, y) {
return Phaser.Circle.contains(this, x, y); return Phaser.Circle.contains(this, x, y);
}, },
/** /**
@ -589,7 +684,9 @@ Phaser.Circle.prototype = {
* @return {Phaser.Point} The Point object holding the result. * @return {Phaser.Point} The Point object holding the result.
*/ */
circumferencePoint: function (angle, asDegrees, out) { circumferencePoint: function (angle, asDegrees, out) {
return Phaser.Circle.circumferencePoint(this, angle, asDegrees, out); return Phaser.Circle.circumferencePoint(this, angle, asDegrees, out);
}, },
/** /**
@ -600,9 +697,12 @@ Phaser.Circle.prototype = {
* @return {Circle} This Circle object. * @return {Circle} This Circle object.
*/ */
offset: function (dx, dy) { offset: function (dx, dy) {
this.x += dx; this.x += dx;
this.y += dy; this.y += dy;
return this; return this;
}, },
/** /**
@ -640,7 +740,9 @@ Object.defineProperty(Phaser.Circle.prototype, "diameter", {
}, },
set: function (value) { set: function (value) {
if (value > 0) {
if (value > 0)
{
this._diameter = value; this._diameter = value;
this._radius = value * 0.5; this._radius = value * 0.5;
} }
@ -660,10 +762,13 @@ Object.defineProperty(Phaser.Circle.prototype, "radius", {
}, },
set: function (value) { set: function (value) {
if (value > 0) {
if (value > 0)
{
this._radius = value; this._radius = value;
this._diameter = value * 2; this._diameter = value * 2;
} }
} }
}); });
@ -680,12 +785,17 @@ Object.defineProperty(Phaser.Circle.prototype, "left", {
}, },
set: function (value) { set: function (value) {
if (value > this.x) {
if (value > this.x)
{
this._radius = 0; this._radius = 0;
this._diameter = 0; this._diameter = 0;
} else { }
else
{
this.radius = this.x - value; this.radius = this.x - value;
} }
} }
}); });
@ -702,12 +812,17 @@ Object.defineProperty(Phaser.Circle.prototype, "right", {
}, },
set: function (value) { set: function (value) {
if (value &lt; this.x) {
if (value &lt; this.x)
{
this._radius = 0; this._radius = 0;
this._diameter = 0; this._diameter = 0;
} else { }
else
{
this.radius = value - this.x; this.radius = value - this.x;
} }
} }
}); });
@ -724,12 +839,17 @@ Object.defineProperty(Phaser.Circle.prototype, "top", {
}, },
set: function (value) { set: function (value) {
if (value > this.y) {
if (value > this.y)
{
this._radius = 0; this._radius = 0;
this._diameter = 0; this._diameter = 0;
} else { }
else
{
this.radius = this.y - value; this.radius = this.y - value;
} }
} }
}); });
@ -747,12 +867,16 @@ Object.defineProperty(Phaser.Circle.prototype, "bottom", {
set: function (value) { set: function (value) {
if (value &lt; this.y) { if (value &lt; this.y)
{
this._radius = 0; this._radius = 0;
this._diameter = 0; this._diameter = 0;
} else { }
else
{
this.radius = value - this.y; this.radius = value - this.y;
} }
} }
}); });
@ -766,11 +890,16 @@ Object.defineProperty(Phaser.Circle.prototype, "bottom", {
Object.defineProperty(Phaser.Circle.prototype, "area", { Object.defineProperty(Phaser.Circle.prototype, "area", {
get: function () { get: function () {
if (this._radius > 0) {
if (this._radius > 0)
{
return Math.PI * this._radius * this._radius; return Math.PI * this._radius * this._radius;
} else { }
else
{
return 0; return 0;
} }
} }
}); });
@ -809,16 +938,17 @@ Object.defineProperty(Phaser.Circle.prototype, "empty", {
Phaser.Circle.contains = function (a, x, y) { Phaser.Circle.contains = function (a, x, y) {
// Check if x/y are within the bounds first // Check if x/y are within the bounds first
if (x >= a.left && x &lt;= a.right && y >= a.top && y &lt;= a.bottom) { if (a.radius > 0 && x >= a.left && x &lt;= a.right && y >= a.top && y &lt;= a.bottom)
{
var dx = (a.x - x) * (a.x - x); var dx = (a.x - x) * (a.x - x);
var dy = (a.y - y) * (a.y - y); var dy = (a.y - y) * (a.y - y);
return (dx + dy) &lt;= (a.radius * a.radius); return (dx + dy) &lt;= (a.radius * a.radius);
} }
else
return false; {
return false;
}
}; };
@ -859,8 +989,9 @@ Phaser.Circle.circumferencePoint = function (a, angle, asDegrees, out) {
if (typeof asDegrees === "undefined") { asDegrees = false; } if (typeof asDegrees === "undefined") { asDegrees = false; }
if (typeof out === "undefined") { out = new Phaser.Point(); } if (typeof out === "undefined") { out = new Phaser.Point(); }
if (asDegrees === true) { if (asDegrees === true)
angle = Phaser.Math.radToDeg(angle); {
angle = Phaser.Math.degToRad(angle);
} }
out.x = a.x + a.radius * Math.cos(angle); out.x = a.x + a.radius * Math.cos(angle);
@ -882,18 +1013,21 @@ Phaser.Circle.intersectsRectangle = function (c, r) {
var cx = Math.abs(c.x - r.x - r.halfWidth); var cx = Math.abs(c.x - r.x - r.halfWidth);
var xDist = r.halfWidth + c.radius; var xDist = r.halfWidth + c.radius;
if (cx > xDist) { if (cx > xDist)
{
return false; return false;
} }
var cy = Math.abs(c.y - r.y - r.halfHeight); var cy = Math.abs(c.y - r.y - r.halfHeight);
var yDist = r.halfHeight + c.radius; var yDist = r.halfHeight + c.radius;
if (cy > yDist) { if (cy > yDist)
{
return false; return false;
} }
if (cx &lt;= r.halfWidth || cy &lt;= r.halfHeight) { if (cx &lt;= r.halfWidth || cy &lt;= r.halfHeight)
{
return true; return true;
} }
@ -906,6 +1040,9 @@ Phaser.Circle.intersectsRectangle = function (c, r) {
return xCornerDistSq + yCornerDistSq &lt;= maxCornerDistSq; return xCornerDistSq + yCornerDistSq &lt;= maxCornerDistSq;
}; };
// Because PIXI uses its own Circle, we'll replace it with ours to avoid duplicating code or confusion.
PIXI.Circle = Phaser.Circle;
</pre> </pre>
</article> </article>
</section> </section>
@ -927,7 +1064,7 @@ Phaser.Circle.intersectsRectangle = function (c, r) {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -954,6 +1091,9 @@ Phaser.Circle.intersectsRectangle = function (c, r) {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

3185
docs/Circle.js_.html Normal file

File diff suppressed because it is too large Load diff

595
docs/CollisionGroup.js.html Normal file
View file

@ -0,0 +1,595 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: physics/p2/CollisionGroup.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: physics/p2/CollisionGroup.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Collision Group
*
* @class Phaser.Physics.P2.CollisionGroup
* @classdesc Physics Collision Group Constructor
* @constructor
*/
Phaser.Physics.P2.CollisionGroup = function (bitmask) {
/**
* @property {number} mask - The CollisionGroup bitmask.
*/
this.mask = bitmask;
}
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:18 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -801,7 +879,7 @@ Phaser.Color = {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -828,6 +906,9 @@ Phaser.Color = {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -0,0 +1,638 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: physics/p2/ContactMaterial.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: physics/p2/ContactMaterial.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Defines a physics material
*
* @class Phaser.Physics.P2.ContactMaterial
* @classdesc Physics ContactMaterial Constructor
* @constructor
* @param {Phaser.Physics.P2.Material} materialA
* @param {Phaser.Physics.P2.Material} materialB
* @param {object} [options]
*/
Phaser.Physics.P2.ContactMaterial = function (materialA, materialB, options) {
/**
* @property {number} id - The contact material identifier.
*/
/**
* @property {Phaser.Physics.P2.Material} materialA - First material participating in the contact material.
*/
/**
* @property {Phaser.Physics.P2.Material} materialB - First second participating in the contact material.
*/
/**
* @property {number} [friction=0.3] - Friction to use in the contact of these two materials.
*/
/**
* @property {number} [restitution=0.0] - Restitution to use in the contact of these two materials.
*/
/**
* @property {number} [stiffness=1e7] - Stiffness of the resulting ContactEquation that this ContactMaterial generate.
*/
/**
* @property {number} [relaxation=3] - Relaxation of the resulting ContactEquation that this ContactMaterial generate.
*/
/**
* @property {number} [frictionStiffness=1e7] - Stiffness of the resulting FrictionEquation that this ContactMaterial generate.
*/
/**
* @property {number} [frictionRelaxation=3] - Relaxation of the resulting FrictionEquation that this ContactMaterial generate.
*/
/**
* @property {number} [surfaceVelocity=0] - Will add surface velocity to this material. If bodyA rests on top if bodyB, and the surface velocity is positive, bodyA will slide to the right.
*/
p2.ContactMaterial.call(this, materialA, materialB, options);
}
Phaser.Physics.P2.ContactMaterial.prototype = Object.create(p2.ContactMaterial.prototype);
Phaser.Physics.P2.ContactMaterial.prototype.constructor = Phaser.Physics.P2.ContactMaterial;
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:18 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -1,581 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: gameobjects/DOMSprite.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: gameobjects/DOMSprite.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Create a new DOMSprite.
* @class Phaser.DOMSprite
* @constructor
* @param {Phaser.Game} game - Current game instance.
* @param {string} id - DOM ID.
* @param {number} x - X position of the new text object.
* @param {number} y - Y position of the new text object.
* @param {string} text - The actual text that will be written.
* @param {object} style - The style object containing style attributes like font, font size ,
*/
Phaser.DOMSprite = function (game, element, x, y, style) {
x = x || 0;
y = y || 0;
style = style || '';
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
*/
this.game = game;
/**
* @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop.
* @default
*/
this.exists = true;
/**
* @property {boolean} alive - This is a handy little var your game can use to determine if an object is alive or not, it doesn't effect rendering.
* @default
*/
this.alive = true;
/**
* @property {Phaser.Group} group - The parent Group of this Text object.
*/
this.group = null;
/**
* @property {string} name - The user defined name given to this object.
* @default
*/
this.name = '';
/**
* @property {number} type - The const type of this object.
* @default
*/
this.type = Phaser.DOMSPRITE;
/**
* @property {boolean} visible - Sets the visible state of this DOMSprite.
* @default
*/
this.visible = true;
/*
if (parent)
{
if (typeof parent === 'string')
{
// hopefully an element ID
target = document.getElementById(parent);
}
else if (typeof parent === 'object' && parent.nodeType === 1)
{
// quick test for a HTMLelement
target = parent;
}
if (overflowHidden)
{
target.style.overflow = 'hidden';
}
}
*/
};
// Phaser.DOMSprite.prototype = Object.create(PIXI.DOMSprite.prototype);
// Phaser.DOMSprite.prototype.constructor = Phaser.DOMSprite;
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -442,7 +520,12 @@
* @constructor * @constructor
*/ */
Phaser.Device = function () { Phaser.Device = function (game) {
/**
* @property {Phaser.Game} game - A reference to the currently running game.
*/
this.game = game;
/** /**
* An optional 'fix' for the horrendous Android stock browser bug https://code.google.com/p/android/issues/detail?id=39247 * An optional 'fix' for the horrendous Android stock browser bug https://code.google.com/p/android/issues/detail?id=39247
@ -507,6 +590,12 @@ Phaser.Device = function () {
*/ */
this.windows = false; this.windows = false;
/**
* @property {boolean} windowsPhone - Is running on a Windows Phone?
* @default
*/
this.windowsPhone = false;
// Features // Features
/** /**
@ -620,7 +709,7 @@ Phaser.Device = function () {
this.ie = false; this.ie = false;
/** /**
* @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. * @property {number} ieVersion - If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Device.trident and Device.tridentVersion.
* @default * @default
*/ */
this.ieVersion = 0; this.ieVersion = 0;
@ -756,6 +845,30 @@ Phaser.Device = function () {
*/ */
this.littleEndian = false; this.littleEndian = false;
/**
* @property {boolean} fullscreen - Does the browser support the Full Screen API?
* @default
*/
this.fullscreen = false;
/**
* @property {string} requestFullscreen - If the browser supports the Full Screen API this holds the call you need to use to activate it.
* @default
*/
this.requestFullscreen = '';
/**
* @property {string} cancelFullscreen - If the browser supports the Full Screen API this holds the call you need to use to cancel it.
* @default
*/
this.cancelFullscreen = '';
/**
* @property {boolean} fullscreenKeyboard - Does the browser support access to the Keyboard during Full Screen mode?
* @default
*/
this.fullscreenKeyboard = false;
// Run the checks // Run the checks
this._checkAudio(); this._checkAudio();
this._checkBrowser(); this._checkBrowser();
@ -800,6 +913,11 @@ Phaser.Device.prototype = {
else if (/Windows/.test(ua)) else if (/Windows/.test(ua))
{ {
this.windows = true; this.windows = true;
if (/Windows Phone/i.test(ua))
{
this.windowsPhone = true;
}
} }
if (this.windows || this.macOS || (this.linux && this.silk === false)) if (this.windows || this.macOS || (this.linux && this.silk === false))
@ -807,6 +925,12 @@ Phaser.Device.prototype = {
this.desktop = true; this.desktop = true;
} }
// Windows Phone / Table reset
if (this.windowsPhone || ((/Windows NT/i.test(ua)) && (/Touch/i.test(ua))))
{
this.desktop = false;
}
}, },
/** /**
@ -816,7 +940,7 @@ Phaser.Device.prototype = {
*/ */
_checkFeatures: function () { _checkFeatures: function () {
this.canvas = !!window['CanvasRenderingContext2D']; this.canvas = !!window['CanvasRenderingContext2D'] || this.cocoonJS;
try { try {
this.localStorage = !!localStorage.getItem; this.localStorage = !!localStorage.getItem;
@ -853,6 +977,65 @@ Phaser.Device.prototype = {
this.quirksMode = (document.compatMode === 'CSS1Compat') ? false : true; this.quirksMode = (document.compatMode === 'CSS1Compat') ? false : true;
},
/**
* Checks for support of the Full Screen API.
*
* @method Phaser.Device#checkFullScreenSupport
*/
checkFullScreenSupport: function () {
var fs = [
'requestFullscreen',
'requestFullScreen',
'webkitRequestFullscreen',
'webkitRequestFullScreen',
'msRequestFullscreen',
'msRequestFullScreen',
'mozRequestFullScreen',
'mozRequestFullscreen'
];
for (var i = 0; i &lt; fs.length; i++)
{
if (this.game.canvas[fs[i]])
{
this.fullscreen = true;
this.requestFullscreen = fs[i];
}
}
var cfs = [
'cancelFullScreen',
'exitFullscreen',
'webkitCancelFullScreen',
'webkitExitFullscreen',
'msCancelFullScreen',
'msExitFullscreen',
'mozCancelFullScreen',
'mozExitFullscreen'
];
if (this.fullscreen)
{
for (var i = 0; i &lt; cfs.length; i++)
{
if (this.game.canvas[cfs[i]])
{
this.cancelFullscreen = cfs[i];
}
}
}
// Keyboard Input?
if (window['Element'] && Element['ALLOW_KEYBOARD_INPUT'])
{
this.fullscreenKeyboard = true;
}
}, },
/** /**
@ -905,11 +1088,12 @@ Phaser.Device.prototype = {
{ {
this.silk = true; this.silk = true;
} }
else if (/Trident\/(\d+\.\d+);/.test(ua)) else if (/Trident\/(\d+\.\d+); rv:(\d+\.\d+)/.test(ua))
{ {
this.ie = true; this.ie = true;
this.trident = true; this.trident = true;
this.tridentVersion = parseInt(RegExp.$1, 10); this.tridentVersion = parseInt(RegExp.$1, 10);
this.ieVersion = parseInt(RegExp.$2, 10);
} }
// WebApp mode in iOS // WebApp mode in iOS
@ -1129,7 +1313,7 @@ Phaser.Device.prototype.constructor = Phaser.Device;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1156,6 +1340,9 @@ Phaser.Device.prototype.constructor = Phaser.Device;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -0,0 +1,614 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: physics/p2/DistanceConstraint.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: physics/p2/DistanceConstraint.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* A constraint that tries to keep the distance between two bodies constant.
*
* @class Phaser.Physics.P2.DistanceConstraint
* @classdesc Physics DistanceConstraint Constructor
* @constructor
* @param {Phaser.Physics.P2} world - A reference to the P2 World.
* @param {p2.Body} bodyA - First connected body.
* @param {p2.Body} bodyB - Second connected body.
* @param {number} distance - The distance to keep between the bodies.
* @param {number} [maxForce] - The maximum force that should be applied to constrain the bodies.
*/
Phaser.Physics.P2.DistanceConstraint = function (world, bodyA, bodyB, distance, maxForce) {
if (typeof distance === 'undefined') { distance = 100; }
/**
* @property {Phaser.Game} game - Local reference to game.
*/
this.game = world.game;
/**
* @property {Phaser.Physics.P2} world - Local reference to P2 World.
*/
this.world = world;
distance = world.pxm(distance);
p2.DistanceConstraint.call(this, bodyA, bodyB, distance, maxForce);
}
Phaser.Physics.P2.DistanceConstraint.prototype = Object.create(p2.DistanceConstraint.prototype);
Phaser.Physics.P2.DistanceConstraint.prototype.constructor = Phaser.Physics.P2.DistanceConstraint;
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:18 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -796,11 +874,11 @@ Phaser.Easing = {
/** /**
* Circular ease-in/out. * Circular ease-in/out.
* *
* @method Phaser.Easing.Circular#InOut * @method Phaser.Easing.Circular#InOut
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
InOut: function ( k ) { InOut: function ( k ) {
if ( ( k *= 2 ) &lt; 1) return - 0.5 * ( Math.sqrt( 1 - k * k) - 1); if ( ( k *= 2 ) &lt; 1) return - 0.5 * ( Math.sqrt( 1 - k * k) - 1);
@ -819,11 +897,11 @@ Phaser.Easing = {
/** /**
* Elastic ease-in. * Elastic ease-in.
* *
* @method Phaser.Easing.Elastic#In * @method Phaser.Easing.Elastic#In
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
In: function ( k ) { In: function ( k ) {
var s, a = 0.1, p = 0.4; var s, a = 0.1, p = 0.4;
@ -837,11 +915,11 @@ Phaser.Easing = {
/** /**
* Elastic ease-out. * Elastic ease-out.
* *
* @method Phaser.Easing.Elastic#Out * @method Phaser.Easing.Elastic#Out
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
Out: function ( k ) { Out: function ( k ) {
var s, a = 0.1, p = 0.4; var s, a = 0.1, p = 0.4;
@ -855,11 +933,11 @@ Phaser.Easing = {
/** /**
* Elastic ease-in/out. * Elastic ease-in/out.
* *
* @method Phaser.Easing.Elastic#InOut * @method Phaser.Easing.Elastic#InOut
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
InOut: function ( k ) { InOut: function ( k ) {
var s, a = 0.1, p = 0.4; var s, a = 0.1, p = 0.4;
@ -883,11 +961,11 @@ Phaser.Easing = {
/** /**
* Back ease-in. * Back ease-in.
* *
* @method Phaser.Easing.Back#In * @method Phaser.Easing.Back#In
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
In: function ( k ) { In: function ( k ) {
var s = 1.70158; var s = 1.70158;
@ -897,11 +975,11 @@ Phaser.Easing = {
/** /**
* Back ease-out. * Back ease-out.
* *
* @method Phaser.Easing.Back#Out * @method Phaser.Easing.Back#Out
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
Out: function ( k ) { Out: function ( k ) {
var s = 1.70158; var s = 1.70158;
@ -911,11 +989,11 @@ Phaser.Easing = {
/** /**
* Back ease-in/out. * Back ease-in/out.
* *
* @method Phaser.Easing.Back#InOut * @method Phaser.Easing.Back#InOut
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
InOut: function ( k ) { InOut: function ( k ) {
var s = 1.70158 * 1.525; var s = 1.70158 * 1.525;
@ -935,11 +1013,11 @@ Phaser.Easing = {
/** /**
* Bounce ease-in. * Bounce ease-in.
* *
* @method Phaser.Easing.Bounce#In * @method Phaser.Easing.Bounce#In
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
In: function ( k ) { In: function ( k ) {
return 1 - Phaser.Easing.Bounce.Out( 1 - k ); return 1 - Phaser.Easing.Bounce.Out( 1 - k );
@ -948,11 +1026,11 @@ Phaser.Easing = {
/** /**
* Bounce ease-out. * Bounce ease-out.
* *
* @method Phaser.Easing.Bounce#Out * @method Phaser.Easing.Bounce#Out
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
Out: function ( k ) { Out: function ( k ) {
if ( k &lt; ( 1 / 2.75 ) ) { if ( k &lt; ( 1 / 2.75 ) ) {
@ -977,11 +1055,11 @@ Phaser.Easing = {
/** /**
* Bounce ease-in/out. * Bounce ease-in/out.
* *
* @method Phaser.Easing.Bounce#InOut * @method Phaser.Easing.Bounce#InOut
* @param {number} k - The value to be tweened. * @param {number} k - The value to be tweened.
* @returns {number} The tweened value. * @returns {number} The tweened value.
*/ */
InOut: function ( k ) { InOut: function ( k ) {
if ( k &lt; 0.5 ) return Phaser.Easing.Bounce.In( k * 2 ) * 0.5; if ( k &lt; 0.5 ) return Phaser.Easing.Bounce.In( k * 2 ) * 0.5;
@ -1013,7 +1091,7 @@ Phaser.Easing = {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1040,6 +1118,9 @@ Phaser.Easing = {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

870
docs/Ellipse.js.html Normal file
View file

@ -0,0 +1,870 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: geom/Ellipse.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: geom/Ellipse.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @author Chad Engler &lt;chad@pantherdev.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Creates a Ellipse object. A curve on a plane surrounding two focal points.
* @class Ellipse
* @classdesc Phaser - Ellipse
* @constructor
* @param {number} [x=0] - The X coordinate of the upper-left corner of the framing rectangle of this ellipse.
* @param {number} [y=0] - The Y coordinate of the upper-left corner of the framing rectangle of this ellipse.
* @param {number} [width=0] - The overall width of this ellipse.
* @param {number} [height=0] - The overall height of this ellipse.
* @return {Phaser.Ellipse} This Ellipse object
*/
Phaser.Ellipse = function (x, y, width, height) {
this.type = Phaser.ELLIPSE;
x = x || 0;
y = y || 0;
width = width || 0;
height = height || 0;
/**
* @property {number} x - The X coordinate of the upper-left corner of the framing rectangle of this ellipse.
*/
this.x = x;
/**
* @property {number} y - The Y coordinate of the upper-left corner of the framing rectangle of this ellipse.
*/
this.y = y;
/**
* @property {number} width - The overall width of this ellipse.
*/
this.width = width;
/**
* @property {number} height - The overall height of this ellipse.
*/
this.height = height;
};
Phaser.Ellipse.prototype = {
/**
* Sets the members of the Ellipse to the specified values.
* @method Phaser.Ellipse#setTo
* @param {number} x - The X coordinate of the upper-left corner of the framing rectangle of this ellipse.
* @param {number} y - The Y coordinate of the upper-left corner of the framing rectangle of this ellipse.
* @param {number} width - The overall width of this ellipse.
* @param {number} height - The overall height of this ellipse.
* @return {Phaser.Ellipse} This Ellipse object.
*/
setTo: function (x, y, width, height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
return this;
},
/**
* Copies the x, y, width and height properties from any given object to this Ellipse.
* @method Phaser.Ellipse#copyFrom
* @param {any} source - The object to copy from.
* @return {Phaser.Ellipse} This Ellipse object.
*/
copyFrom: function (source) {
return this.setTo(source.x, source.y, source.width, source.height);
},
/**
* Copies the x, y and diameter properties from this Circle to any given object.
* @method Phaser.Ellipse#copyTo
* @param {any} dest - The object to copy to.
* @return {Object} This dest object.
*/
copyTo: function(dest) {
dest.x = this.x;
dest.y = this.y;
dest.width = this.width;
dest.height = this.height;
return dest;
},
/**
* Returns a new Ellipse object with the same values for the x, y, width, and height properties as this Ellipse object.
* @method Phaser.Ellipse#clone
* @param {Phaser.Ellipse} out - Optional Ellipse object. If given the values will be set into the object, otherwise a brand new Ellipse object will be created and returned.
* @return {Phaser.Ellipse} The cloned Ellipse object.
*/
clone: function(out) {
if (typeof out === "undefined")
{
out = new Phaser.Ellipse(this.x, this.y, this.width, this.height);
}
else
{
out.setTo(this.x, this.y, this.width, this.height);
}
return out;
},
/**
* Return true if the given x/y coordinates are within this Ellipse object.
* @method Phaser.Ellipse#contains
* @param {number} x - The X value of the coordinate to test.
* @param {number} y - The Y value of the coordinate to test.
* @return {boolean} True if the coordinates are within this ellipse, otherwise false.
*/
contains: function (x, y) {
return Phaser.Ellipse.contains(this, x, y);
},
/**
* Returns a string representation of this object.
* @method Phaser.Ellipse#toString
* @return {string} A string representation of the instance.
*/
toString: function () {
return "[{Phaser.Ellipse (x=" + this.x + " y=" + this.y + " width=" + this.width + " height=" + this.height + ")}]";
}
};
Phaser.Ellipse.prototype.constructor = Phaser.Ellipse;
/**
* The left coordinate of the Ellipse. The same as the X coordinate.
* @name Phaser.Ellipse#left
* @propety {number} left - Gets or sets the value of the leftmost point of the ellipse.
*/
Object.defineProperty(Phaser.Ellipse.prototype, "left", {
get: function () {
return this.x;
},
set: function (value) {
this.x = value;
}
});
/**
* The x coordinate of the rightmost point of the Ellipse. Changing the right property of an Ellipse object has no effect on the x property, but does adjust the width.
* @name Phaser.Ellipse#right
* @property {number} right - Gets or sets the value of the rightmost point of the ellipse.
*/
Object.defineProperty(Phaser.Ellipse.prototype, "right", {
get: function () {
return this.x + this.width;
},
set: function (value) {
if (value &lt; this.x)
{
this.width = 0;
}
else
{
this.width = this.x + value;
}
}
});
/**
* The top of the Ellipse. The same as its y property.
* @name Phaser.Ellipse#top
* @property {number} top - Gets or sets the top of the ellipse.
*/
Object.defineProperty(Phaser.Ellipse.prototype, "top", {
get: function () {
return this.y;
},
set: function (value) {
this.y = value;
}
});
/**
* The sum of the y and height properties. Changing the bottom property of an Ellipse doesn't adjust the y property, but does change the height.
* @name Phaser.Ellipse#bottom
* @property {number} bottom - Gets or sets the bottom of the ellipse.
*/
Object.defineProperty(Phaser.Ellipse.prototype, "bottom", {
get: function () {
return this.y + this.height;
},
set: function (value) {
if (value &lt; this.y)
{
this.height = 0;
}
else
{
this.height = this.y + value;
}
}
});
/**
* Determines whether or not this Ellipse object is empty. Will return a value of true if the Ellipse objects dimensions are less than or equal to 0; otherwise false.
* If set to true it will reset all of the Ellipse objects properties to 0. An Ellipse object is empty if its width or height is less than or equal to 0.
* @name Phaser.Ellipse#empty
* @property {boolean} empty - Gets or sets the empty state of the ellipse.
*/
Object.defineProperty(Phaser.Ellipse.prototype, "empty", {
get: function () {
return (this.width === 0 || this.height === 0);
},
set: function (value) {
if (value === true)
{
this.setTo(0, 0, 0, 0);
}
}
});
/**
* Return true if the given x/y coordinates are within the Ellipse object.
* @method Phaser.Ellipse.contains
* @param {Phaser.Ellipse} a - The Ellipse to be checked.
* @param {number} x - The X value of the coordinate to test.
* @param {number} y - The Y value of the coordinate to test.
* @return {boolean} True if the coordinates are within this ellipse, otherwise false.
*/
Phaser.Ellipse.contains = function (a, x, y) {
if (a.width &lt;= 0 || a.height &lt;= 0)
{
return false;
}
// Normalize the coords to an ellipse with center 0,0 and a radius of 0.5
var normx = ((x - a.x) / a.width) - 0.5;
var normy = ((y - a.y) / a.height) - 0.5;
normx *= normx;
normy *= normy;
return (normx + normy &lt; 0.25);
};
/**
* Returns the framing rectangle of the ellipse as a Phaser.Rectangle object.
*
* @method Phaser.Ellipse.getBounds
* @return {Phaser.Rectangle} The framing rectangle
*/
Phaser.Ellipse.prototype.getBounds = function() {
return new Phaser.Rectangle(this.x, this.y, this.width, this.height);
};
// Because PIXI uses its own Ellipse, we'll replace it with ours to avoid duplicating code or confusion.
PIXI.Ellipse = Phaser.Ellipse;
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -596,6 +674,12 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
*/ */
this._explode = true; this._explode = true;
/**
* @property {any} _frames - Internal helper for the particle frame.
* @private
*/
this._frames = null;
/** /**
* @property {boolean} on - Determines whether the emitter is currently emitting particles. It is totally safe to directly toggle this. * @property {boolean} on - Determines whether the emitter is currently emitting particles. It is totally safe to directly toggle this.
* @default * @default
@ -695,6 +779,7 @@ Phaser.Particles.Arcade.Emitter.prototype.makeParticles = function (keys, frames
var i = 0; var i = 0;
var rndKey = keys; var rndKey = keys;
var rndFrame = frames; var rndFrame = frames;
this._frames = frames;
while (i &lt; quantity) while (i &lt; quantity)
{ {
@ -711,6 +796,7 @@ Phaser.Particles.Arcade.Emitter.prototype.makeParticles = function (keys, frames
} }
particle = new Phaser.Sprite(this.game, 0, 0, rndKey, rndFrame); particle = new Phaser.Sprite(this.game, 0, 0, rndKey, rndFrame);
this.game.physics.arcade.enable(particle, false);
} }
// else // else
// { // {
@ -865,6 +951,15 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () {
particle.scale.setTo(scale, scale); particle.scale.setTo(scale, scale);
} }
if (typeof this._frames === 'object')
{
particle.frame = this.game.rnd.pick(this._frames);
}
else
{
particle.frame = this._frames;
}
particle.body.friction = this.particleFriction; particle.body.friction = this.particleFriction;
particle.body.angularDrag = this.angularDrag; particle.body.angularDrag = this.angularDrag;
@ -950,7 +1045,6 @@ Phaser.Particles.Arcade.Emitter.prototype.at = function (object) {
* The emitters alpha value. * The emitters alpha value.
* @name Phaser.Particles.Arcade.Emitter#alpha * @name Phaser.Particles.Arcade.Emitter#alpha
* @property {number} alpha - Gets or sets the alpha value of the Emitter. * @property {number} alpha - Gets or sets the alpha value of the Emitter.
*/
Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "alpha", { Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "alpha", {
get: function () { get: function () {
@ -962,12 +1056,12 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "alpha", {
} }
}); });
*/
/** /**
* The emitter visible state. * The emitter visible state.
* @name Phaser.Particles.Arcade.Emitter#visible * @name Phaser.Particles.Arcade.Emitter#visible
* @property {boolean} visible - Gets or sets the Emitter visible state. * @property {boolean} visible - Gets or sets the Emitter visible state.
*/
Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "visible", { Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "visible", {
get: function () { get: function () {
@ -979,6 +1073,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "visible", {
} }
}); });
*/
/** /**
* @name Phaser.Particles.Arcade.Emitter#x * @name Phaser.Particles.Arcade.Emitter#x
@ -1084,7 +1179,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1111,6 +1206,9 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -442,7 +520,7 @@
* *
* For example to tell when a Sprite has been added to a new group: * For example to tell when a Sprite has been added to a new group:
* *
* ```sprite.events.onAddedToGroup.add(yourFunction, this);``` * `sprite.events.onAddedToGroup.add(yourFunction, this);`
* *
* Where `yourFunction` is the function you want called when this event occurs. * Where `yourFunction` is the function you want called when this event occurs.
* *
@ -473,9 +551,6 @@ Phaser.Events = function (sprite) {
this.onAnimationComplete = null; this.onAnimationComplete = null;
this.onAnimationLoop = null; this.onAnimationLoop = null;
this.onBeginContact = null;
this.onEndContact = null;
}; };
Phaser.Events.prototype = { Phaser.Events.prototype = {
@ -532,7 +607,7 @@ Phaser.Events.prototype.constructor = Phaser.Events;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -559,6 +634,9 @@ Phaser.Events.prototype.constructor = Phaser.Events;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -466,6 +544,12 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) {
*/ */
this.passes = [this]; this.passes = [this];
/**
* @property {array} shaders - Array an array of shaders.
* @private
*/
this.shaders = [];
/** /**
* @property {boolean} dirty - Internal PIXI var. * @property {boolean} dirty - Internal PIXI var.
* @default * @default
@ -609,7 +693,7 @@ Object.defineProperty(Phaser.Filter.prototype, 'height', {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -636,6 +720,9 @@ Object.defineProperty(Phaser.Filter.prototype, 'height', {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -586,6 +664,28 @@ Phaser.Frame.prototype = {
this.spriteSourceSizeH = destHeight; this.spriteSourceSizeH = destHeight;
} }
},
/**
* Returns a Rectangle set to the dimensions of this Frame.
*
* @method Phaser.Frame#getRect
* @param {Phaser.Rectangle} [out] - A rectangle to copy the frame dimensions to.
* @return {Phaser.Rectangle} A rectangle.
*/
getRect: function (out) {
if (typeof out === 'undefined')
{
out = new Phaser.Rectangle(this.x, this.y, this.width, this.height);
}
else
{
out.setTo(this.x, this.y, this.width, this.height);
}
return out;
} }
}; };
@ -612,7 +712,7 @@ Phaser.Frame.prototype.constructor = Phaser.Frame;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -639,6 +739,9 @@ Phaser.Frame.prototype.constructor = Phaser.Frame;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -491,12 +569,12 @@ Phaser.FrameData.prototype = {
*/ */
getFrame: function (index) { getFrame: function (index) {
if (this._frames.length > index) if (index > this._frames.length)
{ {
return this._frames[index]; index = 0;
} }
return null; return this._frames[index];
}, },
@ -689,7 +767,7 @@ Object.defineProperty(Phaser.FrameData.prototype, "total", {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -716,6 +794,9 @@ Object.defineProperty(Phaser.FrameData.prototype, "total", {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -451,9 +529,10 @@
* @param {string|HTMLElement} [parent=''] - The DOM element into which this games canvas will be injected. Either a DOM ID (string) or the element itself. * @param {string|HTMLElement} [parent=''] - The DOM element into which this games canvas will be injected. Either a DOM ID (string) or the element itself.
* @param {object} [state=null] - The default state object. A object consisting of Phaser.State functions (preload, create, update, render) or null. * @param {object} [state=null] - The default state object. A object consisting of Phaser.State functions (preload, create, update, render) or null.
* @param {boolean} [transparent=false] - Use a transparent canvas background or not. * @param {boolean} [transparent=false] - Use a transparent canvas background or not.
* @param {boolean} [antialias=true] - Anti-alias graphics. * @param {boolean} [antialias=true] - Draw all image textures anti-aliased or not. The default is for smooth textures, but disable if your game features pixel art.
* @param {object} [physicsConfig=null] - A physics configuration object to pass to the Physics world on creation.
*/ */
Phaser.Game = function (width, height, renderer, parent, state, transparent, antialias) { Phaser.Game = function (width, height, renderer, parent, state, transparent, antialias, physicsConfig) {
/** /**
* @property {number} id - Phaser Game ID (for when Pixi supports multiple instances). * @property {number} id - Phaser Game ID (for when Pixi supports multiple instances).
@ -465,6 +544,11 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
*/ */
this.config = null; this.config = null;
/**
* @property {object} physicsConfig - The Phaser.Physics.World configuration object.
*/
this.physicsConfig = physicsConfig;
/** /**
* @property {HTMLElement} parent - The Games DOM parent. * @property {HTMLElement} parent - The Games DOM parent.
* @default * @default
@ -490,7 +574,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
this.transparent = false; this.transparent = false;
/** /**
* @property {boolean} antialias - Anti-alias graphics (in WebGL this helps with edges, in Canvas2D it retains pixel-art quality). * @property {boolean} antialias - Anti-alias graphics. By default scaled images are smoothed in Canvas and WebGL, set anti-alias to false to disable this globally.
* @default * @default
*/ */
this.antialias = true; this.antialias = true;
@ -502,7 +586,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
this.renderer = Phaser.AUTO; this.renderer = Phaser.AUTO;
/** /**
* @property {number} renderType - The Renderer this Phaser.Game will use. Either Phaser.RENDERER_AUTO, Phaser.RENDERER_CANVAS or Phaser.RENDERER_WEBGL. * @property {number} renderType - The Renderer this game will use. Either Phaser.AUTO, Phaser.CANVAS or Phaser.WEBGL.
*/ */
this.renderType = Phaser.AUTO; this.renderType = Phaser.AUTO;
@ -511,20 +595,6 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
*/ */
this.state = null; this.state = null;
/**
* @property {boolean} _paused - Is game paused?
* @private
* @default
*/
this._paused = false;
/**
* @property {boolean} _loadComplete - Whether load complete loading or not.
* @private
* @default
*/
this._loadComplete = false;
/** /**
* @property {boolean} isBooted - Whether the game engine is booted, aka available. * @property {boolean} isBooted - Whether the game engine is booted, aka available.
* @default * @default
@ -539,16 +609,19 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
/** /**
* @property {Phaser.RequestAnimationFrame} raf - Automatically handles the core game loop via requestAnimationFrame or setTimeout * @property {Phaser.RequestAnimationFrame} raf - Automatically handles the core game loop via requestAnimationFrame or setTimeout
* @default
*/ */
this.raf = null; this.raf = null;
/** /**
* @property {Phaser.GameObjectFactory} add - Reference to the GameObject Factory. * @property {Phaser.GameObjectFactory} add - Reference to the Phaser.GameObjectFactory.
* @default
*/ */
this.add = null; this.add = null;
/**
* @property {Phaser.GameObjectCreator} make - Reference to the GameObject Creator.
*/
this.make = null;
/** /**
* @property {Phaser.Cache} cache - Reference to the assets cache. * @property {Phaser.Cache} cache - Reference to the assets cache.
* @default * @default
@ -569,91 +642,81 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
/** /**
* @property {Phaser.Math} math - Reference to the math helper. * @property {Phaser.Math} math - Reference to the math helper.
* @default
*/ */
this.math = null; this.math = null;
/** /**
* @property {Phaser.Net} net - Reference to the network class. * @property {Phaser.Net} net - Reference to the network class.
* @default
*/ */
this.net = null; this.net = null;
/**
* @property {Phaser.ScaleManager} scale - The game scale manager.
*/
this.scale = null;
/** /**
* @property {Phaser.SoundManager} sound - Reference to the sound manager. * @property {Phaser.SoundManager} sound - Reference to the sound manager.
* @default
*/ */
this.sound = null; this.sound = null;
/** /**
* @property {Phaser.Stage} stage - Reference to the stage. * @property {Phaser.Stage} stage - Reference to the stage.
* @default
*/ */
this.stage = null; this.stage = null;
/** /**
* @property {Phaser.TimeManager} time - Reference to game clock. * @property {Phaser.TimeManager} time - Reference to game clock.
* @default
*/ */
this.time = null; this.time = null;
/** /**
* @property {Phaser.TweenManager} tweens - Reference to the tween manager. * @property {Phaser.TweenManager} tweens - Reference to the tween manager.
* @default
*/ */
this.tweens = null; this.tweens = null;
/** /**
* @property {Phaser.World} world - Reference to the world. * @property {Phaser.World} world - Reference to the world.
* @default
*/ */
this.world = null; this.world = null;
/** /**
* @property {Phaser.Physics.PhysicsManager} physics - Reference to the physics manager. * @property {Phaser.Physics} physics - Reference to the physics manager.
* @default
*/ */
this.physics = null; this.physics = null;
/** /**
* @property {Phaser.RandomDataGenerator} rnd - Instance of repeatable random data generator helper. * @property {Phaser.RandomDataGenerator} rnd - Instance of repeatable random data generator helper.
* @default
*/ */
this.rnd = null; this.rnd = null;
/** /**
* @property {Phaser.Device} device - Contains device information and capabilities. * @property {Phaser.Device} device - Contains device information and capabilities.
* @default
*/ */
this.device = null; this.device = null;
/** /**
* @property {Phaser.Physics.PhysicsManager} camera - A handy reference to world.camera. * @property {Phaser.Physics.PhysicsManager} camera - A handy reference to world.camera.
* @default
*/ */
this.camera = null; this.camera = null;
/** /**
* @property {HTMLCanvasElement} canvas - A handy reference to renderer.view. * @property {HTMLCanvasElement} canvas - A handy reference to renderer.view, the canvas that the game is being rendered in to.
* @default
*/ */
this.canvas = null; this.canvas = null;
/** /**
* @property {Context} context - A handy reference to renderer.context (only set for CANVAS games) * @property {CanvasRenderingContext2D} context - A handy reference to renderer.context (only set for CANVAS games, not WebGL)
* @default
*/ */
this.context = null; this.context = null;
/** /**
* @property {Phaser.Utils.Debug} debug - A set of useful debug utilitie. * @property {Phaser.Utils.Debug} debug - A set of useful debug utilitie.
* @default
*/ */
this.debug = null; this.debug = null;
/** /**
* @property {Phaser.Particles} particles - The Particle Manager. * @property {Phaser.Particles} particles - The Particle Manager.
* @default
*/ */
this.particles = null; this.particles = null;
@ -678,6 +741,40 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
*/ */
this.stepCount = 0; this.stepCount = 0;
/**
* @property {Phaser.Signal} onPause - This event is fired when the game pauses.
*/
this.onPause = null;
/**
* @property {Phaser.Signal} onResume - This event is fired when the game resumes from a paused state.
*/
this.onResume = null;
/**
* @property {Phaser.Signal} onBlur - This event is fired when the game no longer has focus (typically on page hide).
*/
this.onBlur = null;
/**
* @property {Phaser.Signal} onFocus - This event is fired when the game has focus (typically on page show).
*/
this.onFocus = null;
/**
* @property {boolean} _paused - Is game paused?
* @private
* @default
*/
this._paused = false;
/**
* @property {boolean} _codePaused - Was the game paused via code or a visibility change?
* @private
* @default
*/
this._codePaused = false;
// Parse the configuration object (if any) // Parse the configuration object (if any)
if (arguments.length === 1 && typeof arguments[0] === 'object') if (arguments.length === 1 && typeof arguments[0] === 'object')
{ {
@ -716,6 +813,8 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
this.antialias = antialias; this.antialias = antialias;
} }
this.rnd = new Phaser.RandomDataGenerator([(Date.now() * Math.random()).toString()]);
this.state = new Phaser.StateManager(this, state); this.state = new Phaser.StateManager(this, state);
} }
@ -753,12 +852,12 @@ Phaser.Game.prototype = {
if (config['width']) if (config['width'])
{ {
this.width = this.parseDimension(config['width'], 0); this.width = Phaser.Utils.parseDimension(config['width'], 0);
} }
if (config['height']) if (config['height'])
{ {
this.height = this.parseDimension(config['height'], 1); this.height = Phaser.Utils.parseDimension(config['height'], 1);
} }
if (config['renderer']) if (config['renderer'])
@ -782,6 +881,16 @@ Phaser.Game.prototype = {
this.antialias = config['antialias']; this.antialias = config['antialias'];
} }
if (config['physicsConfig'])
{
this.physicsConfig = config['physicsConfig'];
}
if (config['seed'])
{
this.rnd = new Phaser.RandomDataGenerator(config['seed']);
}
var state = null; var state = null;
if (config['state']) if (config['state'])
@ -793,46 +902,6 @@ Phaser.Game.prototype = {
}, },
/**
* Get dimension.
*
* @method Phaser.Game#parseDimension
* @protected
*/
parseDimension: function (size, dimension) {
var f = 0;
var px = 0;
if (typeof size === 'string')
{
// %?
if (size.substr(-1) === '%')
{
f = parseInt(size, 10) / 100;
if (dimension === 0)
{
px = window.innerWidth * f;
}
else
{
px = window.innerHeight * f;
}
}
else
{
px = parseInt(size, 10);
}
}
else
{
px = size;
}
return px;
},
/** /**
* Initialize engine sub modules and start the game. * Initialize engine sub modules and start the game.
@ -858,26 +927,31 @@ Phaser.Game.prototype = {
this.onPause = new Phaser.Signal(); this.onPause = new Phaser.Signal();
this.onResume = new Phaser.Signal(); this.onResume = new Phaser.Signal();
this.onBlur = new Phaser.Signal();
this.onFocus = new Phaser.Signal();
this.isBooted = true; this.isBooted = true;
this.device = new Phaser.Device(); this.device = new Phaser.Device(this);
this.math = Phaser.Math; this.math = Phaser.Math;
this.rnd = new Phaser.RandomDataGenerator([(Date.now() * Math.random()).toString()]);
this.stage = new Phaser.Stage(this, this.width, this.height); this.stage = new Phaser.Stage(this, this.width, this.height);
this.scale = new Phaser.ScaleManager(this, this.width, this.height);
this.setUpRenderer(); this.setUpRenderer();
this.device.checkFullScreenSupport();
this.world = new Phaser.World(this); this.world = new Phaser.World(this);
this.add = new Phaser.GameObjectFactory(this); this.add = new Phaser.GameObjectFactory(this);
this.make = new Phaser.GameObjectCreator(this);
this.cache = new Phaser.Cache(this); this.cache = new Phaser.Cache(this);
this.load = new Phaser.Loader(this); this.load = new Phaser.Loader(this);
this.time = new Phaser.Time(this); this.time = new Phaser.Time(this);
this.tweens = new Phaser.TweenManager(this); this.tweens = new Phaser.TweenManager(this);
this.input = new Phaser.Input(this); this.input = new Phaser.Input(this);
this.sound = new Phaser.SoundManager(this); this.sound = new Phaser.SoundManager(this);
this.physics = new Phaser.Physics.Arcade(this); this.physics = new Phaser.Physics(this, this.physicsConfig);
this.particles = new Phaser.Particles(this); this.particles = new Phaser.Particles(this);
this.plugins = new Phaser.PluginManager(this, this); this.plugins = new Phaser.PluginManager(this, this);
this.net = new Phaser.Net(this); this.net = new Phaser.Net(this);
@ -889,17 +963,22 @@ Phaser.Game.prototype = {
this.input.boot(); this.input.boot();
this.sound.boot(); this.sound.boot();
this.state.boot(); this.state.boot();
this.debug.boot();
this.load.onLoadComplete.add(this.loadComplete, this);
this.showDebugHeader(); this.showDebugHeader();
this.isRunning = true; this.isRunning = true;
this._loadComplete = false;
this.raf = new Phaser.RequestAnimationFrame(this); if (this.config && this.config['forceSetTimeOut'])
{
this.raf = new Phaser.RequestAnimationFrame(this, this.config['forceSetTimeOut']);
}
else
{
this.raf = new Phaser.RequestAnimationFrame(this, false);
}
this.raf.start(); this.raf.start();
} }
}, },
@ -915,10 +994,12 @@ Phaser.Game.prototype = {
var v = Phaser.DEV_VERSION; var v = Phaser.DEV_VERSION;
var r = 'Canvas'; var r = 'Canvas';
var a = 'HTML Audio'; var a = 'HTML Audio';
var c = 1;
if (this.renderType == Phaser.WEBGL) if (this.renderType === Phaser.WEBGL)
{ {
r = 'WebGL'; r = 'WebGL';
c++;
} }
else if (this.renderType == Phaser.HEADLESS) else if (this.renderType == Phaser.HEADLESS)
{ {
@ -928,24 +1009,38 @@ Phaser.Game.prototype = {
if (this.device.webAudio) if (this.device.webAudio)
{ {
a = 'WebAudio'; a = 'WebAudio';
c++;
} }
if (this.device.chrome) if (this.device.chrome)
{ {
var args = [ var args = [
'%c %c %c Phaser v' + v + ' - Renderer: ' + r + ' - Audio: ' + a + ' %c %c ', '%c %c %c Phaser v' + v + ' - ' + r + ' - ' + a + ' %c %c ' + ' http://phaser.io %c %c ♥%c♥%c♥ ',
'background: #00bff3', 'background: #0cf300',
'background: #0072bc', 'background: #00bc17',
'color: #ffffff; background: #003471', 'color: #ffffff; background: #00711f;',
'background: #0072bc', 'background: #00bc17',
'background: #00bff3' 'background: #0cf300',
'background: #00bc17'
]; ];
for (var i = 0; i &lt; 3; i++)
{
if (i &lt; c)
{
args.push('color: #ff2424; background: #fff');
}
else
{
args.push('color: #959595; background: #fff');
}
}
console.log.apply(console, args); console.log.apply(console, args);
} }
else else
{ {
console.log('Phaser v' + v + ' - Renderer: ' + r + ' - Audio: ' + a); console.log('Phaser v' + v + ' - Renderer: ' + r + ' - Audio: ' + a + ' - http://phaser.io');
} }
}, },
@ -958,13 +1053,12 @@ Phaser.Game.prototype = {
*/ */
setUpRenderer: function () { setUpRenderer: function () {
/*
if (this.device.trident) if (this.device.trident)
{ {
// Pixi WebGL renderer on IE11 doesn't work correctly with masks, if you need them you may want to comment this block out // Pixi WebGL renderer on IE11 doesn't work correctly at the moment, the pre-multiplied alpha gets all washed out.
// So we're forcing canvas for now until this is fixed, sorry. It's got to be better than no game appearing at all, right?
this.renderType = Phaser.CANVAS; this.renderType = Phaser.CANVAS;
} }
*/
if (this.renderType === Phaser.HEADLESS || this.renderType === Phaser.CANVAS || (this.renderType === Phaser.AUTO && this.device.webGL === false)) if (this.renderType === Phaser.HEADLESS || this.renderType === Phaser.CANVAS || (this.renderType === Phaser.AUTO && this.device.webGL === false))
{ {
@ -975,9 +1069,7 @@ Phaser.Game.prototype = {
this.renderType = Phaser.CANVAS; this.renderType = Phaser.CANVAS;
} }
this.renderer = new PIXI.CanvasRenderer(this.width, this.height, this.stage.canvas, this.transparent); this.renderer = new PIXI.CanvasRenderer(this.width, this.height, this.canvas, this.transparent);
Phaser.Canvas.setSmoothingEnabled(this.renderer.context, this.antialias);
this.canvas = this.renderer.view;
this.context = this.renderer.context; this.context = this.renderer.context;
} }
else else
@ -989,32 +1081,22 @@ Phaser.Game.prototype = {
{ {
// They requested WebGL, and their browser supports it // They requested WebGL, and their browser supports it
this.renderType = Phaser.WEBGL; this.renderType = Phaser.WEBGL;
this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.stage.canvas, this.transparent, this.antialias); this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.canvas, this.transparent, this.antialias);
this.canvas = this.renderer.view;
this.context = null; this.context = null;
} }
Phaser.Canvas.addToDOM(this.renderer.view, this.parent, true); if (this.renderType !== Phaser.HEADLESS)
Phaser.Canvas.setTouchAction(this.renderer.view); {
this.stage.smoothed = this.antialias;
Phaser.Canvas.addToDOM(this.canvas, this.parent, true);
Phaser.Canvas.setTouchAction(this.canvas);
}
}, },
/** /**
* Called when the load has finished, after preload was run. * The core game loop when in a paused state.
*
* @method Phaser.Game#loadComplete
* @protected
*/
loadComplete: function () {
this._loadComplete = true;
this.state.loadComplete();
},
/**
* The core game loop.
* *
* @method Phaser.Game#update * @method Phaser.Game#update
* @protected * @protected
@ -1024,52 +1106,49 @@ Phaser.Game.prototype = {
this.time.update(time); this.time.update(time);
if (this._paused) if (!this._paused && !this.pendingStep)
{ {
this.renderer.render(this.stage._stage); if (this.stepping)
this.plugins.render(); {
this.state.render(); this.pendingStep = true;
}
this.debug.preUpdate();
this.physics.preUpdate();
this.state.preUpdate();
this.plugins.preUpdate();
this.stage.preUpdate();
this.stage.update();
this.tweens.update();
this.sound.update();
this.input.update();
this.state.update();
this.physics.update();
this.particles.update();
this.plugins.update();
this.stage.postUpdate();
this.plugins.postUpdate();
} }
else else
{ {
if (!this.pendingStep) this.debug.preUpdate();
{ }
if (this.stepping)
{
this.pendingStep = true;
}
this.plugins.preUpdate(); if (this.renderType != Phaser.HEADLESS)
this.world.preUpdate(); {
this.renderer.render(this.stage);
this.stage.update(); this.plugins.render();
this.tweens.update(); this.state.render();
this.sound.update(); this.plugins.postRender();
this.input.update();
this.state.update();
this.world.update();
this.particles.update();
this.plugins.update();
this.world.postUpdate();
this.plugins.postUpdate();
}
if (this.renderType !== Phaser.HEADLESS)
{
this.renderer.render(this.stage._stage);
this.plugins.render();
this.state.render();
this.plugins.postRender();
}
} }
}, },
/** /**
* Enable core game loop stepping. When enabled you must call game.step() directly (perhaps via a DOM button?) * Enable core game loop stepping. When enabled you must call game.step() directly (perhaps via a DOM button?)
* Calling step will advance the game loop by one frame. This is extremely useful to hard to track down errors! * Calling step will advance the game loop by one frame. This is extremely useful for hard to track down errors!
* *
* @method Phaser.Game#enableStep * @method Phaser.Game#enableStep
*/ */
@ -1116,8 +1195,8 @@ Phaser.Game.prototype = {
this.raf.stop(); this.raf.stop();
this.input.destroy(); this.input.destroy();
this.state.destroy(); this.state.destroy();
this.physics.destroy();
this.state = null; this.state = null;
this.cache = null; this.cache = null;
@ -1129,6 +1208,77 @@ Phaser.Game.prototype = {
this.world = null; this.world = null;
this.isBooted = false; this.isBooted = false;
},
/**
* Called by the Stage visibility handler.
*
* @method Phaser.Game#gamePaused
* @param {object} event - The DOM event that caused the game to pause, if any.
* @protected
*/
gamePaused: function (event) {
// If the game is already paused it was done via game code, so don't re-pause it
if (!this._paused)
{
this._paused = true;
this.time.gamePaused();
this.sound.setMute();
this.onPause.dispatch(event);
}
},
/**
* Called by the Stage visibility handler.
*
* @method Phaser.Game#gameResumed
* @param {object} event - The DOM event that caused the game to pause, if any.
* @protected
*/
gameResumed: function (event) {
// Game is paused, but wasn't paused via code, so resume it
if (this._paused && !this._codePaused)
{
this._paused = false;
this.time.gameResumed();
this.input.reset();
this.sound.unsetMute();
this.onResume.dispatch(event);
}
},
/**
* Called by the Stage visibility handler.
*
* @method Phaser.Game#focusLoss
* @param {object} event - The DOM event that caused the game to pause, if any.
* @protected
*/
focusLoss: function (event) {
this.onBlur.dispatch(event);
this.gamePaused(event);
},
/**
* Called by the Stage visibility handler.
*
* @method Phaser.Game#focusGain
* @param {object} event - The DOM event that caused the game to pause, if any.
* @protected
*/
focusGain: function (event) {
this.onFocus.dispatch(event);
this.gameResumed(event);
} }
}; };
@ -1154,6 +1304,9 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
if (this._paused === false) if (this._paused === false)
{ {
this._paused = true; this._paused = true;
this._codePaused = true;
this.sound.mute = true;
this.time.gamePaused();
this.onPause.dispatch(this); this.onPause.dispatch(this);
} }
} }
@ -1162,6 +1315,10 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
if (this._paused) if (this._paused)
{ {
this._paused = false; this._paused = false;
this._codePaused = false;
this.input.reset();
this.sound.mute = false;
this.time.gameResumed();
this.onResume.dispatch(this); this.onResume.dispatch(this);
} }
} }
@ -1194,7 +1351,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1221,6 +1378,9 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -0,0 +1,940 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: gameobjects/GameObjectCreator.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: gameobjects/GameObjectCreator.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* The Game Object Creator is a quick way to create all of the different sorts of core objects that Phaser uses, but not add them to the game world.
* Use the GameObjectFactory to create and add the objects into the world.
*
* @class Phaser.GameObjectCreator
* @constructor
* @param {Phaser.Game} game - A reference to the currently running game.
*/
Phaser.GameObjectCreator = function (game) {
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
*/
this.game = game;
/**
* @property {Phaser.World} world - A reference to the game world.
*/
this.world = this.game.world;
};
Phaser.GameObjectCreator.prototype = {
/**
* Create a new `Image` object. An Image is a light-weight object you can use to display anything that doesn't need physics or animation.
* It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics.
*
* @method Phaser.GameObjectCreator#image
* @param {number} x - X position of the image.
* @param {number} y - Y position of the image.
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
* @returns {Phaser.Sprite} the newly created sprite object.
*/
image: function (x, y, key, frame) {
return new Phaser.Image(this.game, x, y, key, frame);
},
/**
* Create a new Sprite with specific position and sprite sheet key.
*
* @method Phaser.GameObjectCreator#sprite
* @param {number} x - X position of the new sprite.
* @param {number} y - Y position of the new sprite.
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
* @returns {Phaser.Sprite} the newly created sprite object.
*/
sprite: function (x, y, key, frame) {
return new Phaser.Sprite(this.game, x, y, key, frame);
},
/**
* Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.
*
* @method Phaser.GameObjectCreator#tween
* @param {object} obj - Object the tween will be run on.
* @return {Phaser.Tween} The Tween object.
*/
tween: function (obj) {
return new Phaser.Tween(obj, this.game);
},
/**
* A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
*
* @method Phaser.GameObjectCreator#group
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
* @param {boolean} [enableBody=false] - If true all Sprites created with `Group.create` or `Group.createMulitple` will have a physics body created on them. Change the body type with physicsBodyType.
* @param {number} [physicsBodyType=0] - If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.
* @return {Phaser.Group} The newly created group.
*/
group: function (parent, name, addToStage, enableBody, physicsBodyType) {
return new Phaser.Group(this.game, null, name, addToStage, enableBody, physicsBodyType);
},
/**
* A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
*
* @method Phaser.GameObjectCreator#spriteBatch
* @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
* @return {Phaser.Group} The newly created group.
*/
spriteBatch: function (parent, name, addToStage) {
if (typeof name === 'undefined') { name = 'group'; }
if (typeof addToStage === 'undefined') { addToStage = false; }
return new Phaser.SpriteBatch(this.game, parent, name, addToStage);
},
/**
* Creates a new Sound object.
*
* @method Phaser.GameObjectCreator#audio
* @param {string} key - The Game.cache key of the sound that this object will use.
* @param {number} [volume=1] - The volume at which the sound will be played.
* @param {boolean} [loop=false] - Whether or not the sound will loop.
* @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.
* @return {Phaser.Sound} The newly created text object.
*/
audio: function (key, volume, loop, connect) {
return this.game.sound.add(key, volume, loop, connect);
},
/**
* Creates a new Sound object.
*
* @method Phaser.GameObjectCreator#sound
* @param {string} key - The Game.cache key of the sound that this object will use.
* @param {number} [volume=1] - The volume at which the sound will be played.
* @param {boolean} [loop=false] - Whether or not the sound will loop.
* @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.
* @return {Phaser.Sound} The newly created text object.
*/
sound: function (key, volume, loop, connect) {
return this.game.sound.add(key, volume, loop, connect);
},
/**
* Creates a new TileSprite object.
*
* @method Phaser.GameObjectCreator#tileSprite
* @param {number} x - The x coordinate (in world space) to position the TileSprite at.
* @param {number} y - The y coordinate (in world space) to position the TileSprite at.
* @param {number} width - The width of the TileSprite.
* @param {number} height - The height of the TileSprite.
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the TileSprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {string|number} frame - If this TileSprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
* @return {Phaser.TileSprite} The newly created tileSprite object.
*/
tileSprite: function (x, y, width, height, key, frame) {
return new Phaser.TileSprite(this.game, x, y, width, height, key, frame);
},
/**
* Creates a new Text object.
*
* @method Phaser.GameObjectCreator#text
* @param {number} x - X position of the new text object.
* @param {number} y - Y position of the new text object.
* @param {string} text - The actual text that will be written.
* @param {object} style - The style object containing style attributes like font, font size , etc.
* @return {Phaser.Text} The newly created text object.
*/
text: function (x, y, text, style) {
return new Phaser.Text(this.game, x, y, text, style);
},
/**
* Creates a new Button object.
*
* @method Phaser.GameObjectCreator#button
* @param {number} [x] X position of the new button object.
* @param {number} [y] Y position of the new button object.
* @param {string} [key] The image key as defined in the Game.Cache to use as the texture for this button.
* @param {function} [callback] The function to call when this button is pressed
* @param {object} [callbackContext] The context in which the callback will be called (usually 'this')
* @param {string|number} [overFrame] This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.
* @param {string|number} [outFrame] This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.
* @param {string|number} [downFrame] This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
* @param {string|number} [upFrame] This is the frame or frameName that will be set when this button is in an up state. Give either a number to use a frame ID or a string for a frame name.
* @return {Phaser.Button} The newly created button object.
*/
button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame) {
return new Phaser.Button(this.game, x, y, key, callback, callbackContext, overFrame, outFrame, downFrame, upFrame);
},
/**
* Creates a new Graphics object.
*
* @method Phaser.GameObjectCreator#graphics
* @param {number} x - X position of the new graphics object.
* @param {number} y - Y position of the new graphics object.
* @return {Phaser.Graphics} The newly created graphics object.
*/
graphics: function (x, y) {
return new Phaser.Graphics(this.game, x, y);
},
/**
* Emitter is a lightweight particle emitter. It can be used for one-time explosions or for
* continuous effects like rain and fire. All it really does is launch Particle objects out
* at set intervals, and fixes their positions and velocities accorindgly.
*
* @method Phaser.GameObjectCreator#emitter
* @param {number} [x=0] - The x coordinate within the Emitter that the particles are emitted from.
* @param {number} [y=0] - The y coordinate within the Emitter that the particles are emitted from.
* @param {number} [maxParticles=50] - The total number of particles in this emitter.
* @return {Phaser.Emitter} The newly created emitter object.
*/
emitter: function (x, y, maxParticles) {
return new Phaser.Particles.Arcade.Emitter(this.game, x, y, maxParticles);
},
/**
* Create a new RetroFont object to be used as a texture for an Image or Sprite and optionally add it to the Cache.
* A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set.
* If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText
* is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text.
* The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all,
* i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects.
*
* @method Phaser.GameObjectCreator#retroFont
* @param {string} font - The key of the image in the Game.Cache that the RetroFont will use.
* @param {number} characterWidth - The width of each character in the font set.
* @param {number} characterHeight - The height of each character in the font set.
* @param {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.
* @param {number} charsPerRow - The number of characters per row in the font set.
* @param {number} [xSpacing=0] - If the characters in the font set have horizontal spacing between them set the required amount here.
* @param {number} [ySpacing=0] - If the characters in the font set have vertical spacing between them set the required amount here.
* @param {number} [xOffset=0] - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.
* @param {number} [yOffset=0] - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.
* @return {Phaser.RetroFont} The newly created RetroFont texture which can be applied to an Image or Sprite.
*/
retroFont: function (font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset) {
return new Phaser.RetroFont(this.game, font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset);
},
/**
* Create a new BitmapText object.
*
* @method Phaser.GameObjectCreator#bitmapText
* @param {number} x - X position of the new bitmapText object.
* @param {number} y - Y position of the new bitmapText object.
* @param {string} font - The key of the BitmapText font as stored in Game.Cache.
* @param {string} [text] - The actual text that will be rendered. Can be set later via BitmapText.text.
* @param {number} [size] - The size the font will be rendered in, in pixels.
* @return {Phaser.BitmapText} The newly created bitmapText object.
*/
bitmapText: function (x, y, font, text, size) {
return new Phaser.BitmapText(this.game, x, y, font, text, size);
},
/**
* Creates a new Phaser.Tilemap object. The map can either be populated with data from a Tiled JSON file or from a CSV file.
* To do this pass the Cache key as the first parameter. When using Tiled data you need only provide the key.
* When using CSV data you must provide the key and the tileWidth and tileHeight parameters.
* If creating a blank tilemap to be populated later, you can either specify no parameters at all and then use `Tilemap.create` or pass the map and tile dimensions here.
* Note that all Tilemaps use a base tile size to calculate dimensions from, but that a TilemapLayer may have its own unique tile size that overrides it.
*
* @method Phaser.GameObjectCreator#tilemap
* @param {string} [key] - The key of the tilemap data as stored in the Cache. If you're creating a blank map either leave this parameter out or pass `null`.
* @param {number} [tileWidth=32] - The pixel width of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
* @param {number} [tileHeight=32] - The pixel height of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
* @param {number} [width=10] - The width of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.
* @param {number} [height=10] - The height of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.
*/
tilemap: function (key, tileWidth, tileHeight, width, height) {
return new Phaser.Tilemap(this.game, key, tileWidth, tileHeight, width, height);
},
/**
* A dynamic initially blank canvas to which images can be drawn.
*
* @method Phaser.GameObjectCreator#renderTexture
* @param {number} [width=100] - the width of the RenderTexture.
* @param {number} [height=100] - the height of the RenderTexture.
* @param {string} [key=''] - Asset key for the RenderTexture when stored in the Cache (see addToCache parameter).
* @param {boolean} [addToCache=false] - Should this RenderTexture be added to the Game.Cache? If so you can retrieve it with Cache.getTexture(key)
* @return {Phaser.RenderTexture} The newly created RenderTexture object.
*/
renderTexture: function (width, height, key, addToCache) {
if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); }
if (typeof addToCache === 'undefined') { addToCache = false; }
var texture = new Phaser.RenderTexture(this.game, width, height, key);
if (addToCache)
{
this.game.cache.addRenderTexture(key, texture);
}
return texture;
},
/**
* A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites.
*
* @method Phaser.GameObjectCreator#bitmapData
* @param {number} [width=100] - The width of the BitmapData in pixels.
* @param {number} [height=100] - The height of the BitmapData in pixels.
* @param {string} [key=''] - Asset key for the BitmapData when stored in the Cache (see addToCache parameter).
* @param {boolean} [addToCache=false] - Should this BitmapData be added to the Game.Cache? If so you can retrieve it with Cache.getBitmapData(key)
* @return {Phaser.BitmapData} The newly created BitmapData object.
*/
bitmapData: function (width, height, key, addToCache) {
if (typeof addToCache === 'undefined') { addToCache = false; }
if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); }
var texture = new Phaser.BitmapData(this.game, key, width, height);
if (addToCache)
{
this.game.cache.addBitmapData(key, texture);
}
return texture;
},
/**
* A WebGL shader/filter that can be applied to Sprites.
*
* @method Phaser.GameObjectCreator#filter
* @param {string} filter - The name of the filter you wish to create, for example HueRotate or SineWave.
* @param {any} - Whatever parameters are needed to be passed to the filter init function.
* @return {Phaser.Filter} The newly created Phaser.Filter object.
*/
filter: function (filter) {
var args = Array.prototype.splice.call(arguments, 1);
var filter = new Phaser.Filter[filter](this.game);
filter.init.apply(filter, args);
return filter;
}
};
Phaser.GameObjectCreator.prototype.constructor = Phaser.GameObjectCreator;
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -470,6 +548,26 @@ Phaser.GameObjectFactory.prototype = {
}, },
/**
* Create a new `Image` object. An Image is a light-weight object you can use to display anything that doesn't need physics or animation.
* It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics.
*
* @method Phaser.GameObjectFactory#image
* @param {number} x - X position of the image.
* @param {number} y - Y position of the image.
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
* @returns {Phaser.Sprite} the newly created sprite object.
*/
image: function (x, y, key, frame, group) {
if (typeof group === 'undefined') { group = this.world; }
return group.add(new Phaser.Image(this.game, x, y, key, frame));
},
/** /**
* Create a new Sprite with specific position and sprite sheet key. * Create a new Sprite with specific position and sprite sheet key.
* *
@ -489,30 +587,12 @@ Phaser.GameObjectFactory.prototype = {
}, },
/**
* DEPRECATED - will be removed in Phaser 1.2
* Create a new Sprite with specific position and sprite sheet key that will automatically be added as a child of the given parent.
*
* @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.
* @param {string|RenderTexture} [key] - The image key as defined in the Game.Cache to use as the texture for this sprite OR a RenderTexture.
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
* @returns {Phaser.Sprite} the newly created sprite object.
*/
child: function (group, x, y, key, frame) {
return group.create(x, y, key, frame);
},
/** /**
* Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite.
* *
* @method Phaser.GameObjectFactory#tween * @method Phaser.GameObjectFactory#tween
* @param {object} obj - Object the tween will be run on. * @param {object} obj - Object the tween will be run on.
* @return {Phaser.Tween} Description. * @return {Phaser.Tween} The newly created Phaser.Tween object.
*/ */
tween: function (obj) { tween: function (obj) {
@ -524,13 +604,52 @@ Phaser.GameObjectFactory.prototype = {
* A Group is a container for display objects that allows for fast pooling, recycling and collision checks. * A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
* *
* @method Phaser.GameObjectFactory#group * @method Phaser.GameObjectFactory#group
* @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any. * @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging. * @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
* @param {boolean} [enableBody=false] - If true all Sprites created with `Group.create` or `Group.createMulitple` will have a physics body created on them. Change the body type with physicsBodyType.
* @param {number} [physicsBodyType=0] - If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.
* @return {Phaser.Group} The newly created group. * @return {Phaser.Group} The newly created group.
*/ */
group: function (parent, name) { group: function (parent, name, addToStage, enableBody, physicsBodyType) {
return new Phaser.Group(this.game, parent, name); return new Phaser.Group(this.game, parent, name, addToStage, enableBody, physicsBodyType);
},
/**
* A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
* A Physics Group is the same as an ordinary Group except that is has enableBody turned on by default, so any Sprites it creates
* are automatically given a physics body.
*
* @method Phaser.GameObjectFactory#group
* @param {number} [physicsBodyType=Phaser.Physics.ARCADE] - If enableBody is true this is the type of physics body that is created on new Sprites. Phaser.Physics.ARCADE, Phaser.Physics.P2, Phaser.Physics.NINJA, etc.
* @param {any} [parent] - The parent Group or DisplayObjectContainer that will hold this group, if any. If set to null the Group won't be added to the display list. If undefined it will be added to World by default.
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
* @return {Phaser.Group} The newly created group.
*/
physicsGroup: function (physicsBodyType, parent, name, addToStage) {
return new Phaser.Group(this.game, parent, name, addToStage, true, physicsBodyType);
},
/**
* A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
*
* @method Phaser.GameObjectFactory#spriteBatch
* @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @param {boolean} [addToStage=false] - If set to true this Group will be added directly to the Game.Stage instead of Game.World.
* @return {Phaser.Group} The newly created group.
*/
spriteBatch: function (parent, name, addToStage) {
if (typeof name === 'undefined') { name = 'group'; }
if (typeof addToStage === 'undefined') { addToStage = false; }
return new Phaser.SpriteBatch(this.game, parent, name, addToStage);
}, },
@ -570,19 +689,20 @@ Phaser.GameObjectFactory.prototype = {
* Creates a new TileSprite object. * Creates a new TileSprite object.
* *
* @method Phaser.GameObjectFactory#tileSprite * @method Phaser.GameObjectFactory#tileSprite
* @param {number} x - X position of the new tileSprite. * @param {number} x - The x coordinate (in world space) to position the TileSprite at.
* @param {number} y - Y position of the new tileSprite. * @param {number} y - The y coordinate (in world space) to position the TileSprite at.
* @param {number} width - the width of the tilesprite. * @param {number} width - The width of the TileSprite.
* @param {number} height - the height of the tilesprite. * @param {number} height - The height of the TileSprite.
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. * @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the TileSprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
* @param {string|number} frame - If this TileSprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group. * @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
* @return {Phaser.TileSprite} The newly created tileSprite object. * @return {Phaser.TileSprite} The newly created tileSprite object.
*/ */
tileSprite: function (x, y, width, height, key, group) { tileSprite: function (x, y, width, height, key, frame, group) {
if (typeof group === 'undefined') { group = this.world; } if (typeof group === 'undefined') { group = this.world; }
return group.add(new Phaser.TileSprite(this.game, x, y, width, height, key)); return group.add(new Phaser.TileSprite(this.game, x, y, width, height, key, frame));
}, },
@ -664,35 +784,69 @@ Phaser.GameObjectFactory.prototype = {
}, },
/** /**
* * Create a new BitmapText object. * Create a new RetroFont object to be used as a texture for an Image or Sprite and optionally add it to the Cache.
* A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set.
* If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText
* is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text.
* The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all,
* i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects.
* *
* @method Phaser.GameObjectFactory#bitmapText * @method Phaser.GameObjectFactory#retroFont
* @param {number} x - X position of the new bitmapText object. * @param {string} font - The key of the image in the Game.Cache that the RetroFont will use.
* @param {number} y - Y position of the new bitmapText object. * @param {number} characterWidth - The width of each character in the font set.
* @param {string} text - The actual text that will be written. * @param {number} characterHeight - The height of each character in the font set.
* @param {object} style - The style object containing style attributes like font, font size , etc. * @param {string} chars - The characters used in the font set, in display order. You can use the TEXT_SET consts for common font set arrangements.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group. * @param {number} charsPerRow - The number of characters per row in the font set.
* @return {Phaser.BitmapText} The newly created bitmapText object. * @param {number} [xSpacing=0] - If the characters in the font set have horizontal spacing between them set the required amount here.
* @param {number} [ySpacing=0] - If the characters in the font set have vertical spacing between them set the required amount here.
* @param {number} [xOffset=0] - If the font set doesn't start at the top left of the given image, specify the X coordinate offset here.
* @param {number} [yOffset=0] - If the font set doesn't start at the top left of the given image, specify the Y coordinate offset here.
* @return {Phaser.RetroFont} The newly created RetroFont texture which can be applied to an Image or Sprite.
*/ */
bitmapText: function (x, y, text, style, group) { retroFont: function (font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset) {
if (typeof group === 'undefined') { group = this.world; } return new Phaser.RetroFont(this.game, font, characterWidth, characterHeight, chars, charsPerRow, xSpacing, ySpacing, xOffset, yOffset);
return this.world.add(new Phaser.BitmapText(this.game, x, y, text, style));
}, },
/** /**
* Creates a new Tilemap object. * Create a new BitmapText object.
*
* @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} font - The key of the BitmapText font as stored in Game.Cache.
* @param {string} [text] - The actual text that will be rendered. Can be set later via BitmapText.text.
* @param {number} [size] - The size the font will be rendered in, in pixels.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
* @return {Phaser.BitmapText} The newly created bitmapText object.
*/
bitmapText: function (x, y, font, text, size, group) {
if (typeof group === 'undefined') { group = this.world; }
return group.add(new Phaser.BitmapText(this.game, x, y, font, text, size));
},
/**
* Creates a new Phaser.Tilemap object. The map can either be populated with data from a Tiled JSON file or from a CSV file.
* To do this pass the Cache key as the first parameter. When using Tiled data you need only provide the key.
* When using CSV data you must provide the key and the tileWidth and tileHeight parameters.
* If creating a blank tilemap to be populated later, you can either specify no parameters at all and then use `Tilemap.create` or pass the map and tile dimensions here.
* Note that all Tilemaps use a base tile size to calculate dimensions from, but that a TilemapLayer may have its own unique tile size that overrides it.
* *
* @method Phaser.GameObjectFactory#tilemap * @method Phaser.GameObjectFactory#tilemap
* @param {string} key - Asset key for the JSON or CSV map data in the cache. * @param {string} [key] - The key of the tilemap data as stored in the Cache. If you're creating a blank map either leave this parameter out or pass `null`.
* @param {object|string} tilesets - An object mapping Cache.tileset keys with the tileset names in the JSON file. If a string is provided that will be used. * @param {number} [tileWidth=32] - The pixel width of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
* @param {number} [tileHeight=32] - The pixel height of a single map tile. If using CSV data you must specify this. Not required if using Tiled map data.
* @param {number} [width=10] - The width of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.
* @param {number} [height=10] - The height of the map in tiles. If this map is created from Tiled or CSV data you don't need to specify this.
* @return {Phaser.Tilemap} The newly created tilemap object. * @return {Phaser.Tilemap} The newly created tilemap object.
*/ */
tilemap: function (key, tilesets) { tilemap: function (key, tileWidth, tileHeight, width, height) {
return new Phaser.Tilemap(this.game, key, tilesets); return new Phaser.Tilemap(this.game, key, tileWidth, tileHeight, width, height);
}, },
@ -700,32 +854,51 @@ 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 Phaser.GameObjectFactory#renderTexture * @method Phaser.GameObjectFactory#renderTexture
* @param {string} key - Asset key for the render texture. * @param {number} [width=100] - the width of the RenderTexture.
* @param {number} width - the width of the render texture. * @param {number} [height=100] - the height of the RenderTexture.
* @param {number} height - the height of the render texture. * @param {string} [key=''] - Asset key for the RenderTexture when stored in the Cache (see addToCache parameter).
* @return {Phaser.RenderTexture} The newly created renderTexture object. * @param {boolean} [addToCache=false] - Should this RenderTexture be added to the Game.Cache? If so you can retrieve it with Cache.getTexture(key)
* @return {Phaser.RenderTexture} The newly created RenderTexture object.
*/ */
renderTexture: function (key, width, height) { renderTexture: function (width, height, key, addToCache) {
var texture = new Phaser.RenderTexture(this.game, key, width, height); if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); }
if (typeof addToCache === 'undefined') { addToCache = false; }
this.game.cache.addRenderTexture(key, texture); var texture = new Phaser.RenderTexture(this.game, width, height, key);
if (addToCache)
{
this.game.cache.addRenderTexture(key, texture);
}
return texture; return texture;
}, },
/** /**
* Experimental: A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites. * A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites.
* *
* @method Phaser.GameObjectFactory#bitmapData * @method Phaser.GameObjectFactory#bitmapData
* @param {number} [width=256] - The width of the BitmapData in pixels. * @param {number} [width=100] - The width of the BitmapData in pixels.
* @param {number} [height=256] - The height of the BitmapData in pixels. * @param {number} [height=100] - The height of the BitmapData in pixels.
* @param {string} [key=''] - Asset key for the BitmapData when stored in the Cache (see addToCache parameter).
* @param {boolean} [addToCache=false] - Should this BitmapData be added to the Game.Cache? If so you can retrieve it with Cache.getBitmapData(key)
* @return {Phaser.BitmapData} The newly created BitmapData object. * @return {Phaser.BitmapData} The newly created BitmapData object.
*/ */
bitmapData: function (width, height) { bitmapData: function (width, height, key, addToCache) {
return new Phaser.BitmapData(this.game, width, height); if (typeof addToCache === 'undefined') { addToCache = false; }
if (typeof key === 'undefined' || key === '') { key = this.game.rnd.uuid(); }
var texture = new Phaser.BitmapData(this.game, key, width, height);
if (addToCache)
{
this.game.cache.addBitmapData(key, texture);
}
return texture;
}, },
@ -773,7 +946,7 @@ Phaser.GameObjectFactory.prototype.constructor = Phaser.GameObjectFactory;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -800,6 +973,9 @@ Phaser.GameObjectFactory.prototype.constructor = Phaser.GameObjectFactory;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -498,7 +576,7 @@ Phaser.Gamepad = function (game) {
* @property {boolean} _gamepadSupportAvailable - Are gamepads supported in this browser or not? * @property {boolean} _gamepadSupportAvailable - Are gamepads supported in this browser or not?
* @private * @private
*/ */
this._gamepadSupportAvailable = !!navigator.webkitGetGamepads || !!navigator.webkitGamepads || (navigator.userAgent.indexOf('Firefox/') != -1); this._gamepadSupportAvailable = !!navigator.webkitGetGamepads || !!navigator.webkitGamepads || (navigator.userAgent.indexOf('Firefox/') != -1) || !!navigator.getGamepads;
/** /**
* Used to check for differences between earlier polls and current state of gamepads. * Used to check for differences between earlier polls and current state of gamepads.
@ -651,7 +729,7 @@ Phaser.Gamepad.prototype = {
*/ */
_pollGamepads: function () { _pollGamepads: function () {
var rawGamepads = (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) || navigator.webkitGamepads; var rawGamepads = (navigator.webkitGetGamepads && navigator.webkitGetGamepads()) || navigator.webkitGamepads || navigator.getGamepads;
if (rawGamepads) if (rawGamepads)
{ {
@ -1028,7 +1106,7 @@ Phaser.Gamepad.XBOX360_STICK_RIGHT_Y = 3;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1055,6 +1133,9 @@ Phaser.Gamepad.XBOX360_STICK_RIGHT_Y = 3;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -459,7 +537,7 @@ Phaser.GamepadButton = function (game, buttoncode) {
* @property {boolean} isUp - The "up" state of the button. * @property {boolean} isUp - The "up" state of the button.
* @default * @default
*/ */
this.isUp = false; this.isUp = true;
/** /**
* @property {number} timeDown - The timestamp when the button was last pressed down. * @property {number} timeDown - The timestamp when the button was last pressed down.
@ -625,7 +703,7 @@ Phaser.GamepadButton.prototype.constructor = Phaser.GamepadButton;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -652,6 +730,9 @@ Phaser.GamepadButton.prototype.constructor = Phaser.GamepadButton;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

615
docs/GearConstraint.js.html Normal file
View file

@ -0,0 +1,615 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: physics/p2/GearConstraint.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: physics/p2/GearConstraint.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Connects two bodies at given offset points, letting them rotate relative to each other around this point.
*
* @class Phaser.Physics.P2.GearConstraint
* @classdesc Physics GearConstraint Constructor
* @constructor
* @param {Phaser.Physics.P2} world - A reference to the P2 World.
* @param {p2.Body} bodyA - First connected body.
* @param {p2.Body} bodyB - Second connected body.
* @param {number} [angle=0] - The relative angle
* @param {number} [ratio=1] - The gear ratio.
*/
Phaser.Physics.P2.GearConstraint = function (world, bodyA, bodyB, angle, ratio) {
if (typeof angle === 'undefined') { angle = 0; }
if (typeof ratio === 'undefined') { ratio = 1; }
/**
* @property {Phaser.Game} game - Local reference to game.
*/
this.game = world.game;
/**
* @property {Phaser.Physics.P2} world - Local reference to P2 World.
*/
this.world = world;
var options = { angle: angle, ratio: ratio };
p2.GearConstraint.call(this, bodyA, bodyB, options);
}
Phaser.Physics.P2.GearConstraint.prototype = Object.create(p2.GearConstraint.prototype);
Phaser.Physics.P2.GearConstraint.prototype.constructor = Phaser.Physics.P2.GearConstraint;
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:18 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -447,43 +525,181 @@
*/ */
Phaser.Graphics = function (game, x, y) { Phaser.Graphics = function (game, x, y) {
x = x || 0;
y = y || 0;
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
*/
this.game = game; this.game = game;
/**
* @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop.
* @default
*/
this.exists = true;
/**
* @property {string} name - The user defined name given to this object.
* @default
*/
this.name = '';
/**
* @property {number} type - The const type of this object.
* @default
*/
this.type = Phaser.GRAPHICS;
/**
* @property {number} z - The z-depth value of this object within its Group (remember the World is a Group as well). No two objects in a Group can have the same z value.
*/
this.z = 0;
/**
* @property {Phaser.Point} world - The world coordinates of this Sprite. This differs from the x/y coordinates which are relative to the Sprites container.
*/
this.world = new Phaser.Point(x, y);
/**
* @property {Phaser.Point} cameraOffset - If this object is fixedToCamera then this stores the x/y offset that its drawn at, from the top-left of the camera view.
*/
this.cameraOffset = new Phaser.Point();
PIXI.Graphics.call(this); PIXI.Graphics.call(this);
/** this.position.set(x, y);
* @property {number} type - The Phaser Object Type.
*/
this.type = Phaser.GRAPHICS;
this.position.x = x; /**
this.position.y = y; * A small internal cache:
* 0 = previous position.x
* 1 = previous position.y
* 2 = previous rotation
* 3 = renderID
* 4 = fresh? (0 = no, 1 = yes)
* 5 = outOfBoundsFired (0 = no, 1 = yes)
* 6 = exists (0 = no, 1 = yes)
* 7 = fixed to camera (0 = no, 1 = yes)
* @property {Int16Array} _cache
* @private
*/
this._cache = new Int16Array([0, 0, 0, 0, 1, 0, 1, 0]);
}; };
Phaser.Graphics.prototype = Object.create(PIXI.Graphics.prototype); Phaser.Graphics.prototype = Object.create(PIXI.Graphics.prototype);
Phaser.Graphics.prototype.constructor = Phaser.Graphics; Phaser.Graphics.prototype.constructor = Phaser.Graphics;
/**
* Automatically called by World.preUpdate.
* @method Phaser.Graphics.prototype.preUpdate
*/
Phaser.Graphics.prototype.preUpdate = function () {
this._cache[0] = this.world.x;
this._cache[1] = this.world.y;
this._cache[2] = this.rotation;
if (!this.exists || !this.parent.exists)
{
this.renderOrderID = -1;
return false;
}
if (this.autoCull)
{
// Won't get rendered but will still get its transform updated
this.renderable = this.game.world.camera.screenView.intersects(this.getBounds());
}
this.world.setTo(this.game.camera.x + this.worldTransform[2], this.game.camera.y + this.worldTransform[5]);
if (this.visible)
{
this._cache[3] = this.game.stage.currentRenderOrderID++;
}
return true;
}
/**
* Override and use this function in your own custom objects to handle any update requirements you may have.
*
* @method Phaser.Graphics#update
* @memberof Phaser.Graphics
*/
Phaser.Graphics.prototype.update = function() {
}
/**
* Automatically called by World.postUpdate.
* @method Phaser.Graphics.prototype.postUpdate
*/
Phaser.Graphics.prototype.postUpdate = function () {
// Fixed to Camera?
if (this._cache[7] === 1)
{
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
}
}
/** /**
* Destroy this Graphics instance. * Destroy this Graphics instance.
* *
* @method Phaser.Graphics.prototype.destroy * @method Phaser.Graphics.prototype.destroy
* @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called?
*/ */
Phaser.Graphics.prototype.destroy = function() { Phaser.Graphics.prototype.destroy = function(destroyChildren) {
if (typeof destroyChildren === 'undefined') { destroyChildren = true; }
this.clear(); this.clear();
if (this.group) if (this.parent)
{ {
this.group.remove(this); if (this.parent instanceof Phaser.Group)
{
this.parent.remove(this);
}
else
{
this.parent.removeChild(this);
}
} }
var i = this.children.length;
if (destroyChildren)
{
while (i--)
{
this.children[i].destroy(destroyChildren);
}
}
else
{
while (i--)
{
this.removeChild(this.children[i]);
}
}
this.exists = false;
this.visible = false;
this.game = null; this.game = null;
} }
/* /*
* Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled * Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled
*
* @method Phaser.Graphics.prototype.drawPolygon
*/ */
Phaser.Graphics.prototype.drawPolygon = function (poly) { Phaser.Graphics.prototype.drawPolygon = function (poly) {
@ -498,38 +714,52 @@ Phaser.Graphics.prototype.drawPolygon = function (poly) {
} }
/**
* Indicates the rotation of the Graphics, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
* Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90.
* If you wish to work in radians instead of degrees use the property Sprite.rotation instead.
* @name Phaser.Graphics#angle
* @property {number} angle - Gets or sets the angle of rotation in degrees.
*/
Object.defineProperty(Phaser.Graphics.prototype, 'angle', { Object.defineProperty(Phaser.Graphics.prototype, 'angle', {
get: function() { get: function() {
return Phaser.Math.wrapAngle(Phaser.Math.radToDeg(this.rotation)); return Phaser.Math.radToDeg(this.rotation);
}, },
set: function(value) { set: function(value) {
this.rotation = Phaser.Math.degToRad(Phaser.Math.wrapAngle(value)); this.rotation = Phaser.Math.degToRad(value);
} }
}); });
Object.defineProperty(Phaser.Graphics.prototype, 'x', { /**
* An Graphics that is fixed to the camera uses its x/y coordinates as offsets from the top left of the camera. These are stored in Graphics.cameraOffset.
* Note that the cameraOffset values are in addition to any parent in the display list.
* So if this Graphics was in a Group that has x: 200, then this will be added to the cameraOffset.x
*
* @name Phaser.Graphics#fixedToCamera
* @property {boolean} fixedToCamera - Set to true to fix this Graphics to the Camera at its current world coordinates.
*/
Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", {
get: function () {
return !!this._cache[7];
get: function() {
return this.position.x;
}, },
set: function(value) { set: function (value) {
this.position.x = value;
}
}); if (value)
{
Object.defineProperty(Phaser.Graphics.prototype, 'y', { this._cache[7] = 1;
this.cameraOffset.set(this.x, this.y);
get: function() { }
return this.position.y; else
}, {
this._cache[7] = 0;
set: function(value) { }
this.position.y = value;
} }
}); });
@ -554,7 +784,7 @@ Object.defineProperty(Phaser.Graphics.prototype, 'y', {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -581,6 +811,9 @@ Object.defineProperty(Phaser.Graphics.prototype, 'y', {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

File diff suppressed because it is too large Load diff

1340
docs/Image.js.html Normal file

File diff suppressed because it is too large Load diff

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -471,7 +549,263 @@ Phaser.Input = function (game) {
* @property {object} moveCallbackContext - The context in which the moveCallback will be sent. Defaults to Phaser.Input but can be set to any valid JS object. * @property {object} moveCallbackContext - The context in which the moveCallback will be sent. Defaults to Phaser.Input but can be set to any valid JS object.
*/ */
this.moveCallbackContext = this; this.moveCallbackContext = this;
/**
* @property {number} pollRate - How often should the input pointers be checked for updates? A value of 0 means every single frame (60fps); a value of 1 means every other frame (30fps) and so on.
* @default
*/
this.pollRate = 0;
/**
* You can disable all Input by setting Input.disabled = true. While set all new input related events will be ignored.
* If you need to disable just one type of input; for example mouse; use Input.mouse.disabled = true instead
* @property {boolean} disabled
* @default
*/
this.disabled = false;
/**
* @property {number} multiInputOverride - Controls the expected behaviour when using a mouse and touch together on a multi-input device.
* @default
*/
this.multiInputOverride = Phaser.Input.MOUSE_TOUCH_COMBINE;
/**
* @property {Phaser.Point} position - A point object representing the current position of the Pointer.
* @default
*/
this.position = null;
/**
* @property {Phaser.Point} speed - A point object representing the speed of the Pointer. Only really useful in single Pointer games; otherwise see the Pointer objects directly.
*/
this.speed = null;
/**
* A Circle object centered on the x/y screen coordinates of the Input.
* Default size of 44px (Apples recommended "finger tip" size) but can be changed to anything.
* @property {Phaser.Circle} circle
*/
this.circle = null;
/**
* @property {Phaser.Point} scale - The scale by which all input coordinates are multiplied; calculated by the ScaleManager. In an un-scaled game the values will be x = 1 and y = 1.
*/
this.scale = null;
/**
* @property {number} maxPointers - The maximum number of Pointers allowed to be active at any one time. For lots of games it's useful to set this to 1.
* @default
*/
this.maxPointers = 10;
/**
* @property {number} currentPointers - The current number of active Pointers.
* @default
*/
this.currentPointers = 0;
/**
* @property {number} tapRate - The number of milliseconds that the Pointer has to be pressed down and then released to be considered a tap or click.
* @default
*/
this.tapRate = 200;
/**
* @property {number} doubleTapRate - The number of milliseconds between taps of the same Pointer for it to be considered a double tap / click.
* @default
*/
this.doubleTapRate = 300;
/**
* @property {number} holdRate - The number of milliseconds that the Pointer has to be pressed down for it to fire a onHold event.
* @default
*/
this.holdRate = 2000;
/**
* @property {number} justPressedRate - The number of milliseconds below which the Pointer is considered justPressed.
* @default
*/
this.justPressedRate = 200;
/**
* @property {number} justReleasedRate - The number of milliseconds below which the Pointer is considered justReleased .
* @default
*/
this.justReleasedRate = 200;
/**
* Sets if the Pointer objects should record a history of x/y coordinates they have passed through.
* The history is cleared each time the Pointer is pressed down.
* The history is updated at the rate specified in Input.pollRate
* @property {boolean} recordPointerHistory
* @default
*/
this.recordPointerHistory = false;
/**
* @property {number} recordRate - The rate in milliseconds at which the Pointer objects should update their tracking history.
* @default
*/
this.recordRate = 100;
/**
* The total number of entries that can be recorded into the Pointer objects tracking history.
* If the Pointer is tracking one event every 100ms; then a trackLimit of 100 would store the last 10 seconds worth of history.
* @property {number} recordLimit
* @default
*/
this.recordLimit = 100;
/**
* @property {Phaser.Pointer} pointer1 - A Pointer object.
*/
this.pointer1 = null;
/**
* @property {Phaser.Pointer} pointer2 - A Pointer object.
*/
this.pointer2 = null;
/**
* @property {Phaser.Pointer} pointer3 - A Pointer object.
*/
this.pointer3 = null;
/**
* @property {Phaser.Pointer} pointer4 - A Pointer object.
*/
this.pointer4 = null;
/**
* @property {Phaser.Pointer} pointer5 - A Pointer object.
*/
this.pointer5 = null;
/**
* @property {Phaser.Pointer} pointer6 - A Pointer object.
*/
this.pointer6 = null;
/**
* @property {Phaser.Pointer} pointer7 - A Pointer object.
*/
this.pointer7 = null;
/**
* @property {Phaser.Pointer} pointer8 - A Pointer object.
*/
this.pointer8 = null;
/**
* @property {Phaser.Pointer} pointer9 - A Pointer object.
*/
this.pointer9 = null;
/**
* @property {Phaser.Pointer} pointer10 - A Pointer object.
*/
this.pointer10 = null;
/**
* The most recently active Pointer object.
* When you've limited max pointers to 1 this will accurately be either the first finger touched or mouse.
* @property {Phaser.Pointer} activePointer
*/
this.activePointer = null;
/**
* @property {Pointer} mousePointer - The mouse has its own unique Phaser.Pointer object which you can use if making a desktop specific game.
*/
this.mousePointer = null;
/**
* @property {Phaser.Mouse} mouse - The Mouse Input manager.
*/
this.mouse = null;
/**
* @property {Phaser.Keyboard} keyboard - The Keyboard Input manager.
*/
this.keyboard = null;
/**
* @property {Phaser.Touch} touch - the Touch Input manager.
*/
this.touch = null;
/**
* @property {Phaser.MSPointer} mspointer - The MSPointer Input manager.
*/
this.mspointer = null;
/**
* @property {Phaser.Gamepad} gamepad - The Gamepad Input manager.
*/
this.gamepad = null;
/**
* @property {Phaser.Gestures} gestures - The Gestures manager.
*/
// this.gestures = null;
/**
* @property {Phaser.Signal} onDown - A Signal that is dispatched each time a pointer is pressed down.
*/
this.onDown = null;
/**
* @property {Phaser.Signal} onUp - A Signal that is dispatched each time a pointer is released.
*/
this.onUp = null;
/**
* @property {Phaser.Signal} onTap - A Signal that is dispatched each time a pointer is tapped.
*/
this.onTap = null;
/**
* @property {Phaser.Signal} onHold - A Signal that is dispatched each time a pointer is held down.
*/
this.onHold = null;
/**
* A linked list of interactive objects; the InputHandler components (belonging to Sprites) register themselves with this.
* @property {Phaser.LinkedList} interactiveItems
*/
this.interactiveItems = new Phaser.LinkedList();
/**
* @property {Phaser.Point} _localPoint - Internal cache var.
* @private
*/
this._localPoint = new Phaser.Point();
/**
* @property {number} _pollCounter - Internal var holding the current poll counter.
* @private
*/
this._pollCounter = 0;
/**
* @property {Phaser.Point} _oldPosition - A point object representing the previous position of the Pointer.
* @private
*/
this._oldPosition = null;
/**
* @property {number} _x - x coordinate of the most recent Pointer event
* @private
*/
this._x = 0;
/**
* @property {number} _y - Y coordinate of the most recent Pointer event
* @private
*/
this._y = 0;
}; };
/** /**
@ -494,300 +828,6 @@ Phaser.Input.MOUSE_TOUCH_COMBINE = 2;
Phaser.Input.prototype = { Phaser.Input.prototype = {
/**
* How often should the input pointers be checked for updates?
* A value of 0 means every single frame (60fps), a value of 1 means every other frame (30fps) and so on.
* @property {number} pollRate
* @default
*/
pollRate: 0,
/**
* @property {number} _pollCounter - Internal var holding the current poll counter.
* @private
* @default
*/
_pollCounter: 0,
/**
* @property {Phaser.Point} _oldPosition - A point object representing the previous position of the Pointer.
* @private
* @default
*/
_oldPosition: null,
/**
* @property {number} _x - x coordinate of the most recent Pointer event
* @private
* @default
*/
_x: 0,
/**
* @property {number} _y - Y coordinate of the most recent Pointer event
* @private
* @default
*/
_y: 0,
/**
* You can disable all Input by setting Input.disabled: true. While set all new input related events will be ignored.
* If you need to disable just one type of input, for example mouse, use Input.mouse.disabled: true instead
* @property {boolean} disabled
* @default
*/
disabled: false,
/**
* Controls the expected behaviour when using a mouse and touch together on a multi-input device.
* @property {Description} multiInputOverride
*/
multiInputOverride: Phaser.Input.MOUSE_TOUCH_COMBINE,
/**
* @property {Phaser.Point} position - A point object representing the current position of the Pointer.
* @default
*/
position: null,
/**
* A point object representing the speed of the Pointer. Only really useful in single Pointer games, otherwise see the Pointer objects directly.
* @property {Phaser.Point} speed
*/
speed: null,
/**
* A Circle object centered on the x/y screen coordinates of the Input.
* Default size of 44px (Apples recommended "finger tip" size) but can be changed to anything.
* @property {Phaser.Circle} circle
*/
circle: null,
/**
* The scale by which all input coordinates are multiplied, calculated by the StageScaleMode.
* In an un-scaled game the values will be x: 1 and y: 1.
* @property {Phaser.Point} scale
*/
scale: null,
/**
* The maximum number of Pointers allowed to be active at any one time.
* For lots of games it's useful to set this to 1.
* @property {number} maxPointers
* @default
*/
maxPointers: 10,
/**
* The current number of active Pointers.
* @property {number} currentPointers
* @default
*/
currentPointers: 0,
/**
* The number of milliseconds that the Pointer has to be pressed down and then released to be considered a tap or clicke
* @property {number} tapRate
* @default
*/
tapRate: 200,
/**
* The number of milliseconds between taps of the same Pointer for it to be considered a double tap / click
* @property {number} doubleTapRate
* @default
*/
doubleTapRate: 300,
/**
* The number of milliseconds that the Pointer has to be pressed down for it to fire a onHold event
* @property {number} holdRate
* @default
*/
holdRate: 2000,
/**
* The number of milliseconds below which the Pointer is considered justPressed
* @property {number} justPressedRate
* @default
*/
justPressedRate: 200,
/**
* The number of milliseconds below which the Pointer is considered justReleased
* @property {number} justReleasedRate
* @default
*/
justReleasedRate: 200,
/**
* Sets if the Pointer objects should record a history of x/y coordinates they have passed through.
* The history is cleared each time the Pointer is pressed down.
* The history is updated at the rate specified in Input.pollRate
* @property {boolean} recordPointerHistory
* @default
*/
recordPointerHistory: false,
/**
* The rate in milliseconds at which the Pointer objects should update their tracking history
* @property {number} recordRate
* @default
*/
recordRate: 100,
/**
* The total number of entries that can be recorded into the Pointer objects tracking history.
* If the Pointer is tracking one event every 100ms, then a trackLimit of 100 would store the last 10 seconds worth of history.
* @property {number} recordLimit
* @default
*/
recordLimit: 100,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer1
*/
pointer1: null,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer2
*/
pointer2: null,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer3
*/
pointer3: null,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer4
*/
pointer4: null,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer5
*/
pointer5: null,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer6
*/
pointer6: null,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer7
*/
pointer7: null,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer8
*/
pointer8: null,
/**
* A Pointer object
* @property {Phaser.Pointer} pointer9
*/
pointer9: null,
/**
* A Pointer object.
* @property {Phaser.Pointer} pointer10
*/
pointer10: null,
/**
* The most recently active Pointer object.
* When you've limited max pointers to 1 this will accurately be either the first finger touched or mouse.
* @property {Phaser.Pointer} activePointer
* @default
*/
activePointer: null,
/**
* The mouse has its own unique Phaser.Pointer object which you can use if making a desktop specific game.
* @property {Pointer} mousePointer
* @default
*/
mousePointer: null,
/**
* The Mouse Input manager.
* @property {Phaser.Mouse} mouse - The Mouse Input manager.
* @default
*/
mouse: null,
/**
* The Keyboard Input manager.
* @property {Phaser.Keyboard} keyboard - The Keyboard Input manager.
* @default
*/
keyboard: null,
/**
* The Touch Input manager.
* @property {Phaser.Touch} touch - the Touch Input manager.
* @default
*/
touch: null,
/**
* The MSPointer Input manager.
* @property {Phaser.MSPointer} mspointer - The MSPointer Input manager.
* @default
*/
mspointer: null,
/**
* The Gamepad Input manager.
* @property {Phaser.Gamepad} gamepad - The Gamepad Input manager.
* @default
*/
gamepad: null,
/**
* A Signal that is dispatched each time a pointer is pressed down.
* @property {Phaser.Signal} onDown
* @default
*/
onDown: null,
/**
* A Signal that is dispatched each time a pointer is released.
* @property {Phaser.Signal} onUp
* @default
*/
onUp: null,
/**
* A Signal that is dispatched each time a pointer is tapped.
* @property {Phaser.Signal} onTap
* @default
*/
onTap: null,
/**
* A Signal that is dispatched each time a pointer is held down.
* @property {Phaser.Signal} onHold
* @default
*/
onHold: null,
/**
* A linked list of interactive objects, the InputHandler components (belonging to Sprites) register themselves with this.
* @property {Phaser.LinkedList} interactiveItems
*/
interactiveItems: new Phaser.LinkedList(),
/** /**
* Starts the Input Manager running. * Starts the Input Manager running.
* @method Phaser.Input#boot * @method Phaser.Input#boot
@ -804,6 +844,7 @@ Phaser.Input.prototype = {
this.touch = new Phaser.Touch(this.game); this.touch = new Phaser.Touch(this.game);
this.mspointer = new Phaser.MSPointer(this.game); this.mspointer = new Phaser.MSPointer(this.game);
this.gamepad = new Phaser.Gamepad(this.game); this.gamepad = new Phaser.Gamepad(this.game);
// this.gestures = new Phaser.Gestures(this.game);
this.onDown = new Phaser.Signal(); this.onDown = new Phaser.Signal();
this.onUp = new Phaser.Signal(); this.onUp = new Phaser.Signal();
@ -844,6 +885,7 @@ Phaser.Input.prototype = {
this.touch.stop(); this.touch.stop();
this.mspointer.stop(); this.mspointer.stop();
this.gamepad.stop(); this.gamepad.stop();
// this.gestures.stop();
this.moveCallback = null; this.moveCallback = null;
@ -902,6 +944,8 @@ Phaser.Input.prototype = {
*/ */
update: function () { update: function () {
this.keyboard.update();
if (this.pollRate > 0 && this._pollCounter &lt; this.pollRate) if (this.pollRate > 0 && this._pollCounter &lt; this.pollRate)
{ {
this._pollCounter++; this._pollCounter++;
@ -929,6 +973,9 @@ Phaser.Input.prototype = {
if (this.pointer10) { this.pointer10.update(); } if (this.pointer10) { this.pointer10.update(); }
this._pollCounter = 0; this._pollCounter = 0;
// if (this.gestures.active) { this.gestures.update(); }
}, },
/** /**
@ -961,7 +1008,7 @@ Phaser.Input.prototype = {
if (this.game.canvas.style.cursor !== 'none') if (this.game.canvas.style.cursor !== 'none')
{ {
this.game.canvas.style.cursor = 'default'; this.game.canvas.style.cursor = 'inherit';
} }
if (hard === true) if (hard === true)
@ -1155,6 +1202,99 @@ Phaser.Input.prototype = {
return null; return null;
},
/**
* This will return the local coordinates of the specified displayObject based on the given Pointer.
* @method Phaser.Input#getLocalPosition
* @param {Phaser.Sprite|Phaser.Image} displayObject - The DisplayObject to get the local coordinates for.
* @param {Phaser.Pointer} pointer - The Pointer to use in the check against the displayObject.
* @return {Phaser.Point} A point containing the coordinates of the Pointer position relative to the DisplayObject.
*/
getLocalPosition: function (displayObject, pointer, output) {
if (typeof output === 'undefined') { output = new Phaser.Point(); }
var wt = displayObject.worldTransform;
var id = 1 / (wt.a * wt.d + wt.b * -wt.c);
return output.setTo(
wt.d * id * pointer.x + -wt.b * id * pointer.y + (wt.ty * wt.b - wt.tx * wt.d) * id,
wt.a * id * pointer.y + -wt.c * id * pointer.x + (-wt.ty * wt.a + wt.tx * wt.c) * id
);
},
/**
* Tests if the pointer hits the given object.
*
* @method Phaser.Input#hitTest
* @param {DisplayObject} displayObject - The displayObject to test for a hit.
* @param {Phaser.Pointer} pointer - The pointer to use for the test.
* @param {Phaser.Point} localPoint - The local translated point.
*/
hitTest: function (displayObject, pointer, localPoint) {
if (!displayObject.worldVisible)
{
return false;
}
this.getLocalPosition(displayObject, pointer, this._localPoint);
localPoint.copyFrom(this._localPoint);
if (displayObject.hitArea && displayObject.hitArea.contains)
{
if (displayObject.hitArea.contains(this._localPoint.x, this._localPoint.y))
{
return true;
}
return false;
}
else if (displayObject instanceof Phaser.TileSprite)
{
var width = displayObject.width;
var height = displayObject.height;
var x1 = -width * displayObject.anchor.x;
if (this._localPoint.x > x1 && this._localPoint.x &lt; x1 + width)
{
var y1 = -height * displayObject.anchor.y;
if (this._localPoint.y > y1 && this._localPoint.y &lt; y1 + height)
{
return true;
}
}
}
else if (displayObject instanceof PIXI.Sprite)
{
var width = displayObject.texture.frame.width;
var height = displayObject.texture.frame.height;
var x1 = -width * displayObject.anchor.x;
if (this._localPoint.x > x1 && this._localPoint.x &lt; x1 + width)
{
var y1 = -height * displayObject.anchor.y;
if (this._localPoint.y > y1 && this._localPoint.y &lt; y1 + height)
{
return true;
}
}
}
for (var i = 0, len = displayObject.children.length; i &lt; len; i++)
{
if (this.hitTest(displayObject.children[i], pointer, localPoint))
{
return true;
}
}
return false;
} }
}; };
@ -1294,7 +1434,7 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1321,6 +1461,9 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -538,10 +616,22 @@ Phaser.InputHandler = function (sprite) {
this.snapOffsetY = 0; this.snapOffsetY = 0;
/** /**
* @property {number} pixelPerfect - Should we use pixel perfect hit detection? Warning: expensive. Only enable if you really need it! * Set to true to use pixel perfect hit detection when checking if the pointer is over this Sprite.
* The x/y coordinates of the pointer are tested against the image in combination with the InputHandler.pixelPerfectAlpha value.
* Warning: This is expensive, especially on mobile (where it's not even needed!) so only enable if required. Also see the less-expensive InputHandler.pixelPerfectClick.
* @property {number} pixelPerfectOver - Use a pixel perfect check when testing for pointer over.
* @default * @default
*/ */
this.pixelPerfect = false; this.pixelPerfectOver = false;
/**
* Set to true to use pixel perfect hit detection when checking if the pointer is over this Sprite when it's clicked or touched.
* The x/y coordinates of the pointer are tested against the image in combination with the InputHandler.pixelPerfectAlpha value.
* Warning: This is expensive so only enable if you really need it.
* @property {number} pixelPerfectClick - Use a pixel perfect check when testing for clicks or touches on the Sprite.
* @default
*/
this.pixelPerfectClick = false;
/** /**
* @property {number} pixelPerfectAlpha - The alpha tolerance threshold. If the alpha value of the pixel matches or is above this value, it's considered a hit. * @property {number} pixelPerfectAlpha - The alpha tolerance threshold. If the alpha value of the pixel matches or is above this value, it's considered a hit.
@ -576,11 +666,15 @@ Phaser.InputHandler = function (sprite) {
this.consumePointerEvent = false; this.consumePointerEvent = false;
/** /**
* @property {Phaser.Point} _tempPoint - Description. * @property {Phaser.Point} _tempPoint - Internal cache var.
* @private * @private
*/ */
this._tempPoint = new Phaser.Point(); this._tempPoint = new Phaser.Point();
/**
* @property {array} _pointerData - Internal cache var.
* @private
*/
this._pointerData = []; this._pointerData = [];
this._pointerData.push({ this._pointerData.push({
@ -646,7 +740,7 @@ Phaser.InputHandler.prototype = {
this.enabled = true; this.enabled = true;
// Create the signals the Input component will emit // Create the signals the Input component will emit
if (this.sprite.events && this.sprite.events.onInputOver == null) if (this.sprite.events && this.sprite.events.onInputOver === null)
{ {
this.sprite.events.onInputOver = new Phaser.Signal(); this.sprite.events.onInputOver = new Phaser.Signal();
this.sprite.events.onInputOut = new Phaser.Signal(); this.sprite.events.onInputOut = new Phaser.Signal();
@ -721,10 +815,12 @@ Phaser.InputHandler.prototype = {
this.game.input.interactiveItems.remove(this); this.game.input.interactiveItems.remove(this);
this.stop(); this._pointerData.length = 0;
this.boundsRect = null;
this.boundsSprite = null;
this.sprite = null; this.sprite = null;
} }
}, },
/** /**
@ -905,7 +1001,7 @@ Phaser.InputHandler.prototype = {
* Is this sprite being dragged by the mouse or not? * Is this sprite being dragged by the mouse or not?
* @method Phaser.InputHandler#pointerDragged * @method Phaser.InputHandler#pointerDragged
* @param {Phaser.Pointer} pointer * @param {Phaser.Pointer} pointer
* @return {number} * @return {boolean} True if the pointer is dragging an object, otherwise false.
*/ */
pointerDragged: function (pointer) { pointerDragged: function (pointer) {
@ -915,6 +1011,36 @@ Phaser.InputHandler.prototype = {
}, },
/**
* Checks if the given pointer is over this Sprite and can click it.
* @method Phaser.InputHandler#checkPointerDown
* @param {Phaser.Pointer} pointer
* @return {boolean} True if the pointer is down, otherwise false.
*/
checkPointerDown: function (pointer) {
if (this.enabled === false || this.sprite.visible === false || this.sprite.parent.visible === false)
{
return false;
}
// Need to pass it a temp point, in case we need it again for the pixel check
if (this.game.input.hitTest(this.sprite, pointer, this._tempPoint))
{
if (this.pixelPerfectClick)
{
return this.checkPixel(this._tempPoint.x, this._tempPoint.y);
}
else
{
return true;
}
}
return false;
},
/** /**
* Checks if the given pointer is over this Sprite. * Checks if the given pointer is over this Sprite.
* @method Phaser.InputHandler#checkPointerOver * @method Phaser.InputHandler#checkPointerOver
@ -923,16 +1049,15 @@ Phaser.InputHandler.prototype = {
*/ */
checkPointerOver: function (pointer) { checkPointerOver: function (pointer) {
if (this.enabled === false || this.sprite.visible === false || (this.sprite.group && this.sprite.group.visible === false)) if (this.enabled === false || this.sprite.visible === false || this.sprite.parent.visible === false)
{ {
return false; return false;
} }
this.sprite.getLocalUnmodifiedPosition(this._tempPoint, pointer.x, pointer.y); // Need to pass it a temp point, in case we need it again for the pixel check
if (this.game.input.hitTest(this.sprite, pointer, this._tempPoint))
if (this._tempPoint.x >= 0 && this._tempPoint.x &lt;= this.sprite.currentFrame.width && this._tempPoint.y >= 0 && this._tempPoint.y &lt;= this.sprite.currentFrame.height)
{ {
if (this.pixelPerfect) if (this.pixelPerfectOver)
{ {
return this.checkPixel(this._tempPoint.x, this._tempPoint.y); return this.checkPixel(this._tempPoint.x, this._tempPoint.y);
} }
@ -942,6 +1067,8 @@ Phaser.InputHandler.prototype = {
} }
} }
return false;
}, },
/** /**
@ -950,15 +1077,35 @@ Phaser.InputHandler.prototype = {
* @method Phaser.InputHandler#checkPixel * @method Phaser.InputHandler#checkPixel
* @param {number} x - The x coordinate to check. * @param {number} x - The x coordinate to check.
* @param {number} y - The y coordinate to check. * @param {number} y - The y coordinate to check.
* @param {Phaser.Pointer} [pointer] - The pointer to get the x/y coordinate from if not passed as the first two parameters.
* @return {boolean} true if there is the alpha of the pixel is >= InputHandler.pixelPerfectAlpha * @return {boolean} true if there is the alpha of the pixel is >= InputHandler.pixelPerfectAlpha
*/ */
checkPixel: function (x, y) { checkPixel: function (x, y, pointer) {
// Grab a pixel from our image into the hitCanvas and then test it // Grab a pixel from our image into the hitCanvas and then test it
if (this.sprite.texture.baseTexture.source) if (this.sprite.texture.baseTexture.source)
{ {
this.game.input.hitContext.clearRect(0, 0, 1, 1); this.game.input.hitContext.clearRect(0, 0, 1, 1);
if (x === null && y === null)
{
// Use the pointer parameter
this.game.input.getLocalPosition(this.sprite, pointer, this._tempPoint);
var x = this._tempPoint.x;
var y = this._tempPoint.y;
}
if (this.sprite.anchor.x !== 0)
{
x -= -this.sprite.texture.frame.width * this.sprite.anchor.x;
}
if (this.sprite.anchor.y !== 0)
{
y -= -this.sprite.texture.frame.height * this.sprite.anchor.y;
}
x += this.sprite.texture.frame.x; x += this.sprite.texture.frame.x;
y += this.sprite.texture.frame.y; y += this.sprite.texture.frame.y;
@ -979,11 +1126,18 @@ Phaser.InputHandler.prototype = {
/** /**
* Update. * Update.
* @method Phaser.InputHandler#update * @method Phaser.InputHandler#update
* @protected
* @param {Phaser.Pointer} pointer * @param {Phaser.Pointer} pointer
*/ */
update: function (pointer) { update: function (pointer) {
if (this.enabled === false || this.sprite.visible === false || (this.sprite.group && this.sprite.group.visible === false)) if (this.sprite === null)
{
// Abort. We've been destroyed.
return;
}
if (!this.enabled || !this.sprite.visible || !this.sprite.parent.visible)
{ {
this._pointerOutHandler(pointer); this._pointerOutHandler(pointer);
return false; return false;
@ -1017,6 +1171,12 @@ Phaser.InputHandler.prototype = {
*/ */
_pointerOverHandler: function (pointer) { _pointerOverHandler: function (pointer) {
if (this.sprite === null)
{
// Abort. We've been destroyed.
return;
}
if (this._pointerData[pointer.id].isOver === false) if (this._pointerData[pointer.id].isOver === false)
{ {
this._pointerData[pointer.id].isOver = true; this._pointerData[pointer.id].isOver = true;
@ -1032,6 +1192,7 @@ Phaser.InputHandler.prototype = {
this.sprite.events.onInputOver.dispatch(this.sprite, pointer); this.sprite.events.onInputOver.dispatch(this.sprite, pointer);
} }
}, },
/** /**
@ -1042,6 +1203,12 @@ Phaser.InputHandler.prototype = {
*/ */
_pointerOutHandler: function (pointer) { _pointerOutHandler: function (pointer) {
if (this.sprite === null)
{
// Abort. We've been destroyed.
return;
}
this._pointerData[pointer.id].isOver = false; this._pointerData[pointer.id].isOver = false;
this._pointerData[pointer.id].isOut = true; this._pointerData[pointer.id].isOut = true;
this._pointerData[pointer.id].timeOut = this.game.time.now; this._pointerData[pointer.id].timeOut = this.game.time.now;
@ -1066,8 +1233,19 @@ Phaser.InputHandler.prototype = {
*/ */
_touchedHandler: function (pointer) { _touchedHandler: function (pointer) {
if (this.sprite === null)
{
// Abort. We've been destroyed.
return;
}
if (this._pointerData[pointer.id].isDown === false && this._pointerData[pointer.id].isOver === true) if (this._pointerData[pointer.id].isDown === false && this._pointerData[pointer.id].isOver === true)
{ {
if (this.pixelPerfectClick && !this.checkPixel(null, null, pointer))
{
return;
}
this._pointerData[pointer.id].isDown = true; this._pointerData[pointer.id].isDown = true;
this._pointerData[pointer.id].isUp = false; this._pointerData[pointer.id].isUp = false;
this._pointerData[pointer.id].timeDown = this.game.time.now; this._pointerData[pointer.id].timeDown = this.game.time.now;
@ -1098,6 +1276,12 @@ Phaser.InputHandler.prototype = {
*/ */
_releasedHandler: function (pointer) { _releasedHandler: function (pointer) {
if (this.sprite === null)
{
// Abort. We've been destroyed.
return;
}
// If was previously touched by this Pointer, check if still is AND still over this item // If was previously touched by this Pointer, check if still is AND still over this item
if (this._pointerData[pointer.id].isDown && pointer.isUp) if (this._pointerData[pointer.id].isDown && pointer.isUp)
{ {
@ -1241,7 +1425,7 @@ Phaser.InputHandler.prototype = {
}, },
/** /**
* Returns true if the pointer has entered the Sprite within the specified delay time (defaults to 500ms, half a second) * Returns true if the pointer has touched or clicked on the Sprite within the specified delay time (defaults to 500ms, half a second)
* @method Phaser.InputHandler#justPressed * @method Phaser.InputHandler#justPressed
* @param {Phaser.Pointer} pointer * @param {Phaser.Pointer} pointer
* @param {number} delay - The time below which the pointer is considered as just over. * @param {number} delay - The time below which the pointer is considered as just over.
@ -1257,7 +1441,7 @@ Phaser.InputHandler.prototype = {
}, },
/** /**
* Returns true if the pointer has left the Sprite within the specified delay time (defaults to 500ms, half a second) * Returns true if the pointer was touching this Sprite, but has been released within the specified delay time (defaults to 500ms, half a second)
* @method Phaser.InputHandler#justReleased * @method Phaser.InputHandler#justReleased
* @param {Phaser.Pointer} pointer * @param {Phaser.Pointer} pointer
* @param {number} delay - The time below which the pointer is considered as just out. * @param {number} delay - The time below which the pointer is considered as just out.
@ -1443,7 +1627,6 @@ Phaser.InputHandler.prototype = {
} }
this.sprite.events.onDragStop.dispatch(this.sprite, pointer); this.sprite.events.onDragStop.dispatch(this.sprite, pointer);
this.sprite.events.onInputUp.dispatch(this.sprite, pointer);
if (this.checkPointerOver(pointer) === false) if (this.checkPointerOver(pointer) === false)
{ {
@ -1479,7 +1662,7 @@ Phaser.InputHandler.prototype = {
* @param {number} [snapOffsetX=0] - Used to offset the top-left starting point of the snap grid. * @param {number} [snapOffsetX=0] - Used to offset the top-left starting point of the snap grid.
* @param {number} [snapOffsetX=0] - Used to offset the top-left starting point of the snap grid. * @param {number} [snapOffsetX=0] - Used to offset the top-left starting point of the snap grid.
*/ */
enableSnap: function (snapX, snapY, onDrag, onRelease, snappOffsetX, snappOffsetY) { enableSnap: function (snapX, snapY, onDrag, onRelease, snapOffsetX, snapOffsetY) {
if (typeof onDrag == 'undefined') { onDrag = true; } if (typeof onDrag == 'undefined') { onDrag = true; }
if (typeof onRelease == 'undefined') { onRelease = false; } if (typeof onRelease == 'undefined') { onRelease = false; }
@ -1628,7 +1811,7 @@ Phaser.InputHandler.prototype.constructor = Phaser.InputHandler;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1655,6 +1838,9 @@ Phaser.InputHandler.prototype.constructor = Phaser.InputHandler;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -1,540 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: IntroDocs.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#hex2rgb">hex2rgb</a>
</li>
<li>
<a href="global.html#HEXtoRGB">HEXtoRGB</a>
</li>
<li>
<a href="global.html#x">x</a>
</li>
<li>
<a href="global.html#y">y</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: IntroDocs.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* @overview
*
* ![Phaser Logo](http://www.photonstorm.com/wp-content/uploads/2013/09/phaser_10_release.jpg)
*
* Phaser - http://www.phaser.io
*
* v1.1.4 - Released February 5th 2014.
*
* 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.
*
* View the [Official Website](http://phaser.io)&lt;br />
* Follow on [Twitter](https://twitter.com/photonstorm)&lt;br />
* Join the [Forum](http://www.html5gamedevs.com/forum/14-phaser/)&lt;br />
* Try out 210+ [Phaser Examples](http://examples.phaser.io)&lt;br />
* Read the [documentation online](http://docs.phaser.io)
*
* Many thanks to Adam Saltsman (@ADAMATOMIC) for releasing Flixel, from which both 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
*/
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Wed Feb 05 2014 06:18:03 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -0,0 +1,637 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: physics/p2/InversePointProxy.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: physics/p2/InversePointProxy.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* A InversePointProxy is an internal class that allows for direct getter/setter style property access to Arrays and TypedArrays but inverses the values on set.
*
* @class Phaser.Physics.P2.InversePointProxy
* @classdesc InversePointProxy
* @constructor
* @param {Phaser.Physics.P2} world - A reference to the P2 World.
* @param {any} destination - The object to bind to.
*/
Phaser.Physics.P2.InversePointProxy = function (world, destination) {
this.world = world;
this.destination = destination;
};
Phaser.Physics.P2.InversePointProxy.prototype.constructor = Phaser.Physics.P2.InversePointProxy;
/**
* @name Phaser.Physics.P2.InversePointProxy#x
* @property {number} x - The x property of this InversePointProxy.
*/
Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "x", {
get: function () {
return this.destination[0];
},
set: function (value) {
this.destination[0] = this.world.pxm(-value);
}
});
/**
* @name Phaser.Physics.P2.InversePointProxy#y
* @property {number} y - The y property of this InversePointProxy.
*/
Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "y", {
get: function () {
return this.destination[1];
},
set: function (value) {
this.destination[1] = this.world.pxm(-value);
}
});
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:18 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -449,6 +527,12 @@ Phaser.Key = function (game, keycode) {
*/ */
this.game = game; this.game = game;
/**
* @property {object} event - Stores the most recent DOM event.
* @readonly
*/
this.event = null;
/** /**
* @property {boolean} isDown - The "down" state of the key. * @property {boolean} isDown - The "down" state of the key.
* @default * @default
@ -459,7 +543,7 @@ Phaser.Key = function (game, keycode) {
* @property {boolean} isUp - The "up" state of the key. * @property {boolean} isUp - The "up" state of the key.
* @default * @default
*/ */
this.isUp = false; this.isUp = true;
/** /**
* @property {boolean} altKey - The down state of the ALT key, if pressed at the same time as this key. * @property {boolean} altKey - The down state of the ALT key, if pressed at the same time as this key.
@ -480,8 +564,7 @@ Phaser.Key = function (game, keycode) {
this.shiftKey = false; this.shiftKey = false;
/** /**
* @property {number} timeDown - The timestamp when the key was last pressed down. * @property {number} timeDown - The timestamp when the key was last pressed down. This is based on Game.time.now.
* @default
*/ */
this.timeDown = 0; this.timeDown = 0;
@ -494,10 +577,10 @@ Phaser.Key = function (game, keycode) {
this.duration = 0; this.duration = 0;
/** /**
* @property {number} timeUp - The timestamp when the key was last released. * @property {number} timeUp - The timestamp when the key was last released. This is based on Game.time.now.
* @default * @default
*/ */
this.timeUp = 0; this.timeUp = -2500;
/** /**
* @property {number} repeats - If a key is held down this holds down the number of times the key has 'repeated'. * @property {number} repeats - If a key is held down this holds down the number of times the key has 'repeated'.
@ -515,6 +598,16 @@ Phaser.Key = function (game, keycode) {
*/ */
this.onDown = new Phaser.Signal(); this.onDown = new Phaser.Signal();
/**
* @property {function} onHoldCallback - A callback that is called while this Key is held down. Warning: Depending on refresh rate that could be 60+ times per second.
*/
this.onHoldCallback = null;
/**
* @property {object} onHoldContext - The context under which the onHoldCallback will be called.
*/
this.onHoldContext = null;
/** /**
* @property {Phaser.Signal} onUp - This Signal is dispatched every time this Key is pressed down. It is only dispatched once (until the key is released again). * @property {Phaser.Signal} onUp - This Signal is dispatched every time this Key is pressed down. It is only dispatched once (until the key is released again).
*/ */
@ -524,6 +617,21 @@ Phaser.Key = function (game, keycode) {
Phaser.Key.prototype = { Phaser.Key.prototype = {
update: function () {
if (this.isDown)
{
this.duration = this.game.time.now - this.timeDown;
this.repeats++;
if (this.onHoldCallback)
{
this.onHoldCallback.call(this.onHoldContext, this);
}
}
},
/** /**
* Called automatically by Phaser.Keyboard. * Called automatically by Phaser.Keyboard.
* @method Phaser.Key#processKeyDown * @method Phaser.Key#processKeyDown
@ -532,26 +640,24 @@ Phaser.Key.prototype = {
*/ */
processKeyDown: function (event) { processKeyDown: function (event) {
this.event = event;
if (this.isDown)
{
return;
}
this.altKey = event.altKey; this.altKey = event.altKey;
this.ctrlKey = event.ctrlKey; this.ctrlKey = event.ctrlKey;
this.shiftKey = event.shiftKey; this.shiftKey = event.shiftKey;
if (this.isDown) this.isDown = true;
{ this.isUp = false;
// Key was already held down, this must be a repeat rate based event this.timeDown = this.game.time.now;
this.duration = event.timeStamp - this.timeDown; this.duration = 0;
this.repeats++; this.repeats = 0;
}
else
{
this.isDown = true;
this.isUp = false;
this.timeDown = event.timeStamp;
this.duration = 0;
this.repeats = 0;
this.onDown.dispatch(this); this.onDown.dispatch(this);
}
}, },
@ -563,14 +669,36 @@ Phaser.Key.prototype = {
*/ */
processKeyUp: function (event) { processKeyUp: function (event) {
this.event = event;
if (this.isUp)
{
return;
}
this.isDown = false; this.isDown = false;
this.isUp = true; this.isUp = true;
this.timeUp = event.timeStamp; this.timeUp = this.game.time.now;
this.duration = this.game.time.now - this.timeDown;
this.onUp.dispatch(this); this.onUp.dispatch(this);
}, },
/**
* Resets the state of this Key.
*
* @method Phaser.Key#reset
*/
reset: function () {
this.isDown = false;
this.isUp = true;
this.timeUp = this.game.time.now;
this.duration = this.game.time.now - this.timeDown;
},
/** /**
* Returns the "just pressed" state of the Key. Just pressed is considered true if the key was pressed down within the duration given (default 250ms) * Returns the "just pressed" state of the Key. Just pressed is considered true if the key was pressed down within the duration given (default 250ms)
* @method Phaser.Key#justPressed * @method Phaser.Key#justPressed
@ -579,7 +707,7 @@ Phaser.Key.prototype = {
*/ */
justPressed: function (duration) { justPressed: function (duration) {
if (typeof duration === "undefined") { duration = 250; } if (typeof duration === "undefined") { duration = 2500; }
return (this.isDown && this.duration &lt; duration); return (this.isDown && this.duration &lt; duration);
@ -593,9 +721,9 @@ Phaser.Key.prototype = {
*/ */
justReleased: function (duration) { justReleased: function (duration) {
if (typeof duration === "undefined") { duration = 250; } if (typeof duration === "undefined") { duration = 2500; }
return (this.isDown === false && (this.game.time.now - this.timeUp &lt; duration)); return (!this.isDown && ((this.game.time.now - this.timeUp) &lt; duration));
} }
@ -623,7 +751,7 @@ Phaser.Key.prototype.constructor = Phaser.Key;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -650,6 +778,9 @@ Phaser.Key.prototype.constructor = Phaser.Key;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -448,24 +526,6 @@ Phaser.Keyboard = function (game) {
* @property {Phaser.Game} game - Local reference to game. * @property {Phaser.Game} game - Local reference to game.
*/ */
this.game = game; this.game = game;
/**
* @property {object} _keys - The object the key values are stored in.
* @private
*/
this._keys = {};
/**
* @property {object} _hotkeys - The object the hot keys are stored in.
* @private
*/
this._hotkeys = {};
/**
* @property {object} _capture - The object the key capture values are stored in.
* @private
*/
this._capture = {};
/** /**
* You can disable all Keyboard Input by setting disabled to true. While true all new input related events will be ignored. * You can disable all Keyboard Input by setting disabled to true. While true all new input related events will be ignored.
@ -475,18 +535,9 @@ Phaser.Keyboard = function (game) {
this.disabled = false; this.disabled = false;
/** /**
* @property {function} _onKeyDown * @property {Object} event - The most recent DOM event. This is updated every time a new key is pressed or released.
* @private
* @default
*/ */
this._onKeyDown = null; this.event = null;
/**
* @property {function} _onKeyUp
* @private
* @default
*/
this._onKeyUp = null;
/** /**
* @property {Object} callbackContext - The context under which the callbacks are run. * @property {Object} callbackContext - The context under which the callbacks are run.
@ -502,13 +553,40 @@ Phaser.Keyboard = function (game) {
* @property {function} onUpCallback - This callback is invoked every time a key is released. * @property {function} onUpCallback - This callback is invoked every time a key is released.
*/ */
this.onUpCallback = null; this.onUpCallback = null;
/**
* @property {array&lt;Phaser.Key>} _keys - The array the Phaser.Key objects are stored in.
* @private
*/
this._keys = [];
/**
* @property {array} _capture - The array the key capture values are stored in.
* @private
*/
this._capture = [];
/**
* @property {function} _onKeyDown
* @private
* @default
*/
this._onKeyDown = null;
/**
* @property {function} _onKeyUp
* @private
* @default
*/
this._onKeyUp = null;
}; };
Phaser.Keyboard.prototype = { Phaser.Keyboard.prototype = {
/** /**
* Add callbacks to the Keyboard handler so that each time a key is pressed down or releases the callbacks are activated. * Add callbacks to the Keyboard handler so that each time a key is pressed down or released the callbacks are activated.
*
* @method Phaser.Keyboard#addCallbacks * @method Phaser.Keyboard#addCallbacks
* @param {Object} context - The context under which the callbacks are run. * @param {Object} context - The context under which the callbacks are run.
* @param {function} onDown - This callback is invoked every time a key is pressed down. * @param {function} onDown - This callback is invoked every time a key is pressed down.
@ -536,11 +614,14 @@ Phaser.Keyboard.prototype = {
*/ */
addKey: function (keycode) { addKey: function (keycode) {
this._hotkeys[keycode] = new Phaser.Key(this.game, keycode); if (!this._keys[keycode])
{
this._keys[keycode] = new Phaser.Key(this.game, keycode);
this.addKeyCapture(keycode); this.addKeyCapture(keycode);
}
return this._hotkeys[keycode]; return this._keys[keycode];
}, },
@ -552,7 +633,12 @@ Phaser.Keyboard.prototype = {
*/ */
removeKey: function (keycode) { removeKey: function (keycode) {
delete (this._hotkeys[keycode]); if (this._keys[keycode])
{
this._keys[keycode] = null;
this.removeKeyCapture(keycode);
}
}, },
@ -613,8 +699,9 @@ Phaser.Keyboard.prototype = {
* There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll.
* You can use addKeyCapture to consume the keyboard event for specific keys so it doesn't bubble up to the the browser. * You can use addKeyCapture to consume the keyboard event for specific keys so it doesn't bubble up to the the browser.
* Pass in either a single keycode or an array/hash of keycodes. * Pass in either a single keycode or an array/hash of keycodes.
*
* @method Phaser.Keyboard#addKeyCapture * @method Phaser.Keyboard#addKeyCapture
* @param {Any} keycode * @param {Any} keycode - Either a single numeric keycode or an array/hash of keycodes: [65, 67, 68].
*/ */
addKeyCapture: function (keycode) { addKeyCapture: function (keycode) {
@ -633,6 +720,7 @@ Phaser.Keyboard.prototype = {
/** /**
* Removes an existing key capture. * Removes an existing key capture.
*
* @method Phaser.Keyboard#removeKeyCapture * @method Phaser.Keyboard#removeKeyCapture
* @param {number} keycode * @param {number} keycode
*/ */
@ -644,6 +732,7 @@ Phaser.Keyboard.prototype = {
/** /**
* Clear all set key captures. * Clear all set key captures.
*
* @method Phaser.Keyboard#clearCaptures * @method Phaser.Keyboard#clearCaptures
*/ */
clearCaptures: function () { clearCaptures: function () {
@ -652,19 +741,42 @@ Phaser.Keyboard.prototype = {
}, },
/**
* Updates all currently defined keys.
*
* @method Phaser.Keyboard#update
*/
update: function () {
var i = this._keys.length;
while (i--)
{
if (this._keys[i])
{
this._keys[i].update();
}
}
},
/** /**
* Process the keydown event. * Process the keydown event.
*
* @method Phaser.Keyboard#processKeyDown * @method Phaser.Keyboard#processKeyDown
* @param {KeyboardEvent} event * @param {KeyboardEvent} event
* @protected * @protected
*/ */
processKeyDown: function (event) { processKeyDown: function (event) {
this.event = event;
if (this.game.input.disabled || this.disabled) if (this.game.input.disabled || this.disabled)
{ {
return; return;
} }
// The event is being captured but another hotkey may need it
if (this._capture[event.keyCode]) if (this._capture[event.keyCode])
{ {
event.preventDefault(); event.preventDefault();
@ -675,47 +787,26 @@ Phaser.Keyboard.prototype = {
this.onDownCallback.call(this.callbackContext, event); this.onDownCallback.call(this.callbackContext, event);
} }
if (this._keys[event.keyCode] && this._keys[event.keyCode].isDown) if (!this._keys[event.keyCode])
{ {
// Key already down and still down, so update this._keys[event.keyCode] = new Phaser.Key(this.game, event.keyCode);
this._keys[event.keyCode].duration = this.game.time.now - this._keys[event.keyCode].timeDown;
}
else
{
if (!this._keys[event.keyCode])
{
// Not used this key before, so register it
this._keys[event.keyCode] = {
isDown: true,
timeDown: this.game.time.now,
timeUp: 0,
duration: 0
};
}
else
{
// Key used before but freshly down
this._keys[event.keyCode].isDown = true;
this._keys[event.keyCode].timeDown = this.game.time.now;
this._keys[event.keyCode].duration = 0;
}
}
if (this._hotkeys[event.keyCode])
{
this._hotkeys[event.keyCode].processKeyDown(event);
} }
this._keys[event.keyCode].processKeyDown(event);
}, },
/** /**
* Process the keyup event. * Process the keyup event.
*
* @method Phaser.Keyboard#processKeyUp * @method Phaser.Keyboard#processKeyUp
* @param {KeyboardEvent} event * @param {KeyboardEvent} event
* @protected * @protected
*/ */
processKeyUp: function (event) { processKeyUp: function (event) {
this.event = event;
if (this.game.input.disabled || this.disabled) if (this.game.input.disabled || this.disabled)
{ {
return; return;
@ -731,44 +822,39 @@ Phaser.Keyboard.prototype = {
this.onUpCallback.call(this.callbackContext, event); this.onUpCallback.call(this.callbackContext, event);
} }
if (this._hotkeys[event.keyCode]) if (!this._keys[event.keyCode])
{ {
this._hotkeys[event.keyCode].processKeyUp(event); this._keys[event.keyCode] = new Phaser.Key(this.game, event.keyCode);
} }
if (this._keys[event.keyCode]) this._keys[event.keyCode].processKeyUp(event);
{
this._keys[event.keyCode].isDown = false;
this._keys[event.keyCode].timeUp = this.game.time.now;
}
else
{
// Not used this key before, so register it
this._keys[event.keyCode] = {
isDown: false,
timeDown: this.game.time.now,
timeUp: this.game.time.now,
duration: 0
};
}
}, },
/** /**
* Reset the "isDown" state of all keys. * Resets all Keys.
*
* @method Phaser.Keyboard#reset * @method Phaser.Keyboard#reset
*/ */
reset: function () { reset: function () {
for (var key in this._keys) this.event = null;
var i = this._keys.length;
while (i--)
{ {
this._keys[key].isDown = false; if (this._keys[i])
{
this._keys[i].reset();
}
} }
}, },
/** /**
* Returns the "just pressed" state of the key. Just pressed is considered true if the key was pressed down within the duration given (default 250ms) * Returns the "just pressed" state of the key. Just pressed is considered true if the key was pressed down within the duration given (default 250ms)
*
* @method Phaser.Keyboard#justPressed * @method Phaser.Keyboard#justPressed
* @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR * @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR
* @param {number} [duration=250] - The duration below which the key is considered as being just pressed. * @param {number} [duration=250] - The duration below which the key is considered as being just pressed.
@ -776,19 +862,20 @@ Phaser.Keyboard.prototype = {
*/ */
justPressed: function (keycode, duration) { justPressed: function (keycode, duration) {
if (typeof duration === "undefined") { duration = 250; } if (this._keys[keycode])
if (this._keys[keycode] && this._keys[keycode].isDown && this._keys[keycode].duration &lt; duration)
{ {
return true; return this._keys[keycode].justPressed(duration);
}
else
{
return false;
} }
return false;
}, },
/** /**
* Returns the "just released" state of the Key. Just released is considered as being true if the key was released within the duration given (default 250ms) * Returns the "just released" state of the Key. Just released is considered as being true if the key was released within the duration given (default 250ms)
*
* @method Phaser.Keyboard#justReleased * @method Phaser.Keyboard#justReleased
* @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR * @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR
* @param {number} [duration=250] - The duration below which the key is considered as being just released. * @param {number} [duration=250] - The duration below which the key is considered as being just released.
@ -796,19 +883,20 @@ Phaser.Keyboard.prototype = {
*/ */
justReleased: function (keycode, duration) { justReleased: function (keycode, duration) {
if (typeof duration === "undefined") { duration = 250; } if (this._keys[keycode])
if (this._keys[keycode] && this._keys[keycode].isDown === false && (this.game.time.now - this._keys[keycode].timeUp &lt; duration))
{ {
return true; return this._keys[keycode].justReleased(duration);
}
else
{
return false;
} }
return false;
}, },
/** /**
* Returns true of the key is currently pressed down. Note that it can only detect key presses on the web browser. * Returns true of the key is currently pressed down. Note that it can only detect key presses on the web browser.
*
* @method Phaser.Keyboard#isDown * @method Phaser.Keyboard#isDown
* @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR * @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACEBAR
* @return {boolean} True if the key is currently down. * @return {boolean} True if the key is currently down.
@ -947,7 +1035,7 @@ Phaser.Keyboard.NUM_LOCK = 144;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -974,6 +1062,9 @@ Phaser.Keyboard.NUM_LOCK = 144;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -555,6 +633,64 @@ Phaser.Line.prototype = {
return (this.pointOnLine(x, y) && (x >= xMin && x &lt;= xMax) && (y >= yMin && y &lt;= yMax)); return (this.pointOnLine(x, y) && (x >= xMin && x &lt;= xMax) && (y >= yMin && y &lt;= yMax));
},
/**
* Using Bresenham's line algorithm this will return an array of all coordinates on this line.
* The start and end points are rounded before this runs as the algorithm works on integers.
*
* @method Phaser.Line#coordinatesOnLine
* @param {number} [stepRate=1] - How many steps will we return? 1 = every coordinate on the line, 2 = every other coordinate, etc.
* @param {array} [results] - The array to store the results in. If not provided a new one will be generated.
* @return {array} An array of coordinates.
*/
coordinatesOnLine: function (stepRate, results) {
if (typeof stepRate === 'undefined') { stepRate = 1; }
if (typeof results === 'undefined') { results = []; }
var x1 = Math.round(this.start.x);
var y1 = Math.round(this.start.y);
var x2 = Math.round(this.end.x);
var y2 = Math.round(this.end.y);
var dx = Math.abs(x2 - x1);
var dy = Math.abs(y2 - y1);
var sx = (x1 &lt; x2) ? 1 : -1;
var sy = (y1 &lt; y2) ? 1 : -1;
var err = dx - dy;
results.push([x1, y1]);
var i = 1;
while (!((x1 == x2) && (y1 == y2)))
{
var e2 = err &lt;&lt; 1;
if (e2 > -dy)
{
err -= dy;
x1 += sx;
}
if (e2 &lt; dx)
{
err += dx;
y1 += sy;
}
if (i % stepRate === 0)
{
results.push([x1, y1]);
}
i++;
}
return results;
} }
}; };
@ -611,6 +747,110 @@ Object.defineProperty(Phaser.Line.prototype, "perpSlope", {
}); });
/**
* @name Phaser.Line#x
* @property {number} x - Gets the x coordinate of the top left of the bounds around this line.
* @readonly
*/
Object.defineProperty(Phaser.Line.prototype, "x", {
get: function () {
return Math.min(this.start.x, this.end.x);
}
});
/**
* @name Phaser.Line#y
* @property {number} y - Gets the y coordinate of the top left of the bounds around this line.
* @readonly
*/
Object.defineProperty(Phaser.Line.prototype, "y", {
get: function () {
return Math.min(this.start.y, this.end.y);
}
});
/**
* @name Phaser.Line#left
* @property {number} left - Gets the left-most point of this line.
* @readonly
*/
Object.defineProperty(Phaser.Line.prototype, "left", {
get: function () {
return Math.min(this.start.x, this.end.x);
}
});
/**
* @name Phaser.Line#right
* @property {number} right - Gets the right-most point of this line.
* @readonly
*/
Object.defineProperty(Phaser.Line.prototype, "right", {
get: function () {
return Math.max(this.start.x, this.end.x);
}
});
/**
* @name Phaser.Line#top
* @property {number} top - Gets the top-most point of this line.
* @readonly
*/
Object.defineProperty(Phaser.Line.prototype, "top", {
get: function () {
return Math.min(this.start.y, this.end.y);
}
});
/**
* @name Phaser.Line#bottom
* @property {number} bottom - Gets the bottom-most point of this line.
* @readonly
*/
Object.defineProperty(Phaser.Line.prototype, "bottom", {
get: function () {
return Math.max(this.start.y, this.end.y);
}
});
/**
* @name Phaser.Line#width
* @property {number} width - Gets the width of this bounds of this line.
* @readonly
*/
Object.defineProperty(Phaser.Line.prototype, "width", {
get: function () {
return Math.abs(this.start.x - this.end.x);
}
});
/**
* @name Phaser.Line#height
* @property {number} height - Gets the height of this bounds of this line.
* @readonly
*/
Object.defineProperty(Phaser.Line.prototype, "height", {
get: function () {
return Math.abs(this.start.y - this.end.y);
}
});
/** /**
* Checks for intersection between two lines as defined by the given start and end points. * Checks for intersection between two lines as defined by the given start and end points.
* If asSegment is true it will check for line segment intersection. If asSegment is false it will check for line intersection. * If asSegment is true it will check for line segment intersection. If asSegment is false it will check for line intersection.
@ -714,7 +954,7 @@ Phaser.Line.intersects = function (a, b, asSegment, result) {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -741,6 +981,9 @@ Phaser.Line.intersects = function (a, b, asSegment, result) {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -606,7 +684,7 @@ Phaser.LinkedList.prototype.constructor = Phaser.LinkedList;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -633,6 +711,9 @@ Phaser.LinkedList.prototype.constructor = Phaser.LinkedList;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -503,16 +581,17 @@ Phaser.Loader = function (game) {
/** /**
* You can optionally link a sprite to the preloader. * You can optionally link a sprite to the preloader.
* If you do so the Sprite's width or height will be cropped based on the percentage loaded. * If you do so the Sprites width or height will be cropped based on the percentage loaded.
* @property {Phaser.Sprite} preloadSprite * @property {Phaser.Sprite|Phaser.Image} preloadSprite
* @default * @default
*/ */
this.preloadSprite = null; this.preloadSprite = null;
/** /**
* @property {string} crossOrigin - The crossOrigin value applied to loaded images * @property {boolean|string} crossOrigin - The crossOrigin value applied to loaded images.
* @default
*/ */
this.crossOrigin = ''; this.crossOrigin = false;
/** /**
* If you want to append a URL before the path of any asset you can set this here. * If you want to append a URL before the path of any asset you can set this here.
@ -563,15 +642,21 @@ Phaser.Loader.TEXTURE_ATLAS_JSON_HASH = 1;
*/ */
Phaser.Loader.TEXTURE_ATLAS_XML_STARLING = 2; Phaser.Loader.TEXTURE_ATLAS_XML_STARLING = 2;
/**
* @constant
* @type {number}
*/
Phaser.Loader.PHYSICS_LIME_CORONA = 3;
Phaser.Loader.prototype = { Phaser.Loader.prototype = {
/** /**
* You can set a Sprite to be a "preload" sprite by passing it to this method. * You can set a Sprite to be a "preload" sprite by passing it to this method.
* A "preload" sprite will have its width or height crop adjusted based on the percentage of the loader in real-time. * A "preload" sprite will have its width or height crop adjusted based on the percentage of the loader in real-time.
* This allows you to easily make loading bars for games. * This allows you to easily make loading bars for games. Note that Sprite.visible = true will be set when calling this.
* *
* @method Phaser.Loader#setPreloadSprite * @method Phaser.Loader#setPreloadSprite
* @param {Phaser.Sprite} sprite - The sprite that will be cropped during the load. * @param {Phaser.Sprite|Phaser.Image} sprite - The sprite that will be cropped during the load.
* @param {number} [direction=0] - A value of zero means the sprite width will be cropped, a value of 1 means its height will be cropped. * @param {number} [direction=0] - A value of zero means the sprite width will be cropped, a value of 1 means its height will be cropped.
*/ */
setPreloadSprite: function (sprite, direction) { setPreloadSprite: function (sprite, direction) {
@ -591,8 +676,9 @@ Phaser.Loader.prototype = {
this.preloadSprite.crop = new Phaser.Rectangle(0, 0, sprite.width, 1); this.preloadSprite.crop = new Phaser.Rectangle(0, 0, sprite.width, 1);
} }
sprite.crop = this.preloadSprite.crop; sprite.crop(this.preloadSprite.crop);
sprite.cropEnabled = true;
sprite.visible = true;
}, },
@ -621,6 +707,31 @@ Phaser.Loader.prototype = {
}, },
/**
* Gets the fileList index for the given key.
*
* @method Phaser.Loader#getAssetIndex
* @param {string} type - The type asset you want to check.
* @param {string} key - Key of the asset you want to check.
* @return {number} The index of this key in the filelist, or -1 if not found.
*/
getAssetIndex: function (type, key) {
if (this._fileList.length > 0)
{
for (var i = 0; i &lt; this._fileList.length; i++)
{
if (this._fileList[i].type === type && this._fileList[i].key === key)
{
return i;
}
}
}
return -1;
},
/** /**
* Gets the asset that is queued for load. * Gets the asset that is queued for load.
* *
@ -725,10 +836,16 @@ Phaser.Loader.prototype = {
} }
} }
if (this.checkKeyExists(type, key) === false) var index = this.getAssetIndex(type, key);
if (index === -1)
{ {
this._fileList.push(entry); this._fileList.push(entry);
} }
else
{
this._fileList[index] = entry;
}
}, },
@ -785,32 +902,48 @@ Phaser.Loader.prototype = {
}, },
/** /**
* Add a JavaScript file to the Loader. Once loaded the JavaScript file will be automatically turned into a script tag (and executed), so be careful what you load! * Add a json file to the Loader.
*
* @method Phaser.Loader#script
* @param {string} key - Unique asset key of the script file.
* @param {string} url - URL of the JavaScript file.
* @return {Phaser.Loader} This Loader instance.
*/
script: function (key, url) {
this.addToFileList('script', key, url);
return this;
},
/**
* Add a custom JSON file to the Loader.
* *
* @method Phaser.Loader#json * @method Phaser.Loader#json
* @param {string} key - Unique asset key of the json file. * @param {string} key - Unique asset key of the json file.
* @param {string} url - URL of the json file. * @param {string} url - URL of the json file.
* @param {boolean} [overwrite=false] - If an unloaded file with a matching key already exists in the queue, this entry will overwrite it.
* @return {Phaser.Loader} This Loader instance. * @return {Phaser.Loader} This Loader instance.
*/ */
json: function (key, url) { json: function (key, url, overwrite) {
this.addToFileList('json', key, url); if (typeof overwrite === "undefined") { overwrite = false; }
if (overwrite)
{
this.replaceInFileList('json', key, url);
}
else
{
this.addToFileList('json', key, url);
}
return this;
},
/**
* Add a JavaScript file to the Loader. Once loaded the JavaScript file will be automatically turned into a script tag (and executed), so be careful what you load!
* You can also specify a callback. This will be executed as soon as the script tag has been created.
*
* @method Phaser.Loader#script
* @param {string} key - Unique asset key of the script file.
* @param {string} url - URL of the JavaScript file.
* @param {function} [callback] - Optional callback that will be called after the script tag has loaded, so you can perform additional processing.
* @param {function} [callbackContext] - The context under which the callback will be applied. If not specified it will use the callback itself as the context.
* @return {Phaser.Loader} This Loader instance.
*/
script: function (key, url, callback, callbackContext) {
if (typeof callback === 'undefined') { callback = false; }
if (callback !== false && typeof callbackContext === 'undefined') { callbackContext = callback; }
this.addToFileList('script', key, url, { callback: callback, callbackContext: callbackContext });
return this; return this;
@ -890,7 +1023,7 @@ Phaser.Loader.prototype = {
* @param {string} key - Unique asset key of the tilemap data. * @param {string} key - Unique asset key of the tilemap data.
* @param {string} [mapDataURL] - The url of the map data file (csv/json) * @param {string} [mapDataURL] - The url of the map data file (csv/json)
* @param {object} [mapData] - An optional JSON data object. If given then the mapDataURL is ignored and this JSON object is used for map data instead. * @param {object} [mapData] - An optional JSON data object. If given then the mapDataURL is ignored and this JSON object is used for map data instead.
* @param {string} [format=Phaser.Tilemap.CSV] - The format of the map data. Either Phaser.Tilemap.CSV or Phaser.Tilemap.TILED_JSON. * @param {number} [format=Phaser.Tilemap.CSV] - The format of the map data. Either Phaser.Tilemap.CSV or Phaser.Tilemap.TILED_JSON.
* @return {Phaser.Loader} This Loader instance. * @return {Phaser.Loader} This Loader instance.
*/ */
tilemap: function (key, mapDataURL, mapData, format) { tilemap: function (key, mapDataURL, mapData, format) {
@ -936,6 +1069,49 @@ Phaser.Loader.prototype = {
}, },
/**
* Add a new physics data object loading request.
* The data must be in Lime + Corona JSON format. Physics Editor by code'n'web exports in this format natively.
*
* @method Phaser.Loader#physics
* @param {string} key - Unique asset key of the physics json data.
* @param {string} [dataURL] - The url of the map data file (csv/json)
* @param {object} [jsonData] - An optional JSON data object. If given then the dataURL is ignored and this JSON object is used for physics data instead.
* @param {string} [format=Phaser.Physics.LIME_CORONA_JSON] - The format of the physics data.
* @return {Phaser.Loader} This Loader instance.
*/
physics: function (key, dataURL, jsonData, format) {
if (typeof dataURL === "undefined") { dataURL = null; }
if (typeof jsonData === "undefined") { jsonData = null; }
if (typeof format === "undefined") { format = Phaser.Physics.LIME_CORONA_JSON; }
if (dataURL == null && jsonData == null)
{
console.warn('Phaser.Loader.physics - Both dataURL and jsonData are null. One must be set.');
return this;
}
// A map data object has been given
if (jsonData)
{
if (typeof jsonData === 'string')
{
jsonData = JSON.parse(jsonData);
}
this.game.cache.addPhysicsData(key, null, jsonData, format);
}
else
{
this.addToFileList('physics', key, dataURL, { format: format });
}
return this;
},
/** /**
* Add a new bitmap font loading request. * Add a new bitmap font loading request.
* *
@ -944,17 +1120,21 @@ Phaser.Loader.prototype = {
* @param {string} textureURL - The url of the font image file. * @param {string} textureURL - The url of the font image file.
* @param {string} [xmlURL] - The url of the font data file (xml/fnt) * @param {string} [xmlURL] - The url of the font data file (xml/fnt)
* @param {object} [xmlData] - An optional XML data object. * @param {object} [xmlData] - An optional XML data object.
* @param {number} [xSpacing=0] - If you'd like to add additional horizontal spacing between the characters then set the pixel value here.
* @param {number} [ySpacing=0] - If you'd like to add additional vertical spacing between the lines then set the pixel value here.
* @return {Phaser.Loader} This Loader instance. * @return {Phaser.Loader} This Loader instance.
*/ */
bitmapFont: function (key, textureURL, xmlURL, xmlData) { bitmapFont: function (key, textureURL, xmlURL, xmlData, xSpacing, ySpacing) {
if (typeof xmlURL === "undefined") { xmlURL = null; } if (typeof xmlURL === "undefined") { xmlURL = null; }
if (typeof xmlData === "undefined") { xmlData = null; } if (typeof xmlData === "undefined") { xmlData = null; }
if (typeof xSpacing === "undefined") { xSpacing = 0; }
if (typeof ySpacing === "undefined") { ySpacing = 0; }
// A URL to a json/xml file has been given // A URL to a json/xml file has been given
if (xmlURL) if (xmlURL)
{ {
this.addToFileList('bitmapfont', key, textureURL, { xmlURL: xmlURL }); this.addToFileList('bitmapfont', key, textureURL, { xmlURL: xmlURL, xSpacing: xSpacing, ySpacing: ySpacing });
} }
else else
{ {
@ -987,7 +1167,7 @@ Phaser.Loader.prototype = {
} }
else else
{ {
this.addToFileList('bitmapfont', key, textureURL, { xmlURL: null, xmlData: xml }); this.addToFileList('bitmapfont', key, textureURL, { xmlURL: null, xmlData: xml, xSpacing: xSpacing, ySpacing: ySpacing });
} }
} }
} }
@ -1220,7 +1400,10 @@ Phaser.Loader.prototype = {
file.data.onerror = function () { file.data.onerror = function () {
return _this.fileError(_this._fileIndex); return _this.fileError(_this._fileIndex);
}; };
file.data.crossOrigin = this.crossOrigin; if (this.crossOrigin)
{
file.data.crossOrigin = this.crossOrigin;
}
file.data.src = this.baseURL + file.url; file.data.src = this.baseURL + file.url;
break; break;
@ -1273,12 +1456,21 @@ Phaser.Loader.prototype = {
} }
break; break;
case 'tilemap':
case 'json': case 'json':
this._xhr.open("GET", this.baseURL + file.url, true); this._xhr.open("GET", this.baseURL + file.url, true);
this._xhr.responseType = "text"; this._xhr.responseType = "text";
this._xhr.onload = function () {
return _this.jsonLoadComplete(_this._fileIndex);
};
this._xhr.send();
break;
if (!file.format || file.format === Phaser.Tilemap.TILED_JSON) case 'tilemap':
this._xhr.open("GET", this.baseURL + file.url, true);
this._xhr.responseType = "text";
if (file.format === Phaser.Tilemap.TILED_JSON)
{ {
this._xhr.onload = function () { this._xhr.onload = function () {
return _this.jsonLoadComplete(_this._fileIndex); return _this.jsonLoadComplete(_this._fileIndex);
@ -1300,8 +1492,10 @@ Phaser.Loader.prototype = {
}; };
this._xhr.send(); this._xhr.send();
break; break;
case 'text': case 'text':
case 'script': case 'script':
case 'physics':
this._xhr.open("GET", this.baseURL + file.url, true); this._xhr.open("GET", this.baseURL + file.url, true);
this._xhr.responseType = "text"; this._xhr.responseType = "text";
this._xhr.onload = function () { this._xhr.onload = function () {
@ -1448,7 +1642,7 @@ Phaser.Loader.prototype = {
if (file.xmlURL == null) if (file.xmlURL == null)
{ {
this.game.cache.addBitmapFont(file.key, file.url, file.data, file.xmlData); this.game.cache.addBitmapFont(file.key, file.url, file.data, file.xmlData, file.xSpacing, file.ySpacing);
} }
else else
{ {
@ -1504,6 +1698,11 @@ Phaser.Loader.prototype = {
this.game.cache.addText(file.key, file.url, file.data); this.game.cache.addText(file.key, file.url, file.data);
break; break;
case 'physics':
var data = JSON.parse(this._xhr.responseText);
this.game.cache.addPhysicsData(file.key, file.url, data, file.format);
break;
case 'script': case 'script':
file.data = document.createElement('script'); file.data = document.createElement('script');
file.data.language = 'javascript'; file.data.language = 'javascript';
@ -1511,6 +1710,10 @@ Phaser.Loader.prototype = {
file.data.defer = false; file.data.defer = false;
file.data.text = this._xhr.responseText; file.data.text = this._xhr.responseText;
document.head.appendChild(file.data); document.head.appendChild(file.data);
if (file.callback)
{
file.data = file.callback.call(file.callbackContext, file.key, this._xhr.responseText);
}
break; break;
case 'binary': case 'binary':
@ -1560,7 +1763,7 @@ Phaser.Loader.prototype = {
} }
else if (file.type === 'json') else if (file.type === 'json')
{ {
this.game.cache.addText(file.key, file.url, data); this.game.cache.addJSON(file.key, file.url, data);
} }
else else
{ {
@ -1655,7 +1858,7 @@ Phaser.Loader.prototype = {
if (file.type == 'bitmapfont') if (file.type == 'bitmapfont')
{ {
this.game.cache.addBitmapFont(file.key, file.url, file.data, xml); this.game.cache.addBitmapFont(file.key, file.url, file.data, xml, file.xSpacing, file.ySpacing);
} }
else if (file.type == 'textureatlas') else if (file.type == 'textureatlas')
{ {
@ -1693,8 +1896,6 @@ Phaser.Loader.prototype = {
{ {
this.preloadSprite.crop.height = Math.floor((this.preloadSprite.height / 100) * this.progress); this.preloadSprite.crop.height = Math.floor((this.preloadSprite.height / 100) * this.progress);
} }
this.preloadSprite.sprite.crop = this.preloadSprite.crop;
} }
this.onFileComplete.dispatch(this.progress, this._fileList[previousIndex].key, success, this.totalLoadedFiles(), this._fileList.length); this.onFileComplete.dispatch(this.progress, this._fileList[previousIndex].key, success, this.totalLoadedFiles(), this._fileList.length);
@ -1782,7 +1983,7 @@ Phaser.Loader.prototype.constructor = Phaser.Loader;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1809,6 +2010,9 @@ Phaser.Loader.prototype.constructor = Phaser.Loader;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -441,77 +519,80 @@
* @class Phaser.LoaderParser * @class Phaser.LoaderParser
*/ */
Phaser.LoaderParser = { Phaser.LoaderParser = {
/**
* Parse frame data from an XML file.
* @method Phaser.LoaderParser.bitmapFont
* @param {object} xml - XML data you want to parse.
* @return {FrameData} Generated FrameData object.
*/
bitmapFont: function (game, xml, cacheKey) {
// Malformed? /**
if (!xml.getElementsByTagName('font')) * Parse a Bitmap Font from an XML file.
* @method Phaser.LoaderParser.bitmapFont
* @param {Phaser.Game} game - A reference to the current game.
* @param {object} xml - XML data you want to parse.
* @param {string} cacheKey - The key of the texture this font uses in the cache.
*/
bitmapFont: function (game, xml, cacheKey, xSpacing, ySpacing) {
if (!xml || /MSIE 9/i.test(navigator.userAgent))
{ {
console.warn("Phaser.LoaderParser.bitmapFont: Invalid XML given, missing &lt;font> tag"); if (typeof(window.DOMParser) === 'function')
return; {
var domparser = new DOMParser();
xml = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml');
}
else
{
var div = document.createElement('div');
div.innerHTML = this.ajaxRequest.responseText;
xml = div;
}
} }
var texture = PIXI.TextureCache[cacheKey];
var data = {}; var data = {};
var info = xml.getElementsByTagName("info")[0]; var info = xml.getElementsByTagName('info')[0];
var common = xml.getElementsByTagName("common")[0]; var common = xml.getElementsByTagName('common')[0];
data.font = info.attributes.getNamedItem("face").nodeValue;
data.size = parseInt(info.attributes.getNamedItem("size").nodeValue, 10); data.font = info.getAttribute('face');
data.lineHeight = parseInt(common.attributes.getNamedItem("lineHeight").nodeValue, 10); data.size = parseInt(info.getAttribute('size'), 10);
data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10) + ySpacing;
data.chars = {}; data.chars = {};
//parse letters var letters = xml.getElementsByTagName('char');
var letters = xml.getElementsByTagName("char"); var texture = PIXI.TextureCache[cacheKey];
for (var i = 0; i &lt; letters.length; i++) for (var i = 0; i &lt; letters.length; i++)
{ {
var charCode = parseInt(letters[i].attributes.getNamedItem("id").nodeValue, 10); var charCode = parseInt(letters[i].getAttribute('id'), 10);
var textureRect = { var textureRect = new PIXI.Rectangle(
x: parseInt(letters[i].attributes.getNamedItem("x").nodeValue, 10), parseInt(letters[i].getAttribute('x'), 10),
y: parseInt(letters[i].attributes.getNamedItem("y").nodeValue, 10), parseInt(letters[i].getAttribute('y'), 10),
width: parseInt(letters[i].attributes.getNamedItem("width").nodeValue, 10), parseInt(letters[i].getAttribute('width'), 10),
height: parseInt(letters[i].attributes.getNamedItem("height").nodeValue, 10) parseInt(letters[i].getAttribute('height'), 10)
}; );
// Note: This means you can only have 1 BitmapFont loaded at once!
// Need to replace this with our own handler soon.
PIXI.TextureCache[charCode] = new PIXI.Texture(texture, textureRect);
data.chars[charCode] = { data.chars[charCode] = {
xOffset: parseInt(letters[i].attributes.getNamedItem("xoffset").nodeValue, 10), xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),
yOffset: parseInt(letters[i].attributes.getNamedItem("yoffset").nodeValue, 10), yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),
xAdvance: parseInt(letters[i].attributes.getNamedItem("xadvance").nodeValue, 10), xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10) + xSpacing,
kerning: {}, kerning: {},
texture:new PIXI.Texture(texture, textureRect) texture: PIXI.TextureCache[cacheKey] = new PIXI.Texture(texture, textureRect)
}; };
} }
//parse kernings var kernings = xml.getElementsByTagName('kerning');
var kernings = xml.getElementsByTagName("kerning");
for (i = 0; i &lt; kernings.length; i++) for (i = 0; i &lt; kernings.length; i++)
{ {
var first = parseInt(kernings[i].attributes.getNamedItem("first").nodeValue, 10); var first = parseInt(kernings[i].getAttribute('first'), 10);
var second = parseInt(kernings[i].attributes.getNamedItem("second").nodeValue, 10); var second = parseInt(kernings[i].getAttribute('second'), 10);
var amount = parseInt(kernings[i].attributes.getNamedItem("amount").nodeValue, 10); var amount = parseInt(kernings[i].getAttribute('amount'), 10);
data.chars[second].kerning[first] = amount; data.chars[second].kerning[first] = amount;
} }
PIXI.BitmapText.fonts[data.font] = data; PIXI.BitmapText.fonts[cacheKey] = data;
} }
};</pre> };
</pre>
</article> </article>
</section> </section>
@ -532,7 +613,7 @@ Phaser.LoaderParser = {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -559,6 +640,9 @@ Phaser.LoaderParser = {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

619
docs/LockConstraint.js.html Normal file
View file

@ -0,0 +1,619 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: physics/p2/LockConstraint.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: physics/p2/LockConstraint.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* Locks the relative position between two bodies.
*
* @class Phaser.Physics.P2.LockConstraint
* @classdesc Physics LockConstraint Constructor
* @constructor
* @param {Phaser.Physics.P2} world - A reference to the P2 World.
* @param {p2.Body} bodyA - First connected body.
* @param {p2.Body} bodyB - Second connected body.
* @param {Array} [offset] - The offset of bodyB in bodyA's frame. The value is an array with 2 elements matching x and y, i.e: [32, 32].
* @param {number} [angle=0] - The angle of bodyB in bodyA's frame.
* @param {number} [maxForce] - The maximum force that should be applied to constrain the bodies.
*/
Phaser.Physics.P2.LockConstraint = function (world, bodyA, bodyB, offset, angle, maxForce) {
if (typeof offset === 'undefined') { offset = [0, 0]; }
if (typeof angle === 'undefined') { angle = 0; }
if (typeof maxForce === 'undefined') { maxForce = Number.MAX_VALUE; }
/**
* @property {Phaser.Game} game - Local reference to game.
*/
this.game = world.game;
/**
* @property {Phaser.Physics.P2} world - Local reference to P2 World.
*/
this.world = world;
offset = [ world.pxm(offset[0]), world.pxm(offset[1]) ];
var options = { localOffsetB: offset, localAngleB: angle, maxForce: maxForce };
p2.LockConstraint.call(this, bodyA, bodyB, options);
}
Phaser.Physics.P2.LockConstraint.prototype = Object.create(p2.LockConstraint.prototype);
Phaser.Physics.P2.LockConstraint.prototype.constructor = Phaser.Physics.P2.LockConstraint;
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:18 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -586,13 +664,13 @@ Phaser.MSPointer.prototype = {
*/ */
stop: function () { stop: function () {
this.game.stage.canvas.removeEventListener('MSPointerDown', this._onMSPointerDown); this.game.canvas.removeEventListener('MSPointerDown', this._onMSPointerDown);
this.game.stage.canvas.removeEventListener('MSPointerMove', this._onMSPointerMove); this.game.canvas.removeEventListener('MSPointerMove', this._onMSPointerMove);
this.game.stage.canvas.removeEventListener('MSPointerUp', this._onMSPointerUp); this.game.canvas.removeEventListener('MSPointerUp', this._onMSPointerUp);
this.game.stage.canvas.removeEventListener('pointerDown', this._onMSPointerDown); this.game.canvas.removeEventListener('pointerDown', this._onMSPointerDown);
this.game.stage.canvas.removeEventListener('pointerMove', this._onMSPointerMove); this.game.canvas.removeEventListener('pointerMove', this._onMSPointerMove);
this.game.stage.canvas.removeEventListener('pointerUp', this._onMSPointerUp); this.game.canvas.removeEventListener('pointerUp', this._onMSPointerUp);
} }
@ -620,7 +698,7 @@ Phaser.MSPointer.prototype.constructor = Phaser.MSPointer;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -647,6 +725,9 @@ Phaser.MSPointer.prototype.constructor = Phaser.MSPointer;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

601
docs/Material.js.html Normal file
View file

@ -0,0 +1,601 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Phaser Source: physics/p2/Material.js</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.cerulean.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<a class="brand" href="index.html">Phaser</a>
<ul class="nav">
<li class="dropdown">
<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.html">Phaser</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Phaser.Animation.html">Animation</a>
</li>
<li>
<a href="Phaser.AnimationManager.html">AnimationManager</a>
</li>
<li>
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>
<li>
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
<li>
<a href="Phaser.Button.html">Button</a>
</li>
<li>
<a href="Phaser.Cache.html">Cache</a>
</li>
<li>
<a href="Phaser.Camera.html">Camera</a>
</li>
<li>
<a href="Phaser.Canvas.html">Canvas</a>
</li>
<li>
<a href="Phaser.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Color.html">Color</a>
</li>
<li>
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
<li>
<a href="Phaser.Easing.Back.html">Back</a>
</li>
<li>
<a href="Phaser.Easing.Bounce.html">Bounce</a>
</li>
<li>
<a href="Phaser.Easing.Circular.html">Circular</a>
</li>
<li>
<a href="Phaser.Easing.Cubic.html">Cubic</a>
</li>
<li>
<a href="Phaser.Easing.Elastic.html">Elastic</a>
</li>
<li>
<a href="Phaser.Easing.Exponential.html">Exponential</a>
</li>
<li>
<a href="Phaser.Easing.Linear.html">Linear</a>
</li>
<li>
<a href="Phaser.Easing.Quadratic.html">Quadratic</a>
</li>
<li>
<a href="Phaser.Easing.Quartic.html">Quartic</a>
</li>
<li>
<a href="Phaser.Easing.Quintic.html">Quintic</a>
</li>
<li>
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
<li>
<a href="Phaser.Filter.html">Filter</a>
</li>
<li>
<a href="Phaser.Frame.html">Frame</a>
</li>
<li>
<a href="Phaser.FrameData.html">FrameData</a>
</li>
<li>
<a href="Phaser.Game.html">Game</a>
</li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li>
<li>
<a href="Phaser.Gamepad.html">Gamepad</a>
</li>
<li>
<a href="Phaser.GamepadButton.html">GamepadButton</a>
</li>
<li>
<a href="Phaser.Graphics.html">Graphics</a>
</li>
<li>
<a href="Phaser.Group.html">Group</a>
</li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li>
<a href="Phaser.Input.html">Input</a>
</li>
<li>
<a href="Phaser.InputHandler.html">InputHandler</a>
</li>
<li>
<a href="Phaser.Key.html">Key</a>
</li>
<li>
<a href="Phaser.Keyboard.html">Keyboard</a>
</li>
<li>
<a href="Phaser.Line.html">Line</a>
</li>
<li>
<a href="Phaser.LinkedList.html">LinkedList</a>
</li>
<li>
<a href="Phaser.Loader.html">Loader</a>
</li>
<li>
<a href="Phaser.LoaderParser.html">LoaderParser</a>
</li>
<li>
<a href="Phaser.Math.html">Math</a>
</li>
<li>
<a href="Phaser.Mouse.html">Mouse</a>
</li>
<li>
<a href="Phaser.MSPointer.html">MSPointer</a>
</li>
<li>
<a href="Phaser.Net.html">Net</a>
</li>
<li>
<a href="Phaser.Particles.html">Particles</a>
</li>
<li>
<a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a>
</li>
<li>
<a href="Phaser.Physics.html">Physics</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
<li>
<a href="Phaser.PluginManager.html">PluginManager</a>
</li>
<li>
<a href="Phaser.Point.html">Point</a>
</li>
<li>
<a href="Phaser.Pointer.html">Pointer</a>
</li>
<li>
<a href="Phaser.Polygon.html">Polygon</a>
</li>
<li>
<a href="Phaser.QuadTree.html">QuadTree</a>
</li>
<li>
<a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a>
</li>
<li>
<a href="Phaser.Rectangle.html">Rectangle</a>
</li>
<li>
<a href="Phaser.RenderTexture.html">RenderTexture</a>
</li>
<li>
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li>
<a href="Phaser.Signal.html">Signal</a>
</li>
<li>
<a href="Phaser.SinglePad.html">SinglePad</a>
</li>
<li>
<a href="Phaser.Sound.html">Sound</a>
</li>
<li>
<a href="Phaser.SoundManager.html">SoundManager</a>
</li>
<li>
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
<li>
<a href="Phaser.State.html">State</a>
</li>
<li>
<a href="Phaser.StateManager.html">StateManager</a>
</li>
<li>
<a href="Phaser.Text.html">Text</a>
</li>
<li>
<a href="Phaser.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Tilemap.html">Tilemap</a>
</li>
<li>
<a href="Phaser.TilemapLayer.html">TilemapLayer</a>
</li>
<li>
<a href="Phaser.TilemapParser.html">TilemapParser</a>
</li>
<li>
<a href="Phaser.Tileset.html">Tileset</a>
</li>
<li>
<a href="Phaser.TileSprite.html">TileSprite</a>
</li>
<li>
<a href="Phaser.Time.html">Time</a>
</li>
<li>
<a href="Phaser.Timer.html">Timer</a>
</li>
<li>
<a href="Phaser.TimerEvent.html">TimerEvent</a>
</li>
<li>
<a href="Phaser.Touch.html">Touch</a>
</li>
<li>
<a href="Phaser.Tween.html">Tween</a>
</li>
<li>
<a href="Phaser.TweenManager.html">TweenManager</a>
</li>
<li>
<a href="Phaser.Utils.html">Utils</a>
</li>
<li>
<a href="Phaser.Utils.Debug.html">Debug</a>
</li>
<li>
<a href="Phaser.World.html">World</a>
</li>
<li>
<a href="SignalBinding.html">SignalBinding</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div id="main">
<h1 class="page-title">Source: physics/p2/Material.js</h1>
<section>
<article>
<pre class="sunlight-highlight-javascript linenums">/**
* @author Richard Davey &lt;rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* \o/ ~ "Because I'm a Material girl"
*
* @class Phaser.Physics.P2.Material
* @classdesc Physics Material Constructor
* @constructor
*/
Phaser.Physics.P2.Material = function (name) {
/**
* @property {string} name - The user defined name given to this Material.
* @default
*/
this.name = name;
p2.Material.call(this);
}
Phaser.Physics.P2.Material.prototype = Object.create(p2.Material.prototype);
Phaser.Physics.P2.Material.prototype.constructor = Phaser.Physics.P2.Material;
</pre>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<span class="copyright">
Phaser Copyright © 2012-2014 Photon Storm Ltd.
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Fri Mar 14 2014 06:34:18 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -767,7 +845,18 @@ Phaser.Math = {
* @return {number} * @return {number}
*/ */
angleBetween: function (x1, y1, x2, y2) { angleBetween: function (x1, y1, x2, y2) {
return Math.atan2(y2 - y1, x2 - x1); return Math.atan2(x2 - x1, y2 - y1);
},
/**
* Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).
* @method Phaser.Math#angleBetweenPoints
* @param {Phaser.Point} point1
* @param {Phaser.Point} point2
* @return {number}
*/
angleBetweenPoints: function (point1, point2) {
return Math.atan2(point2.x - point1.x, point2.y - point1.y);
}, },
/** /**
@ -1006,7 +1095,7 @@ Phaser.Math = {
/** /**
* Adds value to amount and ensures that the result always stays between 0 and max, by wrapping the value around. * Adds value to amount and ensures that the result always stays between 0 and max, by wrapping the value around.
* &lt;p>Values must be positive integers, and are passed through Math.abs&lt;/p> * Values must be positive integers, and are passed through Math.abs.
* *
* @method Phaser.Math#wrapValue * @method Phaser.Math#wrapValue
* @param {number} value - The value to add the amount to. * @param {number} value - The value to add the amount to.
@ -1069,27 +1158,6 @@ Phaser.Math = {
}, },
/**
* Significantly faster version of Math.max
* See http://jsperf.com/math-s-min-max-vs-homemade/5
*
* @method Phaser.Math#max
* @return {number} The highest value from those given.
*/
max: function () {
for (var i = 1, max = 0, len = arguments.length; i &lt; len; i++)
{
if (arguments[max] &lt; arguments[i])
{
max = i;
}
}
return arguments[max];
},
/** /**
* Updated version of Math.min that can be passed either an array of numbers or the numbers as parameters. * Updated version of Math.min that can be passed either an array of numbers or the numbers as parameters.
* See http://jsperf.com/math-s-min-max-vs-homemade/5 * See http://jsperf.com/math-s-min-max-vs-homemade/5
@ -1230,7 +1298,6 @@ Phaser.Math = {
* @param {number} angle - The angle value to check. Must be between -180 and +180. * @param {number} angle - The angle value to check. Must be between -180 and +180.
* @param {number} min - The minimum angle that is allowed (must be -180 or greater). * @param {number} min - The minimum angle that is allowed (must be -180 or greater).
* @param {number} max - The maximum angle that is allowed (must be 180 or less). * @param {number} max - The maximum angle that is allowed (must be 180 or less).
*
* @return {number} The new angle value, returns the same as the input angle if it was within bounds * @return {number} The new angle value, returns the same as the input angle if it was within bounds
*/ */
angleLimit: function (angle, min, max) { angleLimit: function (angle, min, max) {
@ -1629,12 +1696,11 @@ Phaser.Math = {
* Linear mapping from range &lt;a1, a2> to range &lt;b1, b2> * Linear mapping from range &lt;a1, a2> to range &lt;b1, b2>
* *
* @method Phaser.Math#mapLinear * @method Phaser.Math#mapLinear
* @param {number} x * @param {number} x the value to map
* @param {number} a1 * @param {number} a1 first endpoint of the range &lt;a1, a2>
* @param {number} a1 * @param {number} a2 final endpoint of the range &lt;a1, a2>
* @param {number} a2 * @param {number} b1 first endpoint of the range &lt;b1, b2>
* @param {number} b1 * @param {number} b2 final endpoint of the range &lt;b1, b2>
* @param {number} b2
* @return {number} * @return {number}
*/ */
mapLinear: function ( x, a1, a2, b1, b2 ) { mapLinear: function ( x, a1, a2, b1, b2 ) {
@ -1769,7 +1835,7 @@ Phaser.Math = {
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1796,6 +1862,9 @@ Phaser.Math = {
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -576,9 +654,9 @@ Phaser.Mouse.prototype = {
return _this.onMouseUp(event); return _this.onMouseUp(event);
}; };
document.addEventListener('mousedown', this._onMouseDown, true); this.game.canvas.addEventListener('mousedown', this._onMouseDown, true);
document.addEventListener('mousemove', this._onMouseMove, true); this.game.canvas.addEventListener('mousemove', this._onMouseMove, true);
document.addEventListener('mouseup', this._onMouseUp, true); this.game.canvas.addEventListener('mouseup', this._onMouseUp, true);
}, },
@ -596,7 +674,7 @@ Phaser.Mouse.prototype = {
event.preventDefault(); event.preventDefault();
} }
this.button = event.which; this.button = event.button;
if (this.mouseDownCallback) if (this.mouseDownCallback)
{ {
@ -686,7 +764,7 @@ Phaser.Mouse.prototype = {
if (this.game.device.pointerLock) if (this.game.device.pointerLock)
{ {
var element = this.game.stage.canvas; var element = this.game.canvas;
element.requestPointerLock = element.requestPointerLock || element.mozRequestPointerLock || element.webkitRequestPointerLock; element.requestPointerLock = element.requestPointerLock || element.mozRequestPointerLock || element.webkitRequestPointerLock;
@ -712,7 +790,7 @@ Phaser.Mouse.prototype = {
*/ */
pointerLockChange: function (event) { pointerLockChange: function (event) {
var element = this.game.stage.canvas; var element = this.game.canvas;
if (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) if (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element)
{ {
@ -751,9 +829,9 @@ Phaser.Mouse.prototype = {
*/ */
stop: function () { stop: function () {
document.removeEventListener('mousedown', this._onMouseDown, true); this.game.canvas.removeEventListener('mousedown', this._onMouseDown, true);
document.removeEventListener('mousemove', this._onMouseMove, true); this.game.canvas.removeEventListener('mousemove', this._onMouseMove, true);
document.removeEventListener('mouseup', this._onMouseUp, true); this.game.canvas.removeEventListener('mouseup', this._onMouseUp, true);
} }
@ -781,7 +859,7 @@ Phaser.Mouse.prototype.constructor = Phaser.Mouse;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -808,6 +886,9 @@ Phaser.Mouse.prototype.constructor = Phaser.Mouse;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -616,7 +694,7 @@ Phaser.Net.prototype.constructor = Phaser.Net;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -643,6 +721,9 @@ Phaser.Net.prototype.constructor = Phaser.Net;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -531,7 +609,7 @@ Phaser.Particles.prototype.constructor = Phaser.Particles;
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -558,6 +636,9 @@ Phaser.Particles.prototype.constructor = Phaser.Particles;
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

File diff suppressed because it is too large Load diff

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -770,7 +848,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-370">line 370</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-381">line 381</a>
</li></ul></dd> </li></ul></dd>
@ -872,7 +950,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-316">line 316</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-327">line 327</a>
</li></ul></dd> </li></ul></dd>
@ -974,7 +1052,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-399">line 399</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-419">line 419</a>
</li></ul></dd> </li></ul></dd>
@ -1076,7 +1154,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-329">line 329</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-340">line 340</a>
</li></ul></dd> </li></ul></dd>
@ -1385,7 +1463,7 @@ Any Game Object such as Phaser.Sprite that supports animation contains a single
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-350">line 350</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-361">line 361</a>
</li></ul></dd> </li></ul></dd>
@ -1971,7 +2049,7 @@ Animations added in this way are played back with the play function.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-297">line 297</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-308">line 308</a>
</li></ul></dd> </li></ul></dd>
@ -2089,7 +2167,7 @@ Animations added in this way are played back with the play function.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-264">line 264</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-270">line 270</a>
</li></ul></dd> </li></ul></dd>
@ -2364,7 +2442,7 @@ If the requested animation is already playing this request will be ignored. If y
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-176">line 176</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-183">line 183</a>
</li></ul></dd> </li></ul></dd>
@ -2456,7 +2534,7 @@ If the requested animation is already playing this request will be ignored. If y
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-285">line 285</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-291">line 291</a>
</li></ul></dd> </li></ul></dd>
@ -2634,7 +2712,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-209">line 209</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-216">line 216</a>
</li></ul></dd> </li></ul></dd>
@ -2703,7 +2781,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-239">line 239</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-246">line 246</a>
</li></ul></dd> </li></ul></dd>
@ -2899,7 +2977,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-142">line 142</a> <a href="AnimationManager.js.html">animation/AnimationManager.js</a>, <a href="AnimationManager.js.html#sunlight-1-line-149">line 149</a>
</li></ul></dd> </li></ul></dd>
@ -2973,7 +3051,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:18 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -3004,6 +3082,9 @@ The currentAnim property of the AnimationManager is automatically set to the ani
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -854,7 +932,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationParser.js.html">animation/AnimationParser.js</a>, <a href="AnimationParser.js.html#sunlight-1-line-168">line 168</a> <a href="AnimationParser.js.html">animation/AnimationParser.js</a>, <a href="AnimationParser.js.html#sunlight-1-line-165">line 165</a>
</li></ul></dd> </li></ul></dd>
@ -1420,7 +1498,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="AnimationParser.js.html">animation/AnimationParser.js</a>, <a href="AnimationParser.js.html#sunlight-1-line-242">line 242</a> <a href="AnimationParser.js.html">animation/AnimationParser.js</a>, <a href="AnimationParser.js.html#sunlight-1-line-235">line 235</a>
</li></ul></dd> </li></ul></dd>
@ -1494,7 +1572,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:19 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1525,6 +1603,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -738,7 +816,7 @@ The game automatically creates a single Stage sized camera on boot. Move the cam
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-100">line 100</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-105">line 105</a>
</li></ul></dd> </li></ul></dd>
@ -798,7 +876,7 @@ The game automatically creates a single Stage sized camera on boot. Move the cam
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-106">line 106</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-111">line 111</a>
</li></ul></dd> </li></ul></dd>
@ -858,7 +936,7 @@ The game automatically creates a single Stage sized camera on boot. Move the cam
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-112">line 112</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-117">line 117</a>
</li></ul></dd> </li></ul></dd>
@ -918,7 +996,7 @@ The game automatically creates a single Stage sized camera on boot. Move the cam
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-118">line 118</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-123">line 123</a>
</li></ul></dd> </li></ul></dd>
@ -1540,7 +1618,7 @@ at all then set this to null. The values can be anything and are in World coordi
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-402">line 402</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-420">line 420</a>
</li></ul></dd> </li></ul></dd>
@ -1654,6 +1732,108 @@ at all then set this to null. The values can be anything and are in World coordi
</dl>
</dd>
<dt>
<h4 class="name" id="scale"><span class="type-signature"></span>scale<span class="type-signature"></span></h4>
</dt>
<dd>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>scale</code></td>
<td class="type">
<span class="param-type"><a href="Phaser.Point.html">Phaser.Point</a></span>
</td>
<td class="description last"><p>The scale of the display object to which all game objects are added. Set by World.boot</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-97">line 97</a>
</li></ul></dd>
</dl> </dl>
@ -2172,7 +2352,7 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-385">line 385</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-403">line 403</a>
</li></ul></dd> </li></ul></dd>
@ -2380,7 +2560,7 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-339">line 339</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-357">line 357</a>
</li></ul></dd> </li></ul></dd>
@ -2486,7 +2666,7 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-362">line 362</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-380">line 380</a>
</li></ul></dd> </li></ul></dd>
@ -2551,7 +2731,7 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-263">line 263</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-268">line 268</a>
</li></ul></dd> </li></ul></dd>
@ -2669,7 +2849,7 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-165">line 165</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-170">line 170</a>
</li></ul></dd> </li></ul></dd>
@ -2810,7 +2990,7 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-176">line 176</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-181">line 181</a>
</li></ul></dd> </li></ul></dd>
@ -2889,6 +3069,12 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span> <span class="param-type"><a href="Phaser.Sprite.html">Phaser.Sprite</a></span>
|
<span class="param-type"><a href="Phaser.Image.html">Phaser.Image</a></span>
|
<span class="param-type"><a href="Phaser.Text.html">Phaser.Text</a></span>
@ -2971,7 +3157,76 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-122">line 122</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-127">line 127</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="reset"><span class="type-signature"></span>reset<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Resets the camera back to 0,0 and un-follows any object it may have been tracking.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-340">line 340</a>
</li></ul></dd> </li></ul></dd>
@ -3040,7 +3295,7 @@ Objects outside of this view are not rendered if set to camera cull.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-253">line 253</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-258">line 258</a>
</li></ul></dd> </li></ul></dd>
@ -3182,7 +3437,7 @@ without having to use game.camera.x and game.camera.y.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-301">line 301</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-306">line 306</a>
</li></ul></dd> </li></ul></dd>
@ -3323,7 +3578,7 @@ without having to use game.camera.x and game.camera.y.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-321">line 321</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-326">line 326</a>
</li></ul></dd> </li></ul></dd>
@ -3392,7 +3647,7 @@ without having to use game.camera.x and game.camera.y.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-188">line 188</a> <a href="Camera.js.html">core/Camera.js</a>, <a href="Camera.js.html#sunlight-1-line-193">line 193</a>
</li></ul></dd> </li></ul></dd>
@ -3443,7 +3698,7 @@ without having to use game.camera.x and game.camera.y.</p>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:23 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:20 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -3474,6 +3729,9 @@ without having to use game.camera.x and game.camera.y.</p>
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -715,7 +793,7 @@ If no parent is given it will be added as a child of the document.body.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-156">line 156</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-166">line 166</a>
</li></ul></dd> </li></ul></dd>
@ -766,7 +844,7 @@ If no parent is given it will be added as a child of the document.body.</p>
<dt> <dt>
<h4 class="name" id="create"><span class="type-signature">&lt;static> </span>create<span class="signature">(<span class="optional">width</span>, <span class="optional">height</span>, <span class="optional">id</span>)</span><span class="type-signature"> &rarr; {HTMLCanvasElement}</span></h4> <h4 class="name" id="create"><span class="type-signature">&lt;static> </span>create<span class="signature">(<span class="optional">width</span>, <span class="optional">height</span>, <span class="optional">id</span>, <span class="optional">noCocoon</span>)</span><span class="type-signature"> &rarr; {HTMLCanvasElement}</span></h4>
</dt> </dt>
@ -926,6 +1004,45 @@ If no parent is given it will be added as a child of the document.body.</p>
</tr> </tr>
<tr>
<td class="name"><code>noCocoon</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
false
</td>
<td class="description last"><p>CocoonJS only allows 1 screencanvas object, which should be your game. If you need to create another canvas (i.e. for a texture) set this to 'true'.</p></td>
</tr>
</tbody> </tbody>
</table> </table>
@ -1095,7 +1212,7 @@ If no parent is given it will be added as a child of the document.body.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-83">line 83</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-93">line 93</a>
</li></ul></dd> </li></ul></dd>
@ -1279,7 +1396,7 @@ If no parent is given it will be added as a child of the document.body.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-45">line 45</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-55">line 55</a>
</li></ul></dd> </li></ul></dd>
@ -1465,7 +1582,7 @@ If no parent is given it will be added as a child of the document.body.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-94">line 94</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-104">line 104</a>
</li></ul></dd> </li></ul></dd>
@ -1607,7 +1724,7 @@ Note that if this doesn't given the desired result then see the CanvasUtils.setS
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-269">line 269</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-279">line 279</a>
</li></ul></dd> </li></ul></dd>
@ -1749,7 +1866,7 @@ Note that if this doesn't given the desired result then see the setSmoothingEnab
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-248">line 248</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-258">line 258</a>
</li></ul></dd> </li></ul></dd>
@ -1917,7 +2034,7 @@ patchy on earlier browsers, especially on mobile.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-224">line 224</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-234">line 234</a>
</li></ul></dd> </li></ul></dd>
@ -2101,7 +2218,7 @@ patchy on earlier browsers, especially on mobile.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-112">line 112</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-122">line 122</a>
</li></ul></dd> </li></ul></dd>
@ -2380,7 +2497,7 @@ patchy on earlier browsers, especially on mobile.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-203">line 203</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-213">line 213</a>
</li></ul></dd> </li></ul></dd>
@ -2564,7 +2681,7 @@ patchy on earlier browsers, especially on mobile.</p>
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-132">line 132</a> <a href="Canvas.js.html">system/Canvas.js</a>, <a href="Canvas.js.html#sunlight-1-line-142">line 142</a>
</li></ul></dd> </li></ul></dd>
@ -2638,7 +2755,7 @@ patchy on earlier browsers, especially on mobile.</p>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:23 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:20 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -2669,6 +2786,9 @@ patchy on earlier browsers, especially on mobile.</p>
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -789,7 +867,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-329">line 329</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-375">line 375</a>
</li></ul></dd> </li></ul></dd>
@ -895,7 +973,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-306">line 306</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-348">line 348</a>
</li></ul></dd> </li></ul></dd>
@ -1001,7 +1079,7 @@
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-200">line 200</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-222">line 222</a>
</li></ul></dd> </li></ul></dd>
@ -1108,7 +1186,7 @@ If set to true it will reset all of the Circle objects properties to 0. A Circle
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-347">line 347</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-398">line 398</a>
</li></ul></dd> </li></ul></dd>
@ -1162,7 +1240,7 @@ If set to true it will reset all of the Circle objects properties to 0. A Circle
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-240">line 240</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-267">line 267</a>
</li></ul></dd> </li></ul></dd>
@ -1268,7 +1346,7 @@ If set to true it will reset all of the Circle objects properties to 0. A Circle
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-220">line 220</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-244">line 244</a>
</li></ul></dd> </li></ul></dd>
@ -1374,7 +1452,7 @@ If set to true it will reset all of the Circle objects properties to 0. A Circle
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-262">line 262</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-294">line 294</a>
</li></ul></dd> </li></ul></dd>
@ -1480,7 +1558,7 @@ If set to true it will reset all of the Circle objects properties to 0. A Circle
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-284">line 284</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-321">line 321</a>
</li></ul></dd> </li></ul></dd>
@ -1903,7 +1981,7 @@ If set to true it will reset all of the Circle objects properties to 0. A Circle
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-417">line 417</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-469">line 469</a>
</li></ul></dd> </li></ul></dd>
@ -2090,7 +2168,7 @@ If set to true it will reset all of the Circle objects properties to 0. A Circle
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-370">line 370</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-421">line 421</a>
</li></ul></dd> </li></ul></dd>
@ -2254,7 +2332,7 @@ If set to true it will reset all of the Circle objects properties to 0. A Circle
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-394">line 394</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-446">line 446</a>
</li></ul></dd> </li></ul></dd>
@ -2419,7 +2497,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-405">line 405</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-457">line 457</a>
</li></ul></dd> </li></ul></dd>
@ -2583,7 +2661,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-442">line 442</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-495">line 495</a>
</li></ul></dd> </li></ul></dd>
@ -2886,7 +2964,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-152">line 152</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-169">line 169</a>
</li></ul></dd> </li></ul></dd>
@ -3027,7 +3105,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-127">line 127</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-135">line 135</a>
</li></ul></dd> </li></ul></dd>
@ -3191,7 +3269,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-141">line 141</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-156">line 156</a>
</li></ul></dd> </li></ul></dd>
@ -3332,7 +3410,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-81">line 81</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-84">line 84</a>
</li></ul></dd> </li></ul></dd>
@ -3473,7 +3551,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-91">line 91</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-96">line 96</a>
</li></ul></dd> </li></ul></dd>
@ -3658,7 +3736,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-104">line 104</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-112">line 112</a>
</li></ul></dd> </li></ul></dd>
@ -3822,7 +3900,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-164">line 164</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-183">line 183</a>
</li></ul></dd> </li></ul></dd>
@ -3963,7 +4041,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-177">line 177</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-199">line 199</a>
</li></ul></dd> </li></ul></dd>
@ -4242,7 +4320,7 @@ This method checks the radius distances between the two Circle objects to see if
<dt class="tag-source">Source:</dt> <dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li> <dd class="tag-source"><ul class="dummy"><li>
<a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-187">line 187</a> <a href="Circle.js.html">geom/Circle.js</a>, <a href="Circle.js.html#sunlight-1-line-209">line 209</a>
</li></ul></dd> </li></ul></dd>
@ -4316,7 +4394,7 @@ This method checks the radius distances between the two Circle objects to see if
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:23 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:20 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -4347,6 +4425,9 @@ This method checks the radius distances between the two Circle objects to see if
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -3625,7 +3703,7 @@ Set the max value to restrict the maximum color used per channel.</p>
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:23 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:20 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -3656,6 +3734,9 @@ Set the max value to restrict the maximum color used per channel.</p>
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:21 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -695,7 +773,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:24 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -726,6 +804,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:25 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:25 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:25 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

View file

@ -90,10 +90,6 @@
<a href="Phaser.Device.html">Device</a> <a href="Phaser.Device.html">Device</a>
</li> </li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li> <li>
<a href="Phaser.Easing.html">Easing</a> <a href="Phaser.Easing.html">Easing</a>
</li> </li>
@ -142,6 +138,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li> </li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li> <li>
<a href="Phaser.Events.html">Events</a> <a href="Phaser.Events.html">Events</a>
</li> </li>
@ -162,6 +162,10 @@
<a href="Phaser.Game.html">Game</a> <a href="Phaser.Game.html">Game</a>
</li> </li>
<li>
<a href="Phaser.GameObjectCreator.html">GameObjectCreator</a>
</li>
<li> <li>
<a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a>
</li> </li>
@ -182,6 +186,10 @@
<a href="Phaser.Group.html">Group</a> <a href="Phaser.Group.html">Group</a>
</li> </li>
<li>
<a href="Phaser.Image.html">Image</a>
</li>
<li> <li>
<a href="Phaser.Input.html">Input</a> <a href="Phaser.Input.html">Input</a>
</li> </li>
@ -250,6 +258,82 @@
<a href="Phaser.Physics.Arcade.Body.html">Body</a> <a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li> </li>
<li>
<a href="Phaser.Physics.Ninja.html">Ninja</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.AABB.html">AABB</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Circle.html">Circle</a>
</li>
<li>
<a href="Phaser.Physics.Ninja.Tile.html">Tile</a>
</li>
<li>
<a href="Phaser.Physics.P2.html">P2</a>
</li>
<li>
<a href="Phaser.Physics.P2.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a>
</li>
<li>
<a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a>
</li>
<li>
<a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a>
</li>
<li>
<a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Material.html">Material</a>
</li>
<li>
<a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a>
</li>
<li>
<a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
</li>
<li>
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
</li>
<li> <li>
<a href="Phaser.Plugin.html">Plugin</a> <a href="Phaser.Plugin.html">Plugin</a>
</li> </li>
@ -290,6 +374,14 @@
<a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a>
</li> </li>
<li>
<a href="Phaser.RetroFont.html">RetroFont</a>
</li>
<li>
<a href="Phaser.ScaleManager.html">ScaleManager</a>
</li>
<li> <li>
<a href="Phaser.Signal.html">Signal</a> <a href="Phaser.Signal.html">Signal</a>
</li> </li>
@ -311,11 +403,11 @@
</li> </li>
<li> <li>
<a href="Phaser.Stage.html">Stage</a> <a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li> </li>
<li> <li>
<a href="Phaser.StageScaleMode.html">StageScaleMode</a> <a href="Phaser.Stage.html">Stage</a>
</li> </li>
<li> <li>
@ -398,20 +490,6 @@
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="global.html#SAT">SAT</a>
</li>
</ul>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -977,7 +1055,7 @@
<span class="jsdoc-message"> <span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Mon Feb 24 2014 01:12:25 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. on Fri Mar 14 2014 06:34:22 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span> </span>
</footer> </footer>
</div> </div>
@ -1008,6 +1086,9 @@
<script> <script>
$( function () { $( function () {
$( "#toc" ).toc( { $( "#toc" ).toc( {
anchorName : function(i, heading, prefix) {
return $(heading).attr("id") || ( prefix + i );
},
selectors : "h1,h2,h3,h4", selectors : "h1,h2,h3,h4",
showAndHide : false, showAndHide : false,
scrollTo : 60 scrollTo : 60

Some files were not shown because too many files have changed in this diff Show more