Mouse class Input
Manages mouse and touch input.
Constructors
- Mouse(HTMLCanvasElement _canvas)
-
Creates a Mouse instance and attaches event listeners to the provided
_canvas
. Typically, you don't instantiate this class yourself. Instead, you use theapp.mouse
member provided by the App class.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- mouseWheel ↔ int
-
The accumulated mouse wheel movement since the last frame.
getter/setter pair
- onFirstClick ↔ void Function()?
-
Function that can be used when user interacts with canvas for the first time
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleX ↔ double
-
The horizontal scaling factor applied to mouse coordinates.
getter/setter pair
- scaleY ↔ double
-
The vertical scaling factor applied to mouse coordinates.
getter/setter pair
- x ↔ double
-
The current X-coordinate of the mouse cursor, relative to the canvas.
getter/setter pair
- y ↔ double
-
The current Y-coordinate of the mouse cursor, relative to the canvas.
getter/setter pair
Methods
-
dispose(
) → dynamic - Removes all event listeners previously attached by this Mouse instance.
-
mouseDown(
MouseButton button) → bool -
Checks if the specified mouse
button
is currently held down. -
mouseHit(
MouseButton button) → bool -
Checks if the specified mouse
button
was pressed in the current frame. -
mouseUp(
MouseButton button) → bool -
Checks if the specified mouse
button
was released in the current frame. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
touchDown(
int index) → bool - Checks if the finger with the specified index us currently touching the touchscreen.
-
touchHit(
int index) → int - Returns the number of times the specified finger has made contact with the touchscreen since the last OnUpdate
-
touchUp(
int index) → bool - Returns true if the finger has left the touch screen device.
-
touchX(
int index) → double - Returns the x coordinate of the finger on a touch screen device.
-
touchY(
int index) → double - Returns the y coordinate of the finger on a touch screen device.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited