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

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()

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


Vector2 position = Vector2(0, 0) 🔗

The touch position in the viewport the node is in, using the coordinate system of this viewport.


bool pressed = false 🔗

  • void set_pressed(value: bool)

  • bool is_pressed()

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