mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
229 lines
10 KiB
ReStructuredText
229 lines
10 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/4.3/doc/classes/InputEventScreenDrag.xml.
|
|
|
|
.. _class_InputEventScreenDrag:
|
|
|
|
InputEventScreenDrag
|
|
====================
|
|
|
|
**继承:** :ref:`InputEventFromWindow<class_InputEventFromWindow>` **<** :ref:`InputEvent<class_InputEvent>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
代表屏幕拖拽事件。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
描述
|
|
----
|
|
|
|
存放与屏幕拖拽事件相关的信息。见 :ref:`Node._input<class_Node_private_method__input>`\ 。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
教程
|
|
----
|
|
|
|
- :doc:`使用 InputEvent <../tutorials/inputs/inputevent>`
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
属性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`int<class_int>` | :ref:`index<class_InputEventScreenDrag_property_index>` | ``0`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`pen_inverted<class_InputEventScreenDrag_property_pen_inverted>` | ``false`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`position<class_InputEventScreenDrag_property_position>` | ``Vector2(0, 0)`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`float<class_float>` | :ref:`pressure<class_InputEventScreenDrag_property_pressure>` | ``0.0`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`relative<class_InputEventScreenDrag_property_relative>` | ``Vector2(0, 0)`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`screen_relative<class_InputEventScreenDrag_property_screen_relative>` | ``Vector2(0, 0)`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`screen_velocity<class_InputEventScreenDrag_property_screen_velocity>` | ``Vector2(0, 0)`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`tilt<class_InputEventScreenDrag_property_tilt>` | ``Vector2(0, 0)`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
| :ref:`Vector2<class_Vector2>` | :ref:`velocity<class_InputEventScreenDrag_property_velocity>` | ``Vector2(0, 0)`` |
|
|
+-------------------------------+-----------------------------------------------------------------------------+-------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
属性说明
|
|
--------
|
|
|
|
.. _class_InputEventScreenDrag_property_index:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **index** = ``0`` :ref:`🔗<class_InputEventScreenDrag_property_index>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_index**\ (\ value\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_index**\ (\ )
|
|
|
|
多次拖动事件中的拖动事件索引。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_InputEventScreenDrag_property_pen_inverted:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **pen_inverted** = ``false`` :ref:`🔗<class_InputEventScreenDrag_property_pen_inverted>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_pen_inverted**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **get_pen_inverted**\ (\ )
|
|
|
|
正在使用手写笔的橡皮端时,会返回 ``true``\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_InputEventScreenDrag_property_position:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **position** = ``Vector2(0, 0)`` :ref:`🔗<class_InputEventScreenDrag_property_position>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_position**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
|
- :ref:`Vector2<class_Vector2>` **get_position**\ (\ )
|
|
|
|
节点所在视口中的拖动位置,使用该视口的坐标系。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_InputEventScreenDrag_property_pressure:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **pressure** = ``0.0`` :ref:`🔗<class_InputEventScreenDrag_property_pressure>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_pressure**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_pressure**\ (\ )
|
|
|
|
表示用户对笔施加的压力。范围从 ``0.0`` 到 ``1.0`` 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_InputEventScreenDrag_property_relative:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **relative** = ``Vector2(0, 0)`` :ref:`🔗<class_InputEventScreenDrag_property_relative>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_relative**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
|
- :ref:`Vector2<class_Vector2>` **get_relative**\ (\ )
|
|
|
|
相对于前一位置(上一帧的位置)的拖动位置。
|
|
|
|
\ **注意:**\ :ref:`relative<class_InputEventScreenDrag_property_relative>` 根据内容缩放系数自动缩放,内容缩放系数由项目的拉伸模式设置定义。这意味着在处理触摸瞄准的脚本中使用 :ref:`relative<class_InputEventScreenDrag_property_relative>` 时,触摸灵敏度将根据分辨率而有所不同。为了避免这种情况,请改用 :ref:`screen_relative<class_InputEventScreenDrag_property_screen_relative>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_InputEventScreenDrag_property_screen_relative:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **screen_relative** = ``Vector2(0, 0)`` :ref:`🔗<class_InputEventScreenDrag_property_screen_relative>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_screen_relative**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
|
- :ref:`Vector2<class_Vector2>` **get_screen_relative**\ (\ )
|
|
|
|
相对于屏幕坐标中的上一个位置(上一帧的位置)的未缩放拖动位置。该位置\ *不*\ 根据内容缩放系数或调用 :ref:`InputEvent.xformed_by<class_InputEvent_method_xformed_by>` 进行缩放。无论项目的拉伸模式如何,对于触摸瞄准来说,这都应该优先于 :ref:`relative<class_InputEventScreenDrag_property_relative>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_InputEventScreenDrag_property_screen_velocity:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **screen_velocity** = ``Vector2(0, 0)`` :ref:`🔗<class_InputEventScreenDrag_property_screen_velocity>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_screen_velocity**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
|
- :ref:`Vector2<class_Vector2>` **get_screen_velocity**\ (\ )
|
|
|
|
屏幕坐标中未缩放的拖动速度(单位为每秒像素数)。该速度\ *不会*\ 根据内容缩放系数或对 :ref:`InputEvent.xformed_by<class_InputEvent_method_xformed_by>` 的调用进行缩放。无论项目的拉伸模式如何,对于触摸瞄准来说,这都应该优先于 :ref:`velocity<class_InputEventScreenDrag_property_velocity>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_InputEventScreenDrag_property_tilt:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **tilt** = ``Vector2(0, 0)`` :ref:`🔗<class_InputEventScreenDrag_property_tilt>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_tilt**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
|
- :ref:`Vector2<class_Vector2>` **get_tilt**\ (\ )
|
|
|
|
代表笔的倾斜角度。正的 X 坐标值表示向右倾斜。正的Y坐标值表示向用户自身倾斜。两个轴的范围是 ``-1.0`` 到 ``1.0``\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_InputEventScreenDrag_property_velocity:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Vector2<class_Vector2>` **velocity** = ``Vector2(0, 0)`` :ref:`🔗<class_InputEventScreenDrag_property_velocity>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_velocity**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
|
|
- :ref:`Vector2<class_Vector2>` **get_velocity**\ (\ )
|
|
|
|
拖动速度。
|
|
|
|
\ **注意:**\ :ref:`velocity<class_InputEventScreenDrag_property_velocity>` 根据内容缩放系数自动缩放,内容缩放系数由项目的拉伸模式设置定义。这意味着在处理触摸瞄准的脚本中使用 :ref:`velocity<class_InputEventScreenDrag_property_velocity>` 时,触摸灵敏度将根据分辨率而表现不同。为了避免这种情况,请改用 :ref:`screen_velocity<class_InputEventScreenDrag_property_screen_velocity>`\ 。
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
|
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
|
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
|
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
|
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
|
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
|
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
|
.. |void| replace:: :abbr:`void (无返回值。)`
|