Keyboard#addKeys()

addKeys(keys) → {object}

A practical way to create an object containing user selected hotkeys.

For example,

addKeys( { 'up': Phaser.KeyCode.W, 'down': Phaser.KeyCode.S, 'left': Phaser.KeyCode.A, 'right': Phaser.KeyCode.D } );

would return an object containing properties (up, down, left and right) referring to Phaser.Key object.

Parameters
Name Type Description
keys object

A key mapping object, i.e. { 'up': Phaser.KeyCode.W, 'down': Phaser.KeyCode.S } or { 'up': 52, 'down': 53 }.

Returns
object -

An object containing the properties mapped to Phaser.Key values.

Source code: input/Keyboard.js (Line 165)
doc_phaser
2017-02-14 10:53:47
Comments
Leave a Comment

Please login to continue.