dacha
    Preparing search index...

    Class MouseControl

    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 control
    const 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 actor
    actor.setComponent(mouseControl);

    Hierarchy (View Summary)

    Index
    actor?: Actor
    inputEventBindings: InputEventBindings

    Input event bindings

    componentName: string