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.
Checking the stable version of the documentation...
InputEventMouse
繼承: InputEventWithModifiers < InputEventFromWindow < InputEvent < Resource < RefCounted < Object
被繼承: InputEventMouseButton, InputEventMouseMotion
滑鼠事件的基本輸入事件型別。
說明
儲存與滑鼠事件相關的通用資訊。
教學
屬性
BitField[MouseButtonMask] |
|
|
device |
|
|
|
||
|
屬性說明
BitField[MouseButtonMask] button_mask = 0 🔗
void set_button_mask(value: BitField[MouseButtonMask])
BitField[MouseButtonMask] get_button_mask()
滑鼠按鍵遮罩識別字,MouseButton 按鈕遮罩或將其按位元組合。
Vector2 global_position = Vector2(0, 0) 🔗
在 Node._input() 或 Node._unhandled_input() 中獲取時,返回根 Viewport 中滑鼠的位置,使用根 Viewport 的坐標系。
在 Control._gui_input() 中獲取時,返回該 Control 所在的 CanvasLayer 中滑鼠的位置,使用該 CanvasLayer 的坐標系。
Vector2 position = Vector2(0, 0) 🔗
在 Node._input() 或 Node._unhandled_input() 中獲取時,返回該 Node 所在 Viewport 中滑鼠的位置,使用該 Viewport 的坐標系。
在 Control._gui_input() 中獲取時,返回該 Control 中滑鼠的位置,使用該 Control 的坐標系。