mirror of
https://github.com/wassname/phaser.git
synced 2026-08-01 12:50:06 +08:00
Updated documentation.
This commit is contained in:
+83
-44
@@ -54,6 +54,10 @@
|
||||
<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>
|
||||
@@ -138,6 +142,10 @@
|
||||
<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>
|
||||
@@ -302,6 +310,26 @@
|
||||
<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>
|
||||
@@ -310,6 +338,10 @@
|
||||
<a href="Phaser.Time.html">Time</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Timer.html">Timer</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="Phaser.Touch.html">Touch</a>
|
||||
</li>
|
||||
@@ -356,6 +388,14 @@
|
||||
<a href="global.html#HEXtoRGB">HEXtoRGB</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#render">render</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#renderXY">renderXY</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="global.html#right">right</a>
|
||||
</li>
|
||||
@@ -388,36 +428,35 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Phaser - Keyboard constructor.
|
||||
* The Keyboard class handles looking after keyboard input for your game. It will recognise and respond to key presses and dispatch the required events.
|
||||
*
|
||||
* @class Phaser.Keyboard
|
||||
* @classdesc A Keyboard object Description.
|
||||
* @constructor
|
||||
* @param {Phaser.Game} game - A reference to the currently running game.
|
||||
*/
|
||||
Phaser.Keyboard = function (game) {
|
||||
|
||||
/**
|
||||
* @property {Phaser.Game} game - Local reference to game.
|
||||
*/
|
||||
this.game = game;
|
||||
|
||||
/**
|
||||
* @property {Description} _keys - Description.
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* @property {Phaser.Game} game - Local reference to game.
|
||||
*/
|
||||
this.game = game;
|
||||
|
||||
/**
|
||||
* @property {object} _keys - The object the key values are stored in.
|
||||
* @private
|
||||
*/
|
||||
this._keys = {};
|
||||
|
||||
/**
|
||||
* @property {Description} _hotkeys - Description.
|
||||
* @property {object} _hotkeys - The object the hot keys are stored in.
|
||||
* @private
|
||||
*/
|
||||
this._hotkeys = {};
|
||||
|
||||
/**
|
||||
* @property {Description} _capture - Description.
|
||||
* @private
|
||||
*/
|
||||
/**
|
||||
* @property {object} _capture - The object the key capture values are stored in.
|
||||
* @private
|
||||
*/
|
||||
this._capture = {};
|
||||
|
||||
/**
|
||||
@@ -455,7 +494,7 @@ Phaser.Keyboard = function (game) {
|
||||
* @property {function} onUpCallback - This callback is invoked every time a key is released.
|
||||
*/
|
||||
this.onUpCallback = null;
|
||||
|
||||
|
||||
};
|
||||
|
||||
Phaser.Keyboard.prototype = {
|
||||
@@ -517,10 +556,10 @@ Phaser.Keyboard.prototype = {
|
||||
*/
|
||||
createCursorKeys: function () {
|
||||
|
||||
return {
|
||||
up: this.addKey(Phaser.Keyboard.UP),
|
||||
down: this.addKey(Phaser.Keyboard.DOWN),
|
||||
left: this.addKey(Phaser.Keyboard.LEFT),
|
||||
return {
|
||||
up: this.addKey(Phaser.Keyboard.UP),
|
||||
down: this.addKey(Phaser.Keyboard.DOWN),
|
||||
left: this.addKey(Phaser.Keyboard.LEFT),
|
||||
right: this.addKey(Phaser.Keyboard.RIGHT)
|
||||
}
|
||||
|
||||
@@ -544,8 +583,8 @@ Phaser.Keyboard.prototype = {
|
||||
return _this.processKeyUp(event);
|
||||
};
|
||||
|
||||
document.body.addEventListener('keydown', this._onKeyDown, false);
|
||||
document.body.addEventListener('keyup', this._onKeyUp, false);
|
||||
window.addEventListener('keydown', this._onKeyDown, false);
|
||||
window.addEventListener('keyup', this._onKeyUp, false);
|
||||
|
||||
},
|
||||
|
||||
@@ -556,12 +595,12 @@ Phaser.Keyboard.prototype = {
|
||||
*/
|
||||
stop: function () {
|
||||
|
||||
document.body.removeEventListener('keydown', this._onKeyDown);
|
||||
document.body.removeEventListener('keyup', this._onKeyUp);
|
||||
window.removeEventListener('keydown', this._onKeyDown);
|
||||
window.removeEventListener('keyup', this._onKeyUp);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* By default when a key is pressed Phaser will not stop the event from propagating up to the browser.
|
||||
* 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.
|
||||
@@ -584,9 +623,9 @@ Phaser.Keyboard.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes an existing key capture.
|
||||
* @method Phaser.Keyboard#removeKeyCapture
|
||||
/**
|
||||
* Removes an existing key capture.
|
||||
* @method Phaser.Keyboard#removeKeyCapture
|
||||
* @param {number} keycode
|
||||
*/
|
||||
removeKeyCapture: function (keycode) {
|
||||
@@ -595,9 +634,9 @@ Phaser.Keyboard.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Clear all set key captures.
|
||||
* @method Phaser.Keyboard#clearCaptures
|
||||
/**
|
||||
* Clear all set key captures.
|
||||
* @method Phaser.Keyboard#clearCaptures
|
||||
*/
|
||||
clearCaptures: function () {
|
||||
|
||||
@@ -605,12 +644,12 @@ Phaser.Keyboard.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Process the keydown event.
|
||||
* @method Phaser.Keyboard#processKeyDown
|
||||
/**
|
||||
* Process the keydown event.
|
||||
* @method Phaser.Keyboard#processKeyDown
|
||||
* @param {KeyboardEvent} event
|
||||
* @protected
|
||||
*/
|
||||
*/
|
||||
processKeyDown: function (event) {
|
||||
|
||||
if (this.game.input.disabled || this.disabled)
|
||||
@@ -661,9 +700,9 @@ Phaser.Keyboard.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Process the keyup event.
|
||||
* @method Phaser.Keyboard#processKeyUp
|
||||
/**
|
||||
* Process the keyup event.
|
||||
* @method Phaser.Keyboard#processKeyUp
|
||||
* @param {KeyboardEvent} event
|
||||
* @protected
|
||||
*/
|
||||
@@ -707,9 +746,9 @@ Phaser.Keyboard.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Reset the "isDown" state of all keys.
|
||||
* @method Phaser.Keyboard#reset
|
||||
/**
|
||||
* Reset the "isDown" state of all keys.
|
||||
* @method Phaser.Keyboard#reset
|
||||
*/
|
||||
reset: function () {
|
||||
|
||||
@@ -773,7 +812,7 @@ Phaser.Keyboard.prototype = {
|
||||
return this._keys[keycode].isDown;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@@ -898,7 +937,7 @@ Phaser.Keyboard.NUM_LOCK = 144;
|
||||
|
||||
<span class="jsdoc-message">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
|
||||
on Thu Nov 07 2013 06:07:33 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
on Thu Nov 28 2013 15:56:25 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
|
||||
</span>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user