var Class = require('../../utils/Class'); var EventEmitter = require('eventemitter3'); var SceneInputManager = new Class({ Extends: EventEmitter, initialize: function SceneInputManager(scene){ EventEmitter.call(this); this.scene = scene; this.manager = scene.sys.game.input; this.displayList; this.cameras; this.keyboard = this.manager.keyboard; this.mouse = this.manager.mouse; this.gamepad = this.manager.gamepad; this.topOnly = true ; this.pollRate = -1; this._pollTimer = 0; this.dragDistanceThreshold = 0; this.dragTimeThreshold = 0; this._temp = [] ; this._list = [] ; this._pendingInsertion = [] ; this._pendingRemoval = [] ; this._draggable = [] ; this._drag = { 0: [] , 1: [] , 2: [] , 3: [] , 4: [] , 5: [] , 6: [] , 7: [] , 8: [] , 9: [] } ; this._over = { 0: [] , 1: [] , 2: [] , 3: [] , 4: [] , 5: [] , 6: [] , 7: [] , 8: [] , 9: [] } ; this._validTypes = ['onDown', 'onUp', 'onOver', 'onOut', 'onMove', 'onDragStart', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragLeave', 'onDragOver', 'onDrop'] ; } , boot: require('./inc/Boot'), begin: require('./inc/Begin'), clear: require('./inc/Clear'), update: require('./inc/Update'), hitTestPointer: require('./inc/HitTestPointer'), disable: require('./inc/Disable'), enable: require('./inc/Enable'), queueForInsertion: require('./inc/QueueForInsertion'), queueForRemoval: require('./inc/QueueForRemoval'), setPollRate: require('./inc/SetPollRate'), setPollAlways: require('./inc/SetPollAlways'), setPollOnMove: require('./inc/SetPollOnMove'), setTopOnly: require('./inc/SetTopOnly'), setHitArea: require('./inc/SetHitArea'), setHitAreaCircle: require('./inc/SetHitAreaCircle'), setHitAreaEllipse: require('./inc/SetHitAreaEllipse'), setHitAreaFromTexture: require('./inc/SetHitAreaFromTexture'), setHitAreaRectangle: require('./inc/SetHitAreaRectangle'), setHitAreaTriangle: require('./inc/SetHitAreaTriangle'), setDraggable: require('./inc/SetDraggable'), processOverOutEvents: require('./inc/ProcessOverOutEvents'), processDownEvents: require('./inc/ProcessDownEvents'), processDragEvents: require('./inc/ProcessDragEvents'), processUpEvents: require('./inc/ProcessUpEvents'), processMoveEvents: require('./inc/ProcessMoveEvents'), sortGameObjects: require('./inc/SortGameObjects'), sortInteractiveObjects: require('./inc/SortInteractiveObjects'), sortHandlerGO: require('./inc/SortHandlerGO'), sortHandlerIO: require('./inc/SortHandlerIO'), activePointer: { get: function (){ return this.manager.activePointer; } } , x: { get: function (){ return this.manager.activePointer.x; } } , y: { get: function (){ return this.manager.activePointer.y; } } , shutdown: function (){ this._temp.length = 0; this._list.length = 0; this._draggable.length = 0; this._pendingRemoval.length = 0; this._pendingInsertion.length = 0; for (var i = 0; i < 10; i++ ){ this._drag[i] = [] ; this._over[i] = [] ; } this.removeAllListeners(); } , destroy: function (){ this.shutdown(); this.scene = undefined; this.cameras = undefined; this.manager = undefined; this.events = undefined; this.keyboard = undefined; this.mouse = undefined; this.gamepad = undefined; } } ); module.exports = SceneInputManager;