Trigger API Reference DCEI Functions Input0 - BLKTower/TestWiki GitHub Wiki
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()))