Trigger API Reference DCEI Functions Input0 - BLKTower/TestWiki GitHub Wiki

Table of Contents

Trigger API Reference\DCEI Functions\Input {Trigger-API-ReferenceDCEI-FunctionsInput}

Float2 GetMousePosition2D() {Float2-GetMousePosition2D}

Float2 GetMousePosition2D()

Description

Returns the map coordinates of the mouse.

Example Usage

local mouse_pos = DCEI.GetMousePosition2D()
DCEI.LogMessage("x: " .. mouse_pos.x .. " y: " .. mouse_pos.y)

Float2 GetTouchPosition2D() {Float2-GetTouchPosition2D}

Float2 GetTouchPosition2D()

Description

Returns the map coordinates of the last touch input. Only works on mobile.

Example Usage

local touch_pos = DCEI.GetTouchPosition2D()
DCEI.LogMessage("x: " .. touch_pos.x .. " y: " .. touch_pos.y)

Float2 GetSwipeScreenPosition() {Float2-GetSwipeScreenPosition}

Float2 GetSwipeScreenPosition()

Description

Return the swipe position based on screen coordinates in pixels.

Example Usage

local swipe_pos = DCEI.GetSwipeScreenPosition()
DCEI.LogMessage("x: " .. swipe_pos.x .. " y: " .. swipe_pos.y)

void HideJoystick(int joystickId) {void-HideJoystickint-joystickId}

void HideJoystick(int joystickId)

Description

Hides the given joystick.

Parameters

  • int joystickId the ID of the joystick to hide.

Example Usage

DCEI.HideJoystick(0)

void ShowJoystick(int joystickId) {void-ShowJoystickint-joystickId}

void ShowJoystick(int joystickId)

Description

Shows the given joystick.

Parameters

Example Usage

DCEI.ShowJoystick(0)

Related

void HideJoystickButton(int joystickButtonId) {void-HideJoystickButtonint-joystickButtonId}

void HideJoystickButton(int joystickButtonId)

Description

Hides the given joystick button.

Parameters

  • int joystickButtonId the ID of the joystick button to hide.

Example Usage

DCEI.HideJoystickButton(1)

void ShowJoystickButton(int joystickButtonId) {void-ShowJoystickButtonint-joystickButtonId}

void ShowJoystickButton(int joystickButtonId)

Description

Shows the given joystick button. Use TriggerAddJoystickButtonEvent() to create the joystick button.

Parameters

  • int joystickButtonId the ID of the joystick button to show.

Example Usage

DCEI.ShowJoystickButton(1)

Related

bool HasUserInput() {bool-HasUserInput}

bool HasUserInput()

Description

Returns true if the current frame has user input.

Example Usage

DCEI.LogMessage(tostring(DCEI.HasUserInput()))

⚠️ **GitHub.com Fallback** ⚠️