Familiar territory. TouchInput keeps the RPG Maker MZ API, so existing MZ knowledge, tutorials and plugin code apply. Reactor's additions are marked with descriptions below.
The static class that handles input data from the mouse and touchscreen.
function TouchInput()
Quick Reference
Setup & Creation 3
| initialize() | Initializes the touch system. |
| _createNewState() | Creates the new state. |
| _setupEventHandlers() | Setup event handlers. |
Checks (True / False) 13
| isClicked() | Checks whether the mouse button or touchscreen has been pressed and released at the same position. |
| isPressed() | Checks whether the mouse button or touchscreen is currently pressed down. |
| isTriggered() | Checks whether the left mouse button or touchscreen is just pressed. |
| isRepeated() | Checks whether the left mouse button or touchscreen is just pressed or a pseudo key repeat occurred. |
| isLongPressed() | Checks whether the left mouse button or touchscreen is kept depressed. |
| isMouseButtonPressed() | Checks the independent state of a mouse button. |
| isMouseButtonTriggered() | Whether it is mouse button triggered. |
| isMouseButtonReleased() | Whether it is mouse button released. |
| isMouseButtonLongPressed() | Whether it is mouse button long pressed. |
| isCancelled() | Checks whether the right mouse button is just pressed. |
| isMoved() | Checks whether the mouse or a finger on the touchscreen is moved. |
| isHovered() | Checks whether the mouse is moved without pressing a button. |
| isReleased() | Checks whether the left mouse button or touchscreen is released. |
Actions 1
| clear() | Clears all the touch data. |
Events, Commands & Input 19
| _onMouseDown() | Called when mouse down happens. |
| _onLeftButtonDown() | Called when left button down happens. |
| _onMiddleButtonDown() | Called when middle button down happens. |
| _onRightButtonDown() | Called when right button down happens. |
| _onMouseMove() | Called when mouse move happens. |
| _onMouseUp() | Called when mouse up happens. |
| _onMouseButtonTrigger() | Called when mouse button trigger happens. |
| _onMouseButtonRelease() | Called when mouse button release happens. |
| _onWheel() | Called when wheel happens. |
| _onTouchStart() | Called when touch start happens. |
| _onTouchMove() | Called when touch move happens. |
| _onTouchEnd() | Called when touch end happens. |
| _onTouchCancel() | Called when touch cancel happens. |
| _onLostFocus() | Called when lost focus happens. |
| _onTrigger() | Called when trigger happens. |
| _onCancel() | Called when cancel happens. |
| _onMove() | Called when move happens. |
| _onHover() | Called when hover happens. |
| _onRelease() | Called when release happens. |
Updating & Drawing 1
| update() | Updates the touch data. |
Setup & Creation
initialize
static sourceTouchInput.initialize()
Initializes the touch system.
_createNewState
static internal sourceTouchInput._createNewState()
Creates the new state. (Same as the RPG Maker MZ method of this name.)
_setupEventHandlers
static internal sourceTouchInput._setupEventHandlers()
Setup event handlers. (Same as the RPG Maker MZ method of this name.)
Checks (True / False)
isClicked
static sourceTouchInput.isClicked()
Checks whether the mouse button or touchscreen has been pressed and released at the same position.
Details
Checks whether the mouse button or touchscreen has been pressed and released at the same position.
isPressed
static sourceTouchInput.isPressed()
Checks whether the mouse button or touchscreen is currently pressed down.
Details
Checks whether the mouse button or touchscreen is currently pressed down.
isTriggered
static sourceTouchInput.isTriggered()
Checks whether the left mouse button or touchscreen is just pressed.
Details
Checks whether the left mouse button or touchscreen is just pressed.
isRepeated
static sourceTouchInput.isRepeated()
Checks whether the left mouse button or touchscreen is just pressed or a pseudo key repeat occurred.
Details
Checks whether the left mouse button or touchscreen is just pressed or a pseudo key repeat occurred.
isLongPressed
static sourceTouchInput.isLongPressed()
Checks whether the left mouse button or touchscreen is kept depressed.
Details
Checks whether the left mouse button or touchscreen is kept depressed.
isMouseButtonPressed
static sourceTouchInput.isMouseButtonPressed(button)
Checks the independent state of a mouse button.
Details
Checks the independent state of a mouse button.
isMouseButtonTriggered
static sourceTouchInput.isMouseButtonTriggered(button)
Whether it is mouse button triggered. (Same as the RPG Maker MZ method of this name.)
isMouseButtonReleased
static sourceTouchInput.isMouseButtonReleased(button)
Whether it is mouse button released. (Same as the RPG Maker MZ method of this name.)
isMouseButtonLongPressed
static sourceTouchInput.isMouseButtonLongPressed(button)
Whether it is mouse button long pressed. (Same as the RPG Maker MZ method of this name.)
isCancelled
static sourceTouchInput.isCancelled()
Checks whether the right mouse button is just pressed.
Details
Checks whether the right mouse button is just pressed.
isMoved
static sourceTouchInput.isMoved()
Checks whether the mouse or a finger on the touchscreen is moved.
Details
Checks whether the mouse or a finger on the touchscreen is moved.
isHovered
static sourceTouchInput.isHovered()
Checks whether the mouse is moved without pressing a button.
Details
Checks whether the mouse is moved without pressing a button.
isReleased
static sourceTouchInput.isReleased()
Checks whether the left mouse button or touchscreen is released.
Details
Checks whether the left mouse button or touchscreen is released.
Actions
clear
static sourceTouchInput.clear()
Clears all the touch data.
Events, Commands & Input
_onMouseDown
static internal sourceTouchInput._onMouseDown(event)
Called when mouse down happens. (Same as the RPG Maker MZ method of this name.)
_onLeftButtonDown
static internal sourceTouchInput._onLeftButtonDown(event)
Called when left button down happens. (Same as the RPG Maker MZ method of this name.)
_onMiddleButtonDown
static internal sourceTouchInput._onMiddleButtonDown(event)
Called when middle button down happens. (Same as the RPG Maker MZ method of this name.)
_onRightButtonDown
static internal sourceTouchInput._onRightButtonDown(event)
Called when right button down happens. (Same as the RPG Maker MZ method of this name.)
_onMouseMove
static internal sourceTouchInput._onMouseMove(event)
Called when mouse move happens. (Same as the RPG Maker MZ method of this name.)
_onMouseUp
static internal sourceTouchInput._onMouseUp(event)
Called when mouse up happens. (Same as the RPG Maker MZ method of this name.)
_onMouseButtonTrigger
static internal sourceTouchInput._onMouseButtonTrigger(button)
Called when mouse button trigger happens. (Same as the RPG Maker MZ method of this name.)
_onMouseButtonRelease
static internal sourceTouchInput._onMouseButtonRelease(button)
Called when mouse button release happens. (Same as the RPG Maker MZ method of this name.)
_onWheel
static internal sourceTouchInput._onWheel(event)
Called when wheel happens. (Same as the RPG Maker MZ method of this name.)
_onTouchStart
static internal sourceTouchInput._onTouchStart(event)
Called when touch start happens. (Same as the RPG Maker MZ method of this name.)
_onTouchMove
static internal sourceTouchInput._onTouchMove(event)
Called when touch move happens. (Same as the RPG Maker MZ method of this name.)
_onTouchEnd
static internal sourceTouchInput._onTouchEnd(event)
Called when touch end happens. (Same as the RPG Maker MZ method of this name.)
_onTouchCancel
static internal sourceTouchInput._onTouchCancel(/*event*/)
Called when touch cancel happens. (Same as the RPG Maker MZ method of this name.)
_onLostFocus
static internal sourceTouchInput._onLostFocus()
Called when lost focus happens. (Same as the RPG Maker MZ method of this name.)
_onTrigger
static internal sourceTouchInput._onTrigger(x, y)
Called when trigger happens. (Same as the RPG Maker MZ method of this name.)
_onCancel
static internal sourceTouchInput._onCancel(x, y)
Called when cancel happens. (Same as the RPG Maker MZ method of this name.)
_onMove
static internal sourceTouchInput._onMove(x, y)
Called when move happens. (Same as the RPG Maker MZ method of this name.)
_onHover
static internal sourceTouchInput._onHover(x, y)
Called when hover happens. (Same as the RPG Maker MZ method of this name.)
_onRelease
static internal sourceTouchInput._onRelease(x, y)
Called when release happens. (Same as the RPG Maker MZ method of this name.)
Updating & Drawing
update
static sourceTouchInput.update()
Updates the touch data.