mirror of
https://github.com/wassname/phaser.git
synced 2026-07-21 12:40:56 +08:00
Testing some new Camera tricks.
This commit is contained in:
@@ -123,6 +123,23 @@ Phaser.Keyboard.prototype = {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates and returns an object containing 4 hotkeys for Up, Down, Left and Right.
|
||||
*
|
||||
* @method Phaser.Keyboard#createCursorKeys
|
||||
* @return {object} An object containing properties: up, down, left and right. Which can be polled like any other Phaser.Key object.
|
||||
*/
|
||||
createCursorKeys: function () {
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
||||
Reference in New Issue
Block a user