classref: Sync with latest 4.0-alpha

This commit is contained in:
Rémi Verschelde
2022-02-01 16:35:13 +01:00
parent dd764520c6
commit 551ab512ca
419 changed files with 12867 additions and 9872 deletions
+48 -28
View File
@@ -65,7 +65,7 @@ Methods
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_joy_vibration_strength<class_Input_method_get_joy_vibration_strength>` **(** :ref:`int<class_int>` device **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_last_mouse_speed<class_Input_method_get_last_mouse_speed>` **(** **)** |const| |
| :ref:`Vector2<class_Vector2>` | :ref:`get_last_mouse_velocity<class_Input_method_get_last_mouse_velocity>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector3<class_Vector3>` | :ref:`get_magnetometer<class_Input_method_get_magnetometer>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -81,6 +81,8 @@ Methods
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_action_pressed<class_Input_method_is_action_pressed>` **(** :ref:`StringName<class_StringName>` action, :ref:`bool<class_bool>` exact_match=false **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_anything_pressed<class_Input_method_is_anything_pressed>` **(** **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_joy_button_pressed<class_Input_method_is_joy_button_pressed>` **(** :ref:`int<class_int>` device, :ref:`JoyButton<enum_@GlobalScope_JoyButton>` button **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_joy_known<class_Input_method_is_joy_known>` **(** :ref:`int<class_int>` device **)** |
@@ -89,7 +91,7 @@ Methods
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_mouse_button_pressed<class_Input_method_is_mouse_button_pressed>` **(** :ref:`MouseButton<enum_@GlobalScope_MouseButton>` button **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`joy_connection_changed<class_Input_method_joy_connection_changed>` **(** :ref:`int<class_int>` device, :ref:`bool<class_bool>` connected, :ref:`String<class_String>` name, :ref:`String<class_String>` guid **)** |
| :ref:`bool<class_bool>` | :ref:`is_physical_key_pressed<class_Input_method_is_physical_key_pressed>` **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const| |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`parse_input_event<class_Input_method_parse_input_event>` **(** :ref:`InputEvent<class_InputEvent>` event **)** |
+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -152,7 +154,7 @@ enum **MouseMode**:
- **MOUSE_MODE_CAPTURED** = **2** --- Captures the mouse. The mouse will be hidden and its position locked at the center of the screen.
**Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
\ **Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative<class_InputEventMouseMotion_property_relative>`.
- **MOUSE_MODE_CONFINED** = **3** --- Confines the mouse cursor to the game window, and make it visible.
@@ -212,7 +214,7 @@ enum **CursorShape**:
- **CURSOR_DRAG** = **6** --- Drag cursor. Usually displayed when dragging something.
**Note:** Windows lacks a dragging cursor, so :ref:`CURSOR_DRAG<class_Input_constant_CURSOR_DRAG>` is the same as :ref:`CURSOR_MOVE<class_Input_constant_CURSOR_MOVE>` for this platform.
\ **Note:** Windows lacks a dragging cursor, so :ref:`CURSOR_DRAG<class_Input_constant_CURSOR_DRAG>` is the same as :ref:`CURSOR_MOVE<class_Input_constant_CURSOR_MOVE>` for this platform.
- **CURSOR_CAN_DROP** = **7** --- Can drop cursor. Usually displayed when dragging something to indicate that it can be dropped at the current position.
@@ -245,7 +247,7 @@ This will simulate pressing the specified action.
The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action.
**Note:** This method will not cause any :ref:`Node._input<class_Node_method__input>` calls. It is intended to be used with :ref:`is_action_pressed<class_Input_method_is_action_pressed>` and :ref:`is_action_just_pressed<class_Input_method_is_action_just_pressed>`. If you want to simulate ``_input``, use :ref:`parse_input_event<class_Input_method_parse_input_event>` instead.
\ **Note:** This method will not cause any :ref:`Node._input<class_Node_method__input>` calls. It is intended to be used with :ref:`is_action_pressed<class_Input_method_is_action_pressed>` and :ref:`is_action_just_pressed<class_Input_method_is_action_just_pressed>`. If you want to simulate ``_input``, use :ref:`parse_input_event<class_Input_method_parse_input_event>` instead.
----
@@ -283,7 +285,7 @@ Returns the acceleration in m/s² of the device's accelerometer sensor, if the d
Note this method returns an empty :ref:`Vector3<class_Vector3>` when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer.
**Note:** This method only works on iOS, Android, and UWP. On other platforms, it always returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
\ **Note:** This method only works on iOS, Android, and UWP. On other platforms, it always returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
----
@@ -339,7 +341,7 @@ Returns the currently assigned cursor shape (see :ref:`CursorShape<enum_Input_Cu
Returns the gravity in m/s² of the device's accelerometer sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
**Note:** This method only works on Android and iOS. On other platforms, it always returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
\ **Note:** This method only works on Android and iOS. On other platforms, it always returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
----
@@ -349,7 +351,7 @@ Returns the gravity in m/s² of the device's accelerometer sensor, if the device
Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
**Note:** This method only works on Android and iOS. On other platforms, it always returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
\ **Note:** This method only works on Android and iOS. On other platforms, it always returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
----
@@ -393,11 +395,11 @@ Returns the strength of the joypad vibration: x is the strength of the weak moto
----
.. _class_Input_method_get_last_mouse_speed:
.. _class_Input_method_get_last_mouse_velocity:
- :ref:`Vector2<class_Vector2>` **get_last_mouse_speed** **(** **)** |const|
- :ref:`Vector2<class_Vector2>` **get_last_mouse_velocity** **(** **)** |const|
Returns the mouse speed for the last time the cursor was moved, and this until the next frame where the mouse moves. This means that even if the mouse is not moving, this function will still return the value of the last motion.
Returns the mouse velocity for the last time the cursor was moved, and this until the next frame where the mouse moves. This means that even if the mouse is not moving, this function will still return the value of the last motion.
----
@@ -407,7 +409,7 @@ Returns the mouse speed for the last time the cursor was moved, and this until t
Returns the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
**Note:** This method only works on Android, iOS and UWP. On other platforms, it always returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
\ **Note:** This method only works on Android, iOS and UWP. On other platforms, it always returns :ref:`Vector3.ZERO<class_Vector3_constant_ZERO>`.
----
@@ -449,6 +451,8 @@ This is useful for code that needs to run only once when an action is pressed, i
If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey<class_InputEventKey>` and :ref:`InputEventMouseButton<class_InputEventMouseButton>` events, and the direction for :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>` events.
\ **Note:** Due to keyboard ghosting, :ref:`is_action_just_pressed<class_Input_method_is_action_just_pressed>` may return ``false`` even if one of the action's keys is pressed. See `Input examples <../tutorials/inputs/input_examples.html#keyboard-events>`__ in the documentation for more information.
----
.. _class_Input_method_is_action_just_released:
@@ -469,6 +473,16 @@ Returns ``true`` if you are pressing the action event. Note that if an action ha
If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey<class_InputEventKey>` and :ref:`InputEventMouseButton<class_InputEventMouseButton>` events, and the direction for :ref:`InputEventJoypadMotion<class_InputEventJoypadMotion>` events.
\ **Note:** Due to keyboard ghosting, :ref:`is_action_pressed<class_Input_method_is_action_pressed>` may return ``false`` even if one of the action's keys is pressed. See `Input examples <../tutorials/inputs/input_examples.html#keyboard-events>`__ in the documentation for more information.
----
.. _class_Input_method_is_anything_pressed:
- :ref:`bool<class_bool>` **is_anything_pressed** **(** **)** |const|
Returns ``true`` if any action, key, joypad button, or mouse button is being pressed. This will also return ``true`` if any action is simulated via code by calling :ref:`action_press<class_Input_method_action_press>`.
----
.. _class_Input_method_is_joy_button_pressed:
@@ -493,6 +507,10 @@ Returns ``true`` if the system knows the specified device. This means that it se
Returns ``true`` if you are pressing the key in the current keyboard layout. You can pass a :ref:`Key<enum_@GlobalScope_Key>` constant.
\ :ref:`is_key_pressed<class_Input_method_is_key_pressed>` is only recommended over :ref:`is_physical_key_pressed<class_Input_method_is_physical_key_pressed>` in non-game applications. This ensures that shortcut keys behave as expected depending on the user's keyboard layout, as keyboard shortcuts are generally dependent on the keyboard layout in non-game applications. If in doubt, use :ref:`is_physical_key_pressed<class_Input_method_is_physical_key_pressed>`.
\ **Note:** Due to keyboard ghosting, :ref:`is_key_pressed<class_Input_method_is_key_pressed>` may return ``false`` even if one of the action's keys is pressed. See `Input examples <../tutorials/inputs/input_examples.html#keyboard-events>`__ in the documentation for more information.
----
.. _class_Input_method_is_mouse_button_pressed:
@@ -503,13 +521,15 @@ Returns ``true`` if you are pressing the mouse button specified with :ref:`Mouse
----
.. _class_Input_method_joy_connection_changed:
.. _class_Input_method_is_physical_key_pressed:
- void **joy_connection_changed** **(** :ref:`int<class_int>` device, :ref:`bool<class_bool>` connected, :ref:`String<class_String>` name, :ref:`String<class_String>` guid **)**
- :ref:`bool<class_bool>` **is_physical_key_pressed** **(** :ref:`Key<enum_@GlobalScope_Key>` keycode **)** |const|
Notifies the ``Input`` singleton that a connection has changed, to update the state for the ``device`` index.
Returns ``true`` if you are pressing the key in the physical location on the 101/102-key US QWERTY keyboard. You can pass a :ref:`Key<enum_@GlobalScope_Key>` constant.
This is used internally and should not have to be called from user scripts. See :ref:`joy_connection_changed<class_Input_signal_joy_connection_changed>` for the signal emitted when this is triggered internally.
\ :ref:`is_physical_key_pressed<class_Input_method_is_physical_key_pressed>` is recommended over :ref:`is_key_pressed<class_Input_method_is_key_pressed>` for in-game actions, as it will make :kbd:`W`/:kbd:`A`/:kbd:`S`/:kbd:`D` layouts work regardless of the user's keyboard layout. :ref:`is_physical_key_pressed<class_Input_method_is_physical_key_pressed>` will also ensure that the top row number keys work on any keyboard layout. If in doubt, use :ref:`is_physical_key_pressed<class_Input_method_is_physical_key_pressed>`.
\ **Note:** Due to keyboard ghosting, :ref:`is_physical_key_pressed<class_Input_method_is_physical_key_pressed>` may return ``false`` even if one of the action's keys is pressed. See `Input examples <../tutorials/inputs/input_examples.html#keyboard-events>`__ in the documentation for more information.
----
@@ -556,7 +576,7 @@ Removes all mappings from the internal database that match the given GUID.
Sets the acceleration value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
**Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS.
\ **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS.
----
@@ -566,13 +586,13 @@ Sets the acceleration value of the accelerometer sensor. Can be used for debuggi
Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing ``null`` to the image parameter resets to the system cursor. See :ref:`CursorShape<enum_Input_CursorShape>` for the list of shapes.
``image``'s size must be lower than 256×256.
\ ``image``'s size must be lower than 256×256.
``hotspot`` must be within ``image``'s size.
\ ``hotspot`` must be within ``image``'s size.
**Note:** :ref:`AnimatedTexture<class_AnimatedTexture>`\ s aren't supported as custom mouse cursors. If using an :ref:`AnimatedTexture<class_AnimatedTexture>`, only the first frame will be displayed.
\ **Note:** :ref:`AnimatedTexture<class_AnimatedTexture>`\ s aren't supported as custom mouse cursors. If using an :ref:`AnimatedTexture<class_AnimatedTexture>`, only the first frame will be displayed.
**Note:** Only images imported with the **Lossless**, **Lossy** or **Uncompressed** compression modes are supported. The **Video RAM** compression mode can't be used for custom cursors.
\ **Note:** Only images imported with the **Lossless**, **Lossy** or **Uncompressed** compression modes are supported. The **Video RAM** compression mode can't be used for custom cursors.
----
@@ -582,9 +602,9 @@ Sets a custom mouse cursor image, which is only visible inside the game window.
Sets the default cursor shape to be used in the viewport instead of :ref:`CURSOR_ARROW<class_Input_constant_CURSOR_ARROW>`.
**Note:** If you want to change the default cursor shape for :ref:`Control<class_Control>`'s nodes, use :ref:`Control.mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>` instead.
\ **Note:** If you want to change the default cursor shape for :ref:`Control<class_Control>`'s nodes, use :ref:`Control.mouse_default_cursor_shape<class_Control_property_mouse_default_cursor_shape>` instead.
**Note:** This method generates an :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` to update cursor immediately.
\ **Note:** This method generates an :ref:`InputEventMouseMotion<class_InputEventMouseMotion>` to update cursor immediately.
----
@@ -594,7 +614,7 @@ Sets the default cursor shape to be used in the viewport instead of :ref:`CURSOR
Sets the gravity value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
**Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS.
\ **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS.
----
@@ -604,7 +624,7 @@ Sets the gravity value of the accelerometer sensor. Can be used for debugging on
Sets the value of the rotation rate of the gyroscope sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
**Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS.
\ **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS.
----
@@ -614,7 +634,7 @@ Sets the value of the rotation rate of the gyroscope sensor. Can be used for deb
Sets the value of the magnetic field of the magnetometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
**Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS.
\ **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS.
----
@@ -642,7 +662,7 @@ Input accumulation is enabled by default. It can be disabled to get slightly mor
Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. ``weak_magnitude`` is the strength of the weak motor (between 0 and 1) and ``strong_magnitude`` is the strength of the strong motor (between 0 and 1). ``duration`` is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely).
**Note:** Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds.
\ **Note:** Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds.
----
@@ -660,7 +680,7 @@ Stops the vibration of the joypad.
Vibrate Android and iOS devices.
**Note:** It needs ``VIBRATE`` permission for Android at export settings. iOS does not support duration.
\ **Note:** It needs ``VIBRATE`` permission for Android at export settings. iOS does not support duration.
----