@@ -591,7 +595,7 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/AnimationManager.js.html b/Docs/out/AnimationManager.js.html
index 90563ccb..b9ff5c8d 100644
--- a/Docs/out/AnimationManager.js.html
+++ b/Docs/out/AnimationManager.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -540,7 +544,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameName", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Camera.js.html b/Docs/out/Camera.js.html
index 765e9052..ef859c8d 100644
--- a/Docs/out/Camera.js.html
+++ b/Docs/out/Camera.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -520,7 +524,7 @@ Object.defineProperty(Phaser.Camera.prototype, "height", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Circle.js.html b/Docs/out/Circle.js.html
index 02a5b67e..c0037758 100644
--- a/Docs/out/Circle.js.html
+++ b/Docs/out/Circle.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -638,7 +642,7 @@ Phaser.Circle.intersectsRectangle = function (c, r) {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Frame.js.html b/Docs/out/Frame.js.html
index a1354c42..89cf7d32 100644
--- a/Docs/out/Frame.js.html
+++ b/Docs/out/Frame.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -328,7 +332,7 @@ Phaser.Animation.Frame.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/FrameData.js.html b/Docs/out/FrameData.js.html
index 3511cc40..9c34b36f 100644
--- a/Docs/out/FrameData.js.html
+++ b/Docs/out/FrameData.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -402,7 +406,7 @@ Object.defineProperty(Phaser.Animation.FrameData.prototype, "total", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Game.js.html b/Docs/out/Game.js.html
index e3a6ddcd..8e2a95c4 100644
--- a/Docs/out/Game.js.html
+++ b/Docs/out/Game.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -643,7 +647,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Group.js.html b/Docs/out/Group.js.html
index a0be5682..ce9faefc 100644
--- a/Docs/out/Group.js.html
+++ b/Docs/out/Group.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -321,7 +325,7 @@ Phaser.LinkedList.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Parser.js.html b/Docs/out/Parser.js.html
index 51189dc7..c9f06d27 100644
--- a/Docs/out/Parser.js.html
+++ b/Docs/out/Parser.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -486,7 +490,7 @@ Phaser.Animation.Parser = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.Frame.html b/Docs/out/Phaser.Animation.Frame.html
index 12d686ae..0317af56 100644
--- a/Docs/out/Phaser.Animation.Frame.html
+++ b/Docs/out/Phaser.Animation.Frame.html
@@ -82,6 +82,10 @@
Group
+
@@ -2680,7 +2684,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.FrameData.html b/Docs/out/Phaser.Animation.FrameData.html
index 38d98ed6..65f716b4 100644
--- a/Docs/out/Phaser.Animation.FrameData.html
+++ b/Docs/out/Phaser.Animation.FrameData.html
@@ -82,6 +82,10 @@
Group
+
@@ -1627,7 +1631,7 @@ The frames are returned in the output array, or if none is provided in a new Arr
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.Parser.html b/Docs/out/Phaser.Animation.Parser.html
index 3580f6d5..1623b480 100644
--- a/Docs/out/Phaser.Animation.Parser.html
+++ b/Docs/out/Phaser.Animation.Parser.html
@@ -82,6 +82,10 @@
Group
+
@@ -1134,7 +1138,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Animation.html b/Docs/out/Phaser.Animation.html
index f1d09803..1c2338c5 100644
--- a/Docs/out/Phaser.Animation.html
+++ b/Docs/out/Phaser.Animation.html
@@ -82,6 +82,10 @@
Group
+
@@ -2511,7 +2515,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.AnimationManager.html b/Docs/out/Phaser.AnimationManager.html
index 6c1f7ad9..afe768a5 100644
--- a/Docs/out/Phaser.AnimationManager.html
+++ b/Docs/out/Phaser.AnimationManager.html
@@ -82,6 +82,10 @@
Group
+
@@ -2335,7 +2339,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Camera.html b/Docs/out/Phaser.Camera.html
index 5a83e805..1b2571dc 100644
--- a/Docs/out/Phaser.Camera.html
+++ b/Docs/out/Phaser.Camera.html
@@ -82,6 +82,10 @@
Group
+
@@ -2762,7 +2766,7 @@ without having to use game.camera.x and game.camera.y.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Circle.html b/Docs/out/Phaser.Circle.html
index 4ebbc588..1c986106 100644
--- a/Docs/out/Phaser.Circle.html
+++ b/Docs/out/Phaser.Circle.html
@@ -82,6 +82,10 @@
Group
+
@@ -4012,7 +4016,7 @@ This method checks the radius distances between the two Circle objects to see if
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Game.html b/Docs/out/Phaser.Game.html
index c5a3c4d8..1e1b1cee 100644
--- a/Docs/out/Phaser.Game.html
+++ b/Docs/out/Phaser.Game.html
@@ -82,6 +82,10 @@
Group
+
@@ -1524,7 +1528,7 @@ providing quick access to common functions and handling the boot process.
-Phaser.Input
+Phaser.Input
@@ -4199,7 +4203,7 @@ When a game is paused the onPause event is dispatched. When it is resumed the on
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Group.html b/Docs/out/Phaser.Group.html
index c821b008..5e40e3ca 100644
--- a/Docs/out/Phaser.Group.html
+++ b/Docs/out/Phaser.Group.html
@@ -82,6 +82,10 @@
Group
+
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
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
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.
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.
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
The X coordinate of the most recently active pointer. This value takes game scaling into account automatically. See Pointer.screenX/clientX for source values.
+
+
+
+
+
+
+
+
+
+
Properties:
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
x
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
The X coordinate of the most recently active pointer.
The Y coordinate of the most recently active pointer. This value takes game scaling into account automatically. See Pointer.screenY/clientY for source values.
+
+
+
+
+
+
+
+
+
+
Properties:
+
+
+
+
+
+
+
+
Name
+
+
+
Type
+
+
+
+
+
+
Description
+
+
+
+
+
+
+
+
+
y
+
+
+
+
+
+number
+
+
+
+
+
+
+
+
+
+
The Y coordinate of the most recently active pointer.
Add a new Pointer object to the Input Manager. By default Input creates 2 pointer objects for you. If you need more
+use this to create a new one, up to a maximum of 10.
@@ -1179,7 +1183,7 @@ The function must exist on the member.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Plugin.html b/Docs/out/Phaser.Plugin.html
index d6e5d47d..191b741c 100644
--- a/Docs/out/Phaser.Plugin.html
+++ b/Docs/out/Phaser.Plugin.html
@@ -82,6 +82,10 @@
Group
+
@@ -1531,7 +1535,7 @@ It is only called if active is set to true.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Point.html b/Docs/out/Phaser.Point.html
index 405b7af6..03902aac 100644
--- a/Docs/out/Phaser.Point.html
+++ b/Docs/out/Phaser.Point.html
@@ -82,6 +82,10 @@
Group
+
@@ -4721,7 +4725,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Rectangle.html b/Docs/out/Phaser.Rectangle.html
index e77f6465..46b8f57d 100644
--- a/Docs/out/Phaser.Rectangle.html
+++ b/Docs/out/Phaser.Rectangle.html
@@ -82,6 +82,10 @@
Group
+
@@ -7062,7 +7066,7 @@ This method checks the x, y, width, and height properties of the Rectangles.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Signal.html b/Docs/out/Phaser.Signal.html
index b319e1b8..ef0ec898 100644
--- a/Docs/out/Phaser.Signal.html
+++ b/Docs/out/Phaser.Signal.html
@@ -82,6 +82,10 @@
Group
+
@@ -2018,7 +2022,7 @@ already dispatched before.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.Stage.html b/Docs/out/Phaser.Stage.html
index 06c46fa8..636582f3 100644
--- a/Docs/out/Phaser.Stage.html
+++ b/Docs/out/Phaser.Stage.html
@@ -82,6 +82,10 @@
Group
+
@@ -1207,7 +1211,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.State.html b/Docs/out/Phaser.State.html
index 2abdd191..fb816582 100644
--- a/Docs/out/Phaser.State.html
+++ b/Docs/out/Phaser.State.html
@@ -82,6 +82,10 @@
Group
+
@@ -710,7 +714,7 @@ It provides quick access to common functions such as the camera, cache, input, m
-Phaser.Input
+Phaser.Input
@@ -2298,7 +2302,7 @@ If you need to use the loader, you may need to use them here.
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.StateManager.html b/Docs/out/Phaser.StateManager.html
index e88858ea..ac9ffc8a 100644
--- a/Docs/out/Phaser.StateManager.html
+++ b/Docs/out/Phaser.StateManager.html
@@ -82,6 +82,10 @@
Group
+
@@ -3155,7 +3159,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.World.html b/Docs/out/Phaser.World.html
index a118f818..020bb9f1 100644
--- a/Docs/out/Phaser.World.html
+++ b/Docs/out/Phaser.World.html
@@ -82,6 +82,10 @@
Group
+
@@ -1868,7 +1872,7 @@ the world at world-based coordinates. By default a world is created the same siz
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:27 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Phaser.js.html b/Docs/out/Phaser.js.html
index 8bd8fd9a..bbfde5f5 100644
--- a/Docs/out/Phaser.js.html
+++ b/Docs/out/Phaser.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -209,7 +213,7 @@ PIXI.InteractionManager = function (dummy) {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Plugin.js.html b/Docs/out/Plugin.js.html
index bc355e1f..032662d5 100644
--- a/Docs/out/Plugin.js.html
+++ b/Docs/out/Plugin.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -283,7 +287,7 @@ Phaser.Plugin.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/PluginManager-Phaser.PluginManager.html b/Docs/out/PluginManager-Phaser.PluginManager.html
index caa45d03..5e6d6eec 100644
--- a/Docs/out/PluginManager-Phaser.PluginManager.html
+++ b/Docs/out/PluginManager-Phaser.PluginManager.html
@@ -82,6 +82,10 @@
Group
+
@@ -548,7 +552,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/PluginManager.html b/Docs/out/PluginManager.html
index abcbd9b9..6084a8d3 100644
--- a/Docs/out/PluginManager.html
+++ b/Docs/out/PluginManager.html
@@ -82,6 +82,10 @@
Group
+
@@ -249,7 +253,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:26 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/PluginManager.js.html b/Docs/out/PluginManager.js.html
index 45f1cc08..e8a5418e 100644
--- a/Docs/out/PluginManager.js.html
+++ b/Docs/out/PluginManager.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -401,7 +405,7 @@ Phaser.PluginManager.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Point.js.html b/Docs/out/Point.js.html
index bf05e2d7..cdf3f1bd 100644
--- a/Docs/out/Point.js.html
+++ b/Docs/out/Point.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -563,7 +567,7 @@ Phaser.Point.rotate = function (a, x, y, angle, asDegrees, distance) {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Rectangle.js.html b/Docs/out/Rectangle.js.html
index 8ac3b2be..9515f5a4 100644
--- a/Docs/out/Rectangle.js.html
+++ b/Docs/out/Rectangle.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -832,7 +836,7 @@ Phaser.Rectangle.union = function (a, b, out) {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Signal.js.html b/Docs/out/Signal.js.html
index f10c19d0..92e4f6aa 100644
--- a/Docs/out/Signal.js.html
+++ b/Docs/out/Signal.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -465,7 +469,7 @@ Phaser.Signal.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/SignalBinding.html b/Docs/out/SignalBinding.html
index 3fe72dd4..3d41330f 100644
--- a/Docs/out/SignalBinding.html
+++ b/Docs/out/SignalBinding.html
@@ -82,6 +82,10 @@
Group
+
@@ -465,7 +469,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:55 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:27 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/SignalBinding.js.html b/Docs/out/SignalBinding.js.html
index 080ffba4..e2bf2418 100644
--- a/Docs/out/SignalBinding.js.html
+++ b/Docs/out/SignalBinding.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -330,7 +334,7 @@ Phaser.SignalBinding.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/Stage.js.html b/Docs/out/Stage.js.html
index b7f5a656..4e5f83e6 100644
--- a/Docs/out/Stage.js.html
+++ b/Docs/out/Stage.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -314,7 +318,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/State.js.html b/Docs/out/State.js.html
index 0110a04b..4f2ebac7 100644
--- a/Docs/out/State.js.html
+++ b/Docs/out/State.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -337,7 +341,7 @@ Phaser.State.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/StateManager.js.html b/Docs/out/StateManager.js.html
index ccd7c747..b3636079 100644
--- a/Docs/out/StateManager.js.html
+++ b/Docs/out/StateManager.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -693,7 +697,7 @@ Phaser.StateManager.prototype = {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/World.js.html b/Docs/out/World.js.html
index 966c784c..e950278a 100644
--- a/Docs/out/World.js.html
+++ b/Docs/out/World.js.html
@@ -82,6 +82,10 @@
Group
+
@@ -410,7 +414,7 @@ Object.defineProperty(Phaser.World.prototype, "randomY", {
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/classes.list.html b/Docs/out/classes.list.html
index 6b090e08..09d1aa16 100644
--- a/Docs/out/classes.list.html
+++ b/Docs/out/classes.list.html
@@ -82,6 +82,10 @@
Group
+
@@ -295,7 +302,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/index.html b/Docs/out/index.html
index e5fcf3b9..19393359 100644
--- a/Docs/out/index.html
+++ b/Docs/out/index.html
@@ -82,6 +82,10 @@
Group
+
@@ -185,7 +189,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/module-Phaser.html b/Docs/out/module-Phaser.html
index 7e8141f8..55118b51 100644
--- a/Docs/out/module-Phaser.html
+++ b/Docs/out/module-Phaser.html
@@ -82,6 +82,10 @@
Group
+
@@ -236,7 +240,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/Docs/out/modules.list.html b/Docs/out/modules.list.html
index c7e78d84..88985847 100644
--- a/Docs/out/modules.list.html
+++ b/Docs/out/modules.list.html
@@ -82,6 +82,10 @@
Group
+
@@ -295,7 +302,7 @@
Documentation generated by JSDoc 3.2.0-dev
- on Wed Oct 02 2013 12:09:54 GMT+0100 (BST) using the DocStrap template.
+ on Wed Oct 02 2013 12:28:25 GMT+0100 (BST) using the DocStrap template.
diff --git a/src/input/Input.js b/src/input/Input.js
index 4ac153f3..efe1f7b0 100644
--- a/src/input/Input.js
+++ b/src/input/Input.js
@@ -2,7 +2,6 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.Input
*/
/**
@@ -34,8 +33,22 @@ Phaser.Input = function (game) {
};
+/**
+* @constant
+* @type {number}
+*/
Phaser.Input.MOUSE_OVERRIDES_TOUCH = 0;
+
+/**
+* @constant
+* @type {number}
+*/
Phaser.Input.TOUCH_OVERRIDES_MOUSE = 1;
+
+/**
+* @constant
+* @type {number}
+*/
Phaser.Input.MOUSE_TOUCH_COMBINE = 2;
Phaser.Input.prototype = {
@@ -63,8 +76,9 @@ Phaser.Input.prototype = {
/**
* A vector object representing the previous position of the Pointer.
* @property {Vec2} vector
+ * @private
* @default
- **/
+ */
_oldPosition: null,
/**
@@ -99,31 +113,31 @@ Phaser.Input.prototype = {
/**
* A vector object representing the current position of the Pointer.
- * @property {Vec2} position
+ * @property {Phaser.Point} position
* @default
- **/
+ */
position: null,
/**
* A vector object representing the speed of the Pointer. Only really useful in single Pointer games,
* otherwise see the Pointer objects directly.
- * @property {Vec2} speed
+ * @property {Phaser.Point} speed
* @default
- **/
+ */
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 {Circle} circle
+ * Default size of 44px (Apples recommended "finger tip" size) but can be changed to anything.
+ * @property {Phaser.Circle} circle
* @default
- **/
+ */
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 {Vec2} scale
+ * @property {Phaser.Point} scale
* @default
*/
scale: null,
@@ -147,35 +161,35 @@ Phaser.Input.prototype = {
* 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,
/**
@@ -184,7 +198,7 @@ Phaser.Input.prototype = {
* The history is updated at the rate specified in Input.pollRate
* @property {boolean} recordPointerHistory
* @default
- **/
+ */
recordPointerHistory: false,
/**
@@ -204,142 +218,146 @@ Phaser.Input.prototype = {
/**
* A Pointer object
- * @property {Pointer} pointer1
- **/
+ * @property {Phaser.Pointer} pointer1
+ */
pointer1: null,
/**
* A Pointer object
- * @property {Pointer} pointer2
- **/
+ * @property {Phaser.Pointer} pointer2
+ */
pointer2: null,
/**
* A Pointer object
- * @property {Pointer} pointer3
- **/
+ * @property {Phaser.Pointer} pointer3
+ */
pointer3: null,
/**
* A Pointer object
- * @property {Pointer} pointer4
- **/
+ * @property {Phaser.Pointer} pointer4
+ */
pointer4: null,
/**
* A Pointer object
- * @property {Pointer} pointer5
- **/
+ * @property {Phaser.Pointer} pointer5
+ */
pointer5: null,
/**
* A Pointer object
- * @property {Pointer} pointer6
- **/
+ * @property {Phaser.Pointer} pointer6
+ */
pointer6: null,
/**
* A Pointer object
- * @property {Pointer} pointer7
- **/
+ * @property {Phaser.Pointer} pointer7
+ */
pointer7: null,
/**
* A Pointer object
- * @property {Pointer} pointer8
- **/
+ * @property {Phaser.Pointer} pointer8
+ */
pointer8: null,
/**
* A Pointer object
- * @property {Pointer} pointer9
- **/
+ * @property {Phaser.Pointer} pointer9
+ */
pointer9: null,
/**
* A Pointer object.
- * @property {Pointer} pointer10
- **/
+ * @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 {Pointer} activePointer
+ * @property {Phaser.Pointer} activePointer
* @default
- **/
+ */
activePointer: null,
/**
- * Description.
+ * 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,
/**
- * Description.
- * @property {Description} mouse
+ * The Mouse Input manager.
+ * @property {Phaser.Mouse} mouse - The Mouse Input manager.
* @default
- **/
+ */
mouse: null,
/**
- * Description.
- * @property {Description} keyboard
+ * The Keyboard Input manager.
+ * @property {Phaser.Keyboard} keyboard - The Keyboard Input manager.
* @default
- **/
+ */
keyboard: null,
/**
- * Description.
- * @property {Description} touch
+ * The Touch Input manager.
+ * @property {Phaser.Touch} touch - the Touch Input manager.
* @default
- **/
+ */
touch: null,
/**
- * Description.
- * @property {Description} mspointer
+ * The MSPointer Input manager.
+ * @property {Phaser.MSPointer} mspointer - The MSPointer Input manager.
* @default
- **/
+ */
mspointer: null,
/**
- * Description.
- * @property {Description} onDown
+ * A Signal that is dispatched each time a pointer is pressed down.
+ * @property {Phaser.Signal} onDown
* @default
- **/
+ */
onDown: null,
/**
- * Description.
- * @property {Description} onUp
+ * A Signal that is dispatched each time a pointer is released.
+ * @property {Phaser.Signal} onUp
* @default
- **/
+ */
onUp: null,
/**
- * Description.
- * @property {Description} onTap
+ * A Signal that is dispatched each time a pointer is tapped.
+ * @property {Phaser.Signal} onTap
* @default
- **/
+ */
onTap: null,
/**
- * Description.
- * @property {Description} onHold
+ * 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 (belong to Sprites) register themselves with this
+ /**
+ * 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.
- * @method start
- **/
+ * @method Phaser.Input#boot
+ * @protected
+ */
boot: function () {
this.mousePointer = new Phaser.Pointer(this.game, 0);
@@ -380,11 +398,11 @@ Phaser.Input.prototype = {
},
/**
- * Add a new Pointer object to the Input Manager. By default Input creates 2 pointer objects for you. If you need more
- * use this to create a new one, up to a maximum of 10.
- * @method addPointer
- * @return {Pointer} A reference to the new Pointer object.
- **/
+ * Add a new Pointer object to the Input Manager. By default Input creates 3 pointer objects: mousePointer, pointer1 and pointer2.
+ * If you need more then use this to create a new one, up to a maximum of 10.
+ * @method Phaser.Input#addPointer
+ * @return {Phaser.Pointer} A reference to the new Pointer object that was created.
+ */
addPointer: function () {
var next = 0;
@@ -412,8 +430,9 @@ Phaser.Input.prototype = {
/**
* Updates the Input Manager. Called by the core Game loop.
- * @method update
- **/
+ * @method Phaser.Input#update
+ * @protected
+ */
update: function () {
if (this.pollRate > 0 && this._pollCounter < this.pollRate)
@@ -445,9 +464,9 @@ Phaser.Input.prototype = {
/**
* Reset all of the Pointers and Input states
- * @method reset
- * @param {boolean} hard - A soft reset (hard = false) won't reset any signals that might be bound. A hard reset will.
- **/
+ * @method Phaser.Input#reset
+ * @param {boolean} hard - A soft reset (hard = false) won't reset any Signals that might be bound. A hard reset will.
+ */
reset: function (hard) {
if (this.game.isBooted == false)
@@ -489,6 +508,12 @@ Phaser.Input.prototype = {
},
+ /**
+ * Resets the speed and old position properties.
+ * @method Phaser.Input#resetSpeed
+ * @param {number} x - Sets the oldPosition.x value.
+ * @param {number} y - Sets the oldPosition.y value.
+ */
resetSpeed: function (x, y) {
this._oldPosition.setTo(x, y);
@@ -497,11 +522,11 @@ Phaser.Input.prototype = {
},
/**
- * Find the first free Pointer object and start it, passing in the event data.
- * @method startPointer
+ * Find the first free Pointer object and start it, passing in the event data. This is called automatically by Phaser.Touch and Phaser.MSPointer.
+ * @method Phaser.Input#startPointer
* @param {Any} event - The event data from the Touch event.
- * @return {Pointer} The Pointer object that was started or null if no Pointer object is available.
- **/
+ * @return {Phaser.Pointer} The Pointer object that was started or null if no Pointer object is available.
+ */
startPointer: function (event) {
if (this.maxPointers < 10 && this.totalActivePointers == this.maxPointers)
@@ -533,11 +558,11 @@ Phaser.Input.prototype = {
},
/**
- * Updates the matching Pointer object, passing in the event data.
- * @method updatePointer
+ * Updates the matching Pointer object, passing in the event data. This is called automatically and should not normally need to be invoked.
+ * @method Phaser.Input#updatePointer
* @param {Any} event - The event data from the Touch event.
- * @return {Pointer} The Pointer object that was updated or null if no Pointer object is available.
- **/
+ * @return {Phaser.Pointer} The Pointer object that was updated or null if no Pointer object is available.
+ */
updatePointer: function (event) {
if (this.pointer1.active && this.pointer1.identifier == event.identifier)
@@ -565,10 +590,10 @@ Phaser.Input.prototype = {
/**
* Stops the matching Pointer object, passing in the event data.
- * @method stopPointer
+ * @method Phaser.Input#stopPointer
* @param {Any} event - The event data from the Touch event.
- * @return {Pointer} The Pointer object that was stopped or null if no Pointer object is available.
- **/
+ * @return {Phaser.Pointer} The Pointer object that was stopped or null if no Pointer object is available.
+ */
stopPointer: function (event) {
if (this.pointer1.active && this.pointer1.identifier == event.identifier)
@@ -596,10 +621,10 @@ Phaser.Input.prototype = {
/**
* Get the next Pointer object whos active property matches the given state
- * @method getPointer
+ * @method Phaser.Input#getPointer
* @param {boolean} state - The state the Pointer should be in (false for inactive, true for active).
- * @return {Pointer} A Pointer object or null if no Pointer object matches the requested state.
- **/
+ * @return {Phaser.Pointer} A Pointer object or null if no Pointer object matches the requested state.
+ */
getPointer: function (state) {
state = state || false;
@@ -629,10 +654,10 @@ Phaser.Input.prototype = {
/**
* Get the Pointer object whos identified property matches the given identifier value.
- * @method getPointerFromIdentifier
+ * @method Phaser.Input#getPointerFromIdentifier
* @param {number} identifier - The Pointer.identifier value to search for.
- * @return {Pointer} A Pointer object or null if no Pointer object matches the requested identifier.
- **/
+ * @return {Phaser.Pointer} A Pointer object or null if no Pointer object matches the requested identifier.
+ */
getPointerFromIdentifier: function (identifier) {
if (this.pointer1.identifier == identifier)
@@ -660,37 +685,32 @@ Phaser.Input.prototype = {
/**
* Get the distance between two Pointer objects.
- * @method getDistance
+ * @method Phaser.Input#getDistance
* @param {Pointer} pointer1
* @param {Pointer} pointer2
* @return {Description} Description.
- **/
+ */
getDistance: function (pointer1, pointer2) {
// return Phaser.Vec2Utils.distance(pointer1.position, pointer2.position);
},
/**
* Get the angle between two Pointer objects.
- * @method getAngle
+ * @method Phaser.Input#getAngle
* @param {Pointer} pointer1
* @param {Pointer} pointer2
* @return {Description} Description.
- **/
+ */
getAngle: function (pointer1, pointer2) {
// return Phaser.Vec2Utils.angle(pointer1.position, pointer2.position);
}
};
-// Getters / Setters
-
/**
-* The X coordinate of the most recently active pointer.
-* This value takes game scaling into account automatically. See Pointer.screenX/clientX for source values.
-* @return {number}
-*//**
-* Set
-* @param {number} value - Description.
+* The X coordinate of the most recently active pointer. This value takes game scaling into account automatically. See Pointer.screenX/clientX for source values.
+* @name Phaser.Input#x
+* @property {number} x - The X coordinate of the most recently active pointer.
*/
Object.defineProperty(Phaser.Input.prototype, "x", {
@@ -705,12 +725,9 @@ Object.defineProperty(Phaser.Input.prototype, "x", {
});
/**
-* The Y coordinate of the most recently active pointer.
- * This value takes game scaling into account automatically. See Pointer.screenY/clientY for source values.
-* @return {number}
-*//**
-* Set
-* @param {number} value - Description.
+* The Y coordinate of the most recently active pointer. This value takes game scaling into account automatically. See Pointer.screenY/clientY for source values.
+* @name Phaser.Input#y
+* @property {number} y - The Y coordinate of the most recently active pointer.
*/
Object.defineProperty(Phaser.Input.prototype, "y", {
@@ -725,8 +742,9 @@ Object.defineProperty(Phaser.Input.prototype, "y", {
});
/**
-* Get
-* @return {Description} Description.
+* @name Phaser.Input#pollLocked
+* @property {boolean} pollLocked - True if the Input is currently poll rate locked.
+* @readonly
*/
Object.defineProperty(Phaser.Input.prototype, "pollLocked", {
@@ -737,8 +755,10 @@ Object.defineProperty(Phaser.Input.prototype, "pollLocked", {
});
/**
-* Get the total number of inactive Pointers
-* @return {number} The number of Pointers currently inactive.
+* The total number of inactive Pointers
+* @name Phaser.Input#totalInactivePointers
+* @property {number} totalInactivePointers - The total number of inactive Pointers.
+* @readonly
*/
Object.defineProperty(Phaser.Input.prototype, "totalInactivePointers", {
@@ -749,8 +769,10 @@ Object.defineProperty(Phaser.Input.prototype, "totalInactivePointers", {
});
/**
-* Recalculates the total number of active Pointers
-* @return {number} The number of Pointers currently active.
+* The total number of active Pointers
+* @name Phaser.Input#totalActivePointers
+* @property {number} totalActivePointers - The total number of active Pointers.
+* @readonly
*/
Object.defineProperty(Phaser.Input.prototype, "totalActivePointers", {
@@ -773,8 +795,9 @@ Object.defineProperty(Phaser.Input.prototype, "totalActivePointers", {
});
/**
-* Get
-* @return {Description}
+* The world X coordinate of the most recently active pointer.
+* @name Phaser.Input#worldX
+* @property {number} worldX - The world X coordinate of the most recently active pointer.
*/
Object.defineProperty(Phaser.Input.prototype, "worldX", {
@@ -785,8 +808,9 @@ Object.defineProperty(Phaser.Input.prototype, "worldX", {
});
/**
-* Get
-* @return {Description}
+* The world Y coordinate of the most recently active pointer.
+* @name Phaser.Input#worldY
+* @property {number} worldY - The world Y coordinate of the most recently active pointer.
*/
Object.defineProperty(Phaser.Input.prototype, "worldY", {
diff --git a/src/input/Key.js b/src/input/Key.js
index a94bf7d5..b8ad2ab4 100644
--- a/src/input/Key.js
+++ b/src/input/Key.js
@@ -1,73 +1,92 @@
+/**
+* @author Richard Davey
+* @copyright 2013 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
+/**
+* @class Phaser.Key
+* @classdesc If you need more fine-grained control over the handling of specific keys you can create and use Phaser.Key objects.
+* @constructor
+* @param {Phaser.Game} game - Current game instance.
+* @param {number} keycode - The key code this Key is responsible for.
+*/
Phaser.Key = function (game, keycode) {
+ /**
+ * @property {Phaser.Game} game - A reference to the currently running game.
+ */
this.game = game;
/**
- *
- * @property isDown
- * @type Boolean
- **/
+ * @property {boolean} isDown - The "down" state of the key.
+ * @default
+ */
this.isDown = false;
/**
- *
- * @property isUp
- * @type Boolean
- **/
+ * @property {boolean} isUp - The "up" state of the key.
+ * @default
+ */
this.isUp = false;
/**
- *
- * @property altKey
- * @type Boolean
- **/
+ * @property {boolean} altKey - The down state of the ALT key, if pressed at the same time as this key.
+ * @default
+ */
this.altKey = false;
/**
- *
- * @property ctrlKey
- * @type Boolean
- **/
+ * @property {boolean} ctrlKey - The down state of the CTRL key, if pressed at the same time as this key.
+ * @default
+ */
this.ctrlKey = false;
/**
- *
- * @property shiftKey
- * @type Boolean
- **/
+ * @property {boolean} shiftKey - The down state of the SHIFT key, if pressed at the same time as this key.
+ * @default
+ */
this.shiftKey = false;
/**
- *
- * @property timeDown
- * @type Number
- **/
+ * @property {number} timeDown - The timestamp when the key was last pressed down.
+ * @default
+ */
this.timeDown = 0;
/**
- *
- * @property duration
- * @type Number
- **/
+ * If the key is down this value holds the duration of that key press and is constantly updated.
+ * If the key is up it holds the duration of the previous down session.
+ * @property {number} duration - The number of milliseconds this key has been held down for.
+ * @default
+ */
this.duration = 0;
/**
- *
- * @property timeUp
- * @type Number
- **/
+ * @property {number} timeUp - The timestamp when the key was last released.
+ * @default
+ */
this.timeUp = 0;
/**
- *
- * @property repeats
- * @type Number
- **/
+ * @property {number} repeats - If a key is held down this holds down the number of times the key has 'repeated'.
+ * @default
+ */
this.repeats = 0;
+ /**
+ * @property {number} keyCode - The keycode of this key.
+ */
this.keyCode = keycode;
+ /**
+ * @property {Phaser.Signal} onDown - This Signal is dispatched every time this Key is pressed down. It is only dispatched once (until the key is released again).
+ */
this.onDown = new Phaser.Signal();
+
+ /**
+ * @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).
+ */
this.onUp = new Phaser.Signal();
};
@@ -75,10 +94,10 @@ Phaser.Key = function (game, keycode) {
Phaser.Key.prototype = {
/**
- *
- * @method update
+ * Called automatically by Phaser.Keyboard.
+ * @method Phaser.Key#processKeyDown
* @param {KeyboardEvent} event.
- * @return {}
+ * @protected
*/
processKeyDown: function (event) {
@@ -105,6 +124,12 @@ Phaser.Key.prototype = {
},
+ /**
+ * Called automatically by Phaser.Keyboard.
+ * @method Phaser.Key#processKeyUp
+ * @param {KeyboardEvent} event.
+ * @protected
+ */
processKeyUp: function (event) {
this.isDown = false;
@@ -116,8 +141,10 @@ Phaser.Key.prototype = {
},
/**
- * @param {number} [duration]
- * @return {boolean}
+ * 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
+ * @param {number} [duration=250] - The duration below which the key is considered as being just pressed.
+ * @return {boolean} True if the key is just pressed otherwise false.
*/
justPressed: function (duration) {
@@ -128,8 +155,10 @@ Phaser.Key.prototype = {
},
/**
- * @param {number} [duration]
- * @return {boolean}
+ * 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.Key#justPressed
+ * @param {number} [duration=250] - The duration below which the key is considered as being just released.
+ * @return {boolean} True if the key is just released otherwise false.
*/
justReleased: function (duration) {
@@ -139,4 +168,4 @@ Phaser.Key.prototype = {
}
-};
\ No newline at end of file
+};
diff --git a/src/input/Keyboard.js b/src/input/Keyboard.js
index a2c1289c..3bc94e5b 100644
--- a/src/input/Keyboard.js
+++ b/src/input/Keyboard.js
@@ -2,10 +2,8 @@
* @author Richard Davey
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
-* @module Phaser.Keyboard
*/
-
/**
* Phaser - Keyboard constructor.
*
@@ -39,45 +37,53 @@ Phaser.Keyboard = function (game) {
*/
this._capture = {};
- this.callbackContext = this;
- this.onDownCallback = null;
- this.onUpCallback = null;
+ /**
+ * You can disable all Keyboard Input by setting disabled to true. While true all new input related events will be ignored.
+ * @property {boolean} disabled - The disabled state of the Keyboard.
+ * @default
+ */
+ disabled: false,
- this.onDown = new Phaser.Signal();
- this.onUp = new Phaser.Signal();
+ /**
+ * @property {function} _onKeyDown
+ * @private
+ * @default
+ */
+ _onKeyDown: null,
+
+ /**
+ * @property {function} _onKeyUp
+ * @private
+ * @default
+ */
+ _onKeyUp: null,
+
+ /**
+ * @property {Object} callbackContext - The context under which the callbacks are run.
+ */
+ this.callbackContext = this;
+
+ /**
+ * @property {function} onDownCallback - This callback is invoked every time a key is pressed down.
+ */
+ this.onDownCallback = null;
+
+ /**
+ * @property {function} onUpCallback - This callback is invoked every time a key is released.
+ */
+ this.onUpCallback = null;
};
Phaser.Keyboard.prototype = {
- /**
- * @property {Phaser.Game} game - Local reference to game.
- */
- game: null,
-
/**
- * You can disable all Input by setting disabled = true. While set all new input related events will be ignored.
- * @default
- * @property {boolean} disabled
+ * Add callbacks to the Keyboard handler so that each time a key is pressed down or releases the callbacks are activated.
+ * @method Phaser.Keyboard#addCallbacks
+ * @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} [onUp=null] - This callback is invoked every time a key is released.
*/
- disabled: false,
-
- /**
- * Description.
- * @property {Description} _onKeyDown
- * @private
- * @default
- */
- _onKeyDown: null,
-
- /**
- * Description.
- * @property {Description} _onKeyUp
- * @private
- * @default
- */
- _onKeyUp: null,
-
addCallbacks: function (context, onDown, onUp) {
this.callbackContext = context;
@@ -90,6 +96,14 @@ Phaser.Keyboard.prototype = {
},
+ /**
+ * If you need more fine-grained control over a Key you can create a new Phaser.Key object via this method.
+ * The Key object can then be polled, have events attached to it, etc.
+ *
+ * @method Phaser.Keyboard#addKey
+ * @param {number} keycode - The keycode of the key, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACE_BAR
+ * @return {Phaser.Key} The Key object which you can store locally and reference directly.
+ */
addKey: function (keycode) {
this._hotkeys[keycode] = new Phaser.Key(this.game, keycode);
@@ -97,16 +111,24 @@ Phaser.Keyboard.prototype = {
},
+ /**
+ * Removes a Key object from the Keyboard manager.
+ *
+ * @method Phaser.Keyboard#removeKey
+ * @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACE_BAR
+ */
removeKey: function (keycode) {
delete (this._hotkeys[keycode]);
},
- /**
- * Description.
- * @method start
- */
+ /**
+ * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the document.body.
+ * This is called automatically by Phaser.Input and should not normally be invoked directly.
+ *
+ * @method Phaser.Keyboard#start
+ */
start: function () {
var _this = this;
@@ -124,10 +146,11 @@ Phaser.Keyboard.prototype = {
},
- /**
- * Description.
- * @method stop
- */
+ /**
+ * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the document.body.
+ *
+ * @method Phaser.Keyboard#stop
+ */
stop: function () {
document.body.removeEventListener('keydown', this._onKeyDown);
@@ -140,7 +163,7 @@ 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.
* 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.
- * @method addKeyCapture
+ * @method Phaser.Keyboard#addKeyCapture
* @param {Any} keycode
*/
addKeyCapture: function (keycode) {
@@ -159,8 +182,8 @@ Phaser.Keyboard.prototype = {
},
/**
- * Description.
- * @method removeKeyCapture
+ * Removes an existing key capture.
+ * @method Phaser.Keyboard#removeKeyCapture
* @param {number} keycode
*/
removeKeyCapture: function (keycode) {
@@ -170,8 +193,8 @@ Phaser.Keyboard.prototype = {
},
/**
- * Description.
- * @method clearCaptures
+ * Clear all set key captures.
+ * @method Phaser.Keyboard#clearCaptures
*/
clearCaptures: function () {
@@ -180,9 +203,10 @@ Phaser.Keyboard.prototype = {
},
/**
- * Description.
- * @method processKeyDown
+ * Process the keydown event.
+ * @method Phaser.Keyboard#processKeyDown
* @param {KeyboardEvent} event
+ * @protected
*/
processKeyDown: function (event) {
@@ -235,9 +259,10 @@ Phaser.Keyboard.prototype = {
},
/**
- * Description.
- * @method processKeyUp
+ * Process the keyup event.
+ * @method Phaser.Keyboard#processKeyUp
* @param {KeyboardEvent} event
+ * @protected
*/
processKeyUp: function (event) {
@@ -267,8 +292,8 @@ Phaser.Keyboard.prototype = {
},
/**
- * Description.
- * @method reset
+ * Reset the "isDown" state of all keys.
+ * @method Phaser.Keyboard#reset
*/
reset: function () {
@@ -279,12 +304,12 @@ Phaser.Keyboard.prototype = {
},
- /**
- * Description.
- * @method justPressed
- * @param {number} keycode
- * @param {number} [duration]
- * @return {boolean}
+ /**
+ * 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
+ * @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACE_BAR
+ * @param {number} [duration=250] - The duration below which the key is considered as being just pressed.
+ * @return {boolean} True if the key is just pressed otherwise false.
*/
justPressed: function (keycode, duration) {
@@ -300,11 +325,11 @@ Phaser.Keyboard.prototype = {
},
/**
- * Description.
- * @method justReleased
- * @param {number} keycode
- * @param {number} [duration]
- * @return {boolean}
+ * 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#justPressed
+ * @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACE_BAR
+ * @param {number} [duration=250] - The duration below which the key is considered as being just released.
+ * @return {boolean} True if the key is just released otherwise false.
*/
justReleased: function (keycode, duration) {
@@ -320,10 +345,10 @@ Phaser.Keyboard.prototype = {
},
/**
- * Description.
- * @method isDown
- * @param {number} keycode
- * @return {boolean}
+ * 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
+ * @param {number} keycode - The keycode of the key to remove, i.e. Phaser.Keyboard.UP or Phaser.Keyboard.SPACE_BAR
+ * @return {boolean} True if the key is currently down.
*/
isDown: function (keycode) {
@@ -338,8 +363,6 @@ Phaser.Keyboard.prototype = {
};
-// Statics
-
Phaser.Keyboard.A = "A".charCodeAt(0);
Phaser.Keyboard.B = "B".charCodeAt(0);
Phaser.Keyboard.C = "C".charCodeAt(0);