Trigger API Reference DCEI Functions Input0 - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Trigger API Reference\DCEI Functions\Input](#trigger-api-referencedcei-functionsinput)
* [Float2 GetMousePosition2D()](#float2-getmouseposition2d)
* [Float2 GetTouchPosition2D()](#float2-gettouchposition2d)
* [Float2 GetSwipeScreenPosition()](#float2-getswipescreenposition)
* [void HideJoystick(int joystickId)](#void-hidejoystickint-joystickid)
* [void ShowJoystick(int joystickId)](#void-showjoystickint-joystickid)
* [void HideJoystickButton(int joystickButtonId)](#void-hidejoystickbuttonint-joystickbuttonid)
* [void ShowJoystickButton(int joystickButtonId)](#void-showjoystickbuttonint-joystickbuttonid)
* [bool HasUserInput()](#bool-hasuserinput)
|
Trigger API Reference\DCEI Functions\Input {Trigger-API-ReferenceDCEI-FunctionsInput}
Float2 GetMousePosition2D()
Returns the map coordinates of the mouse.
local mouse_pos = DCEI.GetMousePosition2D()
DCEI.LogMessage("x: " .. mouse_pos.x .. " y: " .. mouse_pos.y)
Float2 GetTouchPosition2D()
Returns the map coordinates of the last touch input. Only works on mobile.
local touch_pos = DCEI.GetTouchPosition2D()
DCEI.LogMessage("x: " .. touch_pos.x .. " y: " .. touch_pos.y)
Float2 GetSwipeScreenPosition()
Return the swipe position based on screen coordinates in pixels.
local swipe_pos = DCEI.GetSwipeScreenPosition()
DCEI.LogMessage("x: " .. swipe_pos.x .. " y: " .. swipe_pos.y)
void HideJoystick(int joystickId)
DCEI.HideJoystick(0)
void ShowJoystick(int joystickId)
-
int
joystickId
the ID of the joystick to show. Use TriggerAddJoystickEvent() or TriggerAddJoystickEventWithJoystickOptions() to create a joystick.
DCEI.ShowJoystick(0)
- TriggerAddJoystickEvent()
- TriggerAddJoystickEventWithJoystickOptions()
- TriggerAddJoystickTapEvent()
- TriggerAddJoystickSwipeEvent()
- TriggerAddJoystickReleaseEvent()
- TriggerAddJoystickReleaseEventWithId()
void HideJoystickButton(int joystickButtonId)
Hides the given joystick button.
DCEI.HideJoystickButton(1)
void ShowJoystickButton(int joystickButtonId)
Shows the given joystick button. Use TriggerAddJoystickButtonEvent() to create the joystick button.
DCEI.ShowJoystickButton(1)
bool HasUserInput()
Returns true if the current frame has user input.
DCEI.LogMessage(tostring(DCEI.HasUserInput()))