2017-02-21 01:04:11 +00:00
|
|
|
// GlobalInputManager
|
|
|
|
|
|
|
|
var Keyboard = require('./keyboard/KeyboardManager');
|
2017-06-12 23:38:48 +00:00
|
|
|
var Mouse = require('./mouse/MouseManager');
|
2017-02-21 01:04:11 +00:00
|
|
|
|
|
|
|
var GlobalInputManager = function (game, gameConfig)
|
|
|
|
{
|
|
|
|
this.game = game;
|
|
|
|
|
|
|
|
this.gameConfig = gameConfig;
|
|
|
|
|
|
|
|
this.keyboard = new Keyboard(this);
|
2017-06-12 16:03:34 +00:00
|
|
|
this.mouse = new Mouse(this);
|
2017-02-21 01:04:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GlobalInputManager.prototype.constructor = GlobalInputManager;
|
|
|
|
|
|
|
|
GlobalInputManager.prototype = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Boot handler is called by Phaser.Game when it first starts up.
|
|
|
|
* The renderer is available by now.
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.KeyboardManager#boot
|
|
|
|
* @private
|
|
|
|
*/
|
|
|
|
boot: function ()
|
|
|
|
{
|
|
|
|
this.keyboard.boot();
|
2017-06-12 16:03:34 +00:00
|
|
|
this.mouse.boot();
|
2017-02-21 01:04:11 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
update: function ()
|
|
|
|
{
|
|
|
|
this.keyboard.update();
|
2017-06-12 16:03:34 +00:00
|
|
|
this.mouse.update();
|
2017-02-21 01:04:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = GlobalInputManager;
|