Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

InputEventScreenTouch

繼承: InputEventFromWindow < InputEvent < Resource < RefCounted < Object

代表螢幕觸摸事件。

說明

儲存多點觸摸的按壓/釋放資訊。支援觸摸按壓、觸摸釋放以及用於多點觸摸計數和定序的 index。

教學

屬性

bool

canceled

false

bool

double_tap

false

int

index

0

bool

long_press

false

Vector2

position

Vector2(0, 0)

bool

pressed

false


屬性說明

bool canceled = false 🔗

  • void set_canceled(value: bool)

  • bool is_canceled()

如果為 true,則觸摸事件被取消。


bool double_tap = false 🔗

  • void set_double_tap(value: bool)

  • bool is_double_tap()

如果為 true,則觸摸狀態為雙擊。


int index = 0 🔗

  • void set_index(value: int)

  • int get_index()

在多點觸摸事件中的觸摸指數。一個索引 = 一個手指。


bool long_press = false 🔗

  • void set_long_press(value: bool)

  • bool is_long_press()

If true, the touch's state is a long press.

Note: This is only supported on Android and iOS.


Vector2 position = Vector2(0, 0) 🔗

節點所在視埠中的觸摸位置,使用該視埠的座標系。


bool pressed = false 🔗

  • void set_pressed(value: bool)

  • bool is_pressed()

如果為 true,觸摸的狀態為按下。如果為 false,觸摸的狀態被釋放。