2018-01-16 16:00:37 +00:00
|
|
|
var Class = require('../utils/Class');
|
2018-01-12 17:09:09 +00:00
|
|
|
var EventEmitter = require('eventemitter3');
|
2018-01-16 16:00:37 +00:00
|
|
|
var Gamepad = require('./gamepad/GamepadManager');
|
|
|
|
var Keyboard = require('./keyboard/KeyboardManager');
|
|
|
|
var Mouse = require('./mouse/MouseManager');
|
|
|
|
var Pointer = require('./Pointer');
|
2018-01-22 12:04:14 +00:00
|
|
|
var Rectangle = require('../geom/rectangle/Rectangle');
|
2018-01-16 16:00:37 +00:00
|
|
|
var Touch = require('./touch/TouchManager');
|
|
|
|
var TransformXY = require('../math/TransformXY');
|
2017-02-21 01:04:11 +00:00
|
|
|
|
2018-01-22 12:04:14 +00:00
|
|
|
// Phaser.Input.InputManager
|
|
|
|
|
2018-01-16 16:14:21 +00:00
|
|
|
var InputManager = new Class({
|
2017-02-21 01:04:11 +00:00
|
|
|
|
2017-06-30 14:47:51 +00:00
|
|
|
initialize:
|
2017-02-21 01:04:11 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @class InputManager
|
|
|
|
* @memberOf Phaser.Input
|
|
|
|
* @constructor
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {Phaser.Game} game - [description]
|
|
|
|
* @param {object} config - [description]
|
|
|
|
*/
|
2018-01-16 16:14:21 +00:00
|
|
|
function InputManager (game, config)
|
2017-06-30 14:47:51 +00:00
|
|
|
{
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {[type]} game
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-06-30 14:47:51 +00:00
|
|
|
this.game = game;
|
2017-06-14 00:20:01 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {HTMLCanvasElement} canvas
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-07-17 22:38:43 +00:00
|
|
|
this.canvas;
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {object} config
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-06-30 14:47:51 +00:00
|
|
|
this.config = config;
|
2017-06-14 00:20:01 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {boolean} enabled
|
|
|
|
* @default true
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-06-30 14:47:51 +00:00
|
|
|
this.enabled = true;
|
2017-06-14 00:20:01 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {[type]} events
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-12 17:09:09 +00:00
|
|
|
this.events = new EventEmitter();
|
2017-06-14 01:20:55 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* Standard FIFO queue.
|
|
|
|
*
|
|
|
|
* @property {array} queue
|
|
|
|
* @default []
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-06-30 14:47:51 +00:00
|
|
|
this.queue = [];
|
2017-02-21 01:04:11 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {Phaser.Input.Keyboard.KeyboardManager} keyboard
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-06-30 14:47:51 +00:00
|
|
|
this.keyboard = new Keyboard(this);
|
2018-01-26 06:55:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {Phaser.Input.Mouse.MouseManager} mouse
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-06-30 14:47:51 +00:00
|
|
|
this.mouse = new Mouse(this);
|
2018-01-26 06:55:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {Phaser.Input.Touch.TouchManager} touch
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-07-28 02:28:10 +00:00
|
|
|
this.touch = new Touch(this);
|
2018-01-26 06:55:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {Phaser.Input.Gamepad.GamepadManager} gamepad
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-09-09 02:17:13 +00:00
|
|
|
this.gamepad = new Gamepad(this);
|
2017-02-21 01:04:11 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {[type]} activePointer
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-07-21 02:39:55 +00:00
|
|
|
this.activePointer = new Pointer(this, 0);
|
2017-07-13 16:21:37 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {object} scale
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-07-17 22:38:43 +00:00
|
|
|
this.scale = { x: 1, y: 1 };
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* If the top-most Scene in the Scene List receives an input it will stop input from
|
|
|
|
* propagating any lower down the scene list, i.e. if you have a UI Scene at the top
|
|
|
|
* and click something on it, that click will not then be passed down to any other
|
|
|
|
* Scene below. Disable this to have input events passed through all Scenes, all the time.
|
|
|
|
*
|
|
|
|
* @property {boolean} globalTopOnly
|
|
|
|
* @default true
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-20 04:44:54 +00:00
|
|
|
this.globalTopOnly = true;
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {boolean} ignoreEvents
|
|
|
|
* @default false
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-20 04:44:54 +00:00
|
|
|
this.ignoreEvents = false;
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {Phaser.Geom.Rectangle} bounds
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2018-01-22 12:04:14 +00:00
|
|
|
this.bounds = new Rectangle();
|
2017-12-13 22:08:15 +00:00
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {object} _tempPoint
|
|
|
|
* @private
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-06-30 14:47:51 +00:00
|
|
|
this._tempPoint = { x: 0, y: 0 };
|
2018-01-26 06:55:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @property {array} _tempHitTest
|
|
|
|
* @private
|
|
|
|
* @default []
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-07-07 19:59:17 +00:00
|
|
|
this._tempHitTest = [];
|
2018-01-18 05:16:52 +00:00
|
|
|
|
|
|
|
game.events.once('boot', this.boot, this);
|
2017-06-30 14:47:51 +00:00
|
|
|
},
|
2017-02-21 01:04:11 +00:00
|
|
|
|
|
|
|
/**
|
2018-01-26 06:55:15 +00:00
|
|
|
* The Boot handler is called by Phaser.Game when it first starts up.
|
|
|
|
* The renderer is available by now.
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#boot
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-02-21 01:04:11 +00:00
|
|
|
boot: function ()
|
|
|
|
{
|
2017-07-17 22:38:43 +00:00
|
|
|
this.canvas = this.game.canvas;
|
|
|
|
|
2017-12-13 22:08:15 +00:00
|
|
|
this.updateBounds();
|
|
|
|
|
2017-02-21 01:04:11 +00:00
|
|
|
this.keyboard.boot();
|
2017-06-12 16:03:34 +00:00
|
|
|
this.mouse.boot();
|
2017-07-28 02:28:10 +00:00
|
|
|
this.touch.boot();
|
2017-09-09 02:17:13 +00:00
|
|
|
this.gamepad.boot();
|
2017-02-21 01:04:11 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#updateBounds
|
|
|
|
* @since 3.0.0
|
|
|
|
*/
|
2017-12-13 22:08:15 +00:00
|
|
|
updateBounds: function ()
|
|
|
|
{
|
2018-01-22 12:04:14 +00:00
|
|
|
var clientRect = this.canvas.getBoundingClientRect();
|
|
|
|
var bounds = this.bounds;
|
2017-12-13 22:08:15 +00:00
|
|
|
|
2018-01-22 12:04:14 +00:00
|
|
|
bounds.left = clientRect.left + window.pageXOffset;
|
|
|
|
bounds.top = clientRect.top + window.pageYOffset;
|
|
|
|
bounds.width = clientRect.width;
|
|
|
|
bounds.height = clientRect.height;
|
2017-12-13 22:08:15 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#update
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {[type]} time - [description]
|
|
|
|
*/
|
2018-01-22 12:04:14 +00:00
|
|
|
update: function (time)
|
2017-02-21 01:04:11 +00:00
|
|
|
{
|
|
|
|
this.keyboard.update();
|
2017-09-09 02:17:13 +00:00
|
|
|
this.gamepad.update();
|
2017-06-14 00:20:01 +00:00
|
|
|
|
2018-01-20 04:44:54 +00:00
|
|
|
this.ignoreEvents = false;
|
|
|
|
|
2017-06-14 00:20:01 +00:00
|
|
|
var len = this.queue.length;
|
|
|
|
|
2017-07-14 00:38:21 +00:00
|
|
|
// Currently just 1 pointer supported
|
2017-07-13 23:37:54 +00:00
|
|
|
var pointer = this.activePointer;
|
|
|
|
|
2017-07-14 00:38:21 +00:00
|
|
|
pointer.reset();
|
2017-07-13 23:37:54 +00:00
|
|
|
|
2017-06-14 00:20:01 +00:00
|
|
|
if (!this.enabled || len === 0)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-12-13 22:08:15 +00:00
|
|
|
this.updateBounds();
|
|
|
|
|
|
|
|
this.scale.x = this.game.config.width / this.bounds.width;
|
|
|
|
this.scale.y = this.game.config.height / this.bounds.height;
|
2017-07-17 22:38:43 +00:00
|
|
|
|
2017-06-14 00:20:01 +00:00
|
|
|
// Clears the queue array, and also means we don't work on array data that could potentially
|
|
|
|
// be modified during the processing phase
|
|
|
|
var queue = this.queue.splice(0, len);
|
|
|
|
|
|
|
|
// Process the event queue, dispatching all of the events that have stored up
|
|
|
|
for (var i = 0; i < len; i++)
|
|
|
|
{
|
|
|
|
var event = queue[i];
|
|
|
|
|
2017-07-24 22:47:55 +00:00
|
|
|
// TODO: Move to CONSTs so we can do integer comparisons instead of strings.
|
2017-06-14 00:20:01 +00:00
|
|
|
switch (event.type)
|
|
|
|
{
|
|
|
|
case 'mousemove':
|
2017-07-13 16:21:37 +00:00
|
|
|
|
2017-07-27 02:40:58 +00:00
|
|
|
pointer.move(event, time);
|
2017-06-14 00:20:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'mousedown':
|
2017-07-13 16:21:37 +00:00
|
|
|
|
2017-07-27 02:40:58 +00:00
|
|
|
pointer.down(event, time);
|
2017-06-14 00:20:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'mouseup':
|
2017-07-13 16:21:37 +00:00
|
|
|
|
2017-07-27 02:40:58 +00:00
|
|
|
pointer.up(event, time);
|
2017-12-08 23:05:05 +00:00
|
|
|
break;
|
|
|
|
|
2017-07-28 02:28:10 +00:00
|
|
|
case 'touchmove':
|
|
|
|
|
|
|
|
pointer.touchmove(event, time);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'touchstart':
|
|
|
|
|
|
|
|
pointer.touchstart(event, time);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'touchend':
|
|
|
|
|
|
|
|
pointer.touchend(event, time);
|
|
|
|
break;
|
2018-01-08 09:58:17 +00:00
|
|
|
|
|
|
|
case 'pointerlockchange':
|
|
|
|
|
2018-01-12 17:09:09 +00:00
|
|
|
this.events.emit('pointerlockchange', event, this.mouse.locked);
|
2018-01-08 09:58:17 +00:00
|
|
|
break;
|
2017-06-14 00:20:01 +00:00
|
|
|
}
|
|
|
|
}
|
2017-06-14 01:20:55 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* Will always return an array.
|
|
|
|
* Array contains matching Interactive Objects.
|
|
|
|
* Array will be empty if no objects were matched.
|
|
|
|
* x/y = pointer x/y (un-translated)
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#hitTest
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {[type]} x - [description]
|
|
|
|
* @param {[type]} y - [description]
|
|
|
|
* @param {[type]} gameObjects - [description]
|
|
|
|
* @param {[type]} camera - [description]
|
|
|
|
* @param {[type]} output - [description]
|
|
|
|
*
|
|
|
|
* @return {[type]} [description]
|
|
|
|
*/
|
2018-01-16 15:46:49 +00:00
|
|
|
hitTest: function (x, y, gameObjects, camera, output)
|
|
|
|
{
|
|
|
|
if (output === undefined) { output = this._tempHitTest; }
|
|
|
|
|
|
|
|
var tempPoint = this._tempPoint;
|
|
|
|
var cameraW = camera.width;
|
|
|
|
var cameraH = camera.height;
|
|
|
|
|
|
|
|
output.length = 0;
|
|
|
|
|
|
|
|
if (!(x >= camera.x && y >= camera.y && x <= camera.x + cameraW && y <= camera.y + cameraH))
|
|
|
|
{
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Stores the world point inside of tempPoint
|
|
|
|
camera.getWorldPoint(x, y, tempPoint);
|
|
|
|
|
|
|
|
var culledGameObjects = camera.cull(gameObjects);
|
|
|
|
|
|
|
|
var point = { x: 0, y: 0 };
|
|
|
|
|
|
|
|
for (var i = 0; i < culledGameObjects.length; i++)
|
|
|
|
{
|
|
|
|
var gameObject = culledGameObjects[i];
|
|
|
|
|
|
|
|
if (!gameObject.input || !gameObject.input.enabled || !gameObject.willRender())
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
var px = tempPoint.x + (camera.scrollX * gameObject.scrollFactorX) - camera.scrollX;
|
|
|
|
var py = tempPoint.y + (camera.scrollY * gameObject.scrollFactorY) - camera.scrollY;
|
|
|
|
|
|
|
|
TransformXY(px, py, gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX, gameObject.scaleY, point);
|
|
|
|
|
|
|
|
if (this.pointWithinHitArea(gameObject, point.x, point.y))
|
|
|
|
{
|
|
|
|
output.push(gameObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return output;
|
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* x/y MUST be translated before being passed to this function,
|
|
|
|
* unless the gameObject is guaranteed to not be rotated or scaled in any way.
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#pointWithinHitArea
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {[type]} gameObject - [description]
|
|
|
|
* @param {[type]} x - [description]
|
|
|
|
* @param {[type]} y - [description]
|
|
|
|
*
|
|
|
|
* @return {boolean} [description]
|
|
|
|
*/
|
2018-01-16 15:46:49 +00:00
|
|
|
pointWithinHitArea: function (gameObject, x, y)
|
2017-07-07 19:59:17 +00:00
|
|
|
{
|
2018-01-16 15:46:49 +00:00
|
|
|
var input = gameObject.input;
|
|
|
|
|
|
|
|
// Normalize the origin
|
|
|
|
x += gameObject.displayOriginX;
|
|
|
|
y += gameObject.displayOriginY;
|
|
|
|
|
|
|
|
if (input.hitAreaCallback(input.hitArea, x, y, gameObject))
|
|
|
|
{
|
|
|
|
input.localX = x;
|
|
|
|
input.localY = y;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* x/y MUST be translated before being passed to this function,
|
|
|
|
* unless the gameObject is guaranteed to not be rotated or scaled in any way.
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#pointWithinInteractiveObject
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {[type]} object - [description]
|
|
|
|
* @param {[type]} x - [description]
|
|
|
|
* @param {[type]} y - [description]
|
|
|
|
*
|
|
|
|
* @return {boolean} [description]
|
|
|
|
*/
|
2018-01-16 15:46:49 +00:00
|
|
|
pointWithinInteractiveObject: function (object, x, y)
|
|
|
|
{
|
|
|
|
if (!object.hitArea)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Normalize the origin
|
|
|
|
x += object.gameObject.displayOriginX;
|
|
|
|
y += object.gameObject.displayOriginY;
|
|
|
|
|
|
|
|
object.localX = x;
|
|
|
|
object.localY = y;
|
|
|
|
|
|
|
|
return object.hitAreaCallback(object.hitArea, x, y, object);
|
2017-07-17 22:38:43 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#transformX
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {[type]} pageX - [description]
|
|
|
|
*
|
|
|
|
* @return {number} [description]
|
|
|
|
*/
|
2017-07-17 22:38:43 +00:00
|
|
|
transformX: function (pageX)
|
|
|
|
{
|
2017-12-13 22:08:15 +00:00
|
|
|
return (pageX - this.bounds.left) * this.scale.x;
|
2017-07-17 22:38:43 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#transformY
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @param {[type]} pageY - [description]
|
|
|
|
*
|
|
|
|
* @return {number} [description]
|
|
|
|
*/
|
2017-07-17 22:38:43 +00:00
|
|
|
transformY: function (pageY)
|
|
|
|
{
|
2017-12-13 22:08:15 +00:00
|
|
|
return (pageY - this.bounds.top) * this.scale.y;
|
2017-07-17 22:38:43 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#getOffsetX
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @return {number} [description]
|
|
|
|
*/
|
2017-07-17 22:38:43 +00:00
|
|
|
getOffsetX: function ()
|
|
|
|
{
|
2017-12-13 22:08:15 +00:00
|
|
|
return this.bounds.left;
|
2017-07-17 22:38:43 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#getOffsetY
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @return {number} [description]
|
|
|
|
*/
|
2017-07-17 22:38:43 +00:00
|
|
|
getOffsetY: function ()
|
|
|
|
{
|
2017-12-13 22:08:15 +00:00
|
|
|
return this.bounds.top;
|
2017-07-17 22:38:43 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#getScaleX
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @return {number} [description]
|
|
|
|
*/
|
2017-07-17 22:38:43 +00:00
|
|
|
getScaleX: function ()
|
|
|
|
{
|
2017-12-13 22:08:15 +00:00
|
|
|
return this.game.config.width / this.bounds.width;
|
2017-07-17 22:38:43 +00:00
|
|
|
},
|
|
|
|
|
2018-01-26 06:55:15 +00:00
|
|
|
/**
|
|
|
|
* [description]
|
|
|
|
*
|
|
|
|
* @method Phaser.Input.InputManager#getScaleY
|
|
|
|
* @since 3.0.0
|
|
|
|
*
|
|
|
|
* @return {number} [description]
|
|
|
|
*/
|
2017-07-17 22:38:43 +00:00
|
|
|
getScaleY: function ()
|
|
|
|
{
|
2017-12-13 22:08:15 +00:00
|
|
|
return this.game.config.height / this.bounds.height;
|
2017-02-21 01:04:11 +00:00
|
|
|
}
|
|
|
|
|
2017-06-30 14:47:51 +00:00
|
|
|
});
|
2017-02-21 01:04:11 +00:00
|
|
|
|
2018-01-16 16:14:21 +00:00
|
|
|
module.exports = InputManager;
|