Class: InputManagerMouseEvent

Grape2D. InputManagerMouseEvent

new InputManagerMouseEvent(rawEvent)

Mouse event.
Parameters:
Name Type Description
rawEvent Event Raw DOM event.
Source:

Extends

Members

<private> button :number

Button that was pressed to trigger the event.
  1. Left button.
  2. Mouse wheel.
  3. Right button.
Type:
  • number
Source:

<private> position :Grape2D.Vector

Position relative to the renderer, where the event was triggered.
Type:
Source:

<private> raw :Event

Raw event.
Type:
  • Event
Inherited From:
Source:

<private> target :EventTarget

Place where the drag event happened. It should be a DOM element associated with a {Grape2D.Renderer}.
Type:
  • EventTarget
Source:

<private> wheelDelta :number

Mouse wheel value. This value is only used when the rawEvent.type == "mousewheel". If the value is positive the wheel was moved upwards, if it's negative the wheel was moved downwards.
Type:
  • number
Source:

Methods

getPosition() → {Grape2D.Vector}

Gets the position where the event was triggered.
Source:
Returns:
Position.
Type
Grape2D.Vector

getRaw() → {Event}

Gets the raw event.
Inherited From:
Source:
Returns:
The event fired.
Type
Event

getTarget() → {EventTarget}

Gets the element where the event happened.
Source:
Returns:
Element.
Type
EventTarget

getWheelDelta() → {number}

Gets the wheel data.
Source:
Returns:
Wheel data.
Type
number