class_inputeventaction.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/InputEventAction.xml.
  6. .. _class_InputEventAction:
  7. InputEventAction
  8. ================
  9. **Inherits:** :ref:`InputEvent<class_InputEvent>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Input event type for actions.
  11. Description
  12. -----------
  13. Contains a generic action which can be targeted from several types of inputs. Actions can be created from the **Input Map** tab in the **Project > Project Settings** menu. See :ref:`Node._input<class_Node_method__input>`.
  14. Tutorials
  15. ---------
  16. - `InputEvent: Actions <../tutorials/inputs/inputevent.html#actions>`__
  17. - `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
  18. - `3D Voxel Demo <https://godotengine.org/asset-library/asset/676>`__
  19. Properties
  20. ----------
  21. +-------------------------------------+-----------------------------------------------------------+-----------+
  22. | :ref:`StringName<class_StringName>` | :ref:`action<class_InputEventAction_property_action>` | ``&""`` |
  23. +-------------------------------------+-----------------------------------------------------------+-----------+
  24. | :ref:`bool<class_bool>` | :ref:`pressed<class_InputEventAction_property_pressed>` | ``false`` |
  25. +-------------------------------------+-----------------------------------------------------------+-----------+
  26. | :ref:`float<class_float>` | :ref:`strength<class_InputEventAction_property_strength>` | ``1.0`` |
  27. +-------------------------------------+-----------------------------------------------------------+-----------+
  28. Property Descriptions
  29. ---------------------
  30. .. _class_InputEventAction_property_action:
  31. - :ref:`StringName<class_StringName>` **action**
  32. +-----------+-------------------+
  33. | *Default* | ``&""`` |
  34. +-----------+-------------------+
  35. | *Setter* | set_action(value) |
  36. +-----------+-------------------+
  37. | *Getter* | get_action() |
  38. +-----------+-------------------+
  39. The action's name. Actions are accessed via this :ref:`String<class_String>`.
  40. ----
  41. .. _class_InputEventAction_property_pressed:
  42. - :ref:`bool<class_bool>` **pressed**
  43. +-----------+--------------------+
  44. | *Default* | ``false`` |
  45. +-----------+--------------------+
  46. | *Setter* | set_pressed(value) |
  47. +-----------+--------------------+
  48. | *Getter* | is_pressed() |
  49. +-----------+--------------------+
  50. If ``true``, the action's state is pressed. If ``false``, the action's state is released.
  51. ----
  52. .. _class_InputEventAction_property_strength:
  53. - :ref:`float<class_float>` **strength**
  54. +-----------+---------------------+
  55. | *Default* | ``1.0`` |
  56. +-----------+---------------------+
  57. | *Setter* | set_strength(value) |
  58. +-----------+---------------------+
  59. | *Getter* | get_strength() |
  60. +-----------+---------------------+
  61. The action's strength between 0 and 1. This value is considered as equal to 0 if pressed is ``false``. The event strength allows faking analog joypad motion events, by specifying how strongly the joypad axis is bent or pressed.
  62. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  63. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  64. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  65. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  66. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  67. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`