MouseControl component for handling mouse input events.
Handles the mouse input events for an actor. It can be used to bind mouse events to game actions.
// Create a mouse controlconst mouseControl = new MouseControl({ inputEventBindings: [ { event: 'mousedown', button: 0, eventType: 'ATTACK', attrs: [ { name: 'type', type: 'string', value: 'lightAttack', }, ], }, { event: 'mousedown', button: 2, eventType: 'ATTACK', attrs: [ { name: 'type', type: 'string', value: 'heavyAttack', }, ], }, ],});// Add to actoractor.setComponent(mouseControl); Copy
// Create a mouse controlconst mouseControl = new MouseControl({ inputEventBindings: [ { event: 'mousedown', button: 0, eventType: 'ATTACK', attrs: [ { name: 'type', type: 'string', value: 'lightAttack', }, ], }, { event: 'mousedown', button: 2, eventType: 'ATTACK', attrs: [ { name: 'type', type: 'string', value: 'heavyAttack', }, ], }, ],});// Add to actoractor.setComponent(mouseControl);
Creates a new MouseControl component.
Configuration for the mouse control
Optional
Input event bindings
Static
MouseControl component for handling mouse input events.
Handles the mouse input events for an actor. It can be used to bind mouse events to game actions.
Example