class_inputeventmouse.rst 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the InputEventMouse.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_InputEventMouse:
  6. InputEventMouse
  7. ===============
  8. **Inherits:** :ref:`InputEventWithModifiers<class_InputEventWithModifiers>` **<** :ref:`InputEventFromWindow<class_InputEventFromWindow>` **<** :ref:`InputEvent<class_InputEvent>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`InputEventMouseButton<class_InputEventMouseButton>`, :ref:`InputEventMouseMotion<class_InputEventMouseMotion>`
  10. Base input event type for mouse events.
  11. Description
  12. -----------
  13. Stores general mouse events information.
  14. Tutorials
  15. ---------
  16. - :doc:`InputEvent <../tutorials/inputs/inputevent>`
  17. Properties
  18. ----------
  19. +---------------------------------------------------+------------------------------------------------------------------------+-------------------+
  20. | :ref:`MouseButton<enum_@GlobalScope_MouseButton>` | :ref:`button_mask<class_InputEventMouse_property_button_mask>` | ``0`` |
  21. +---------------------------------------------------+------------------------------------------------------------------------+-------------------+
  22. | :ref:`Vector2<class_Vector2>` | :ref:`global_position<class_InputEventMouse_property_global_position>` | ``Vector2(0, 0)`` |
  23. +---------------------------------------------------+------------------------------------------------------------------------+-------------------+
  24. | :ref:`Vector2<class_Vector2>` | :ref:`position<class_InputEventMouse_property_position>` | ``Vector2(0, 0)`` |
  25. +---------------------------------------------------+------------------------------------------------------------------------+-------------------+
  26. Property Descriptions
  27. ---------------------
  28. .. _class_InputEventMouse_property_button_mask:
  29. - :ref:`MouseButton<enum_@GlobalScope_MouseButton>` **button_mask**
  30. +-----------+------------------------+
  31. | *Default* | ``0`` |
  32. +-----------+------------------------+
  33. | *Setter* | set_button_mask(value) |
  34. +-----------+------------------------+
  35. | *Getter* | get_button_mask() |
  36. +-----------+------------------------+
  37. The mouse button mask identifier, one of or a bitwise combination of the :ref:`MouseButton<enum_@GlobalScope_MouseButton>` button masks.
  38. ----
  39. .. _class_InputEventMouse_property_global_position:
  40. - :ref:`Vector2<class_Vector2>` **global_position**
  41. +-----------+----------------------------+
  42. | *Default* | ``Vector2(0, 0)`` |
  43. +-----------+----------------------------+
  44. | *Setter* | set_global_position(value) |
  45. +-----------+----------------------------+
  46. | *Getter* | get_global_position() |
  47. +-----------+----------------------------+
  48. When received in :ref:`Node._input<class_Node_method__input>` or :ref:`Node._unhandled_input<class_Node_method__unhandled_input>`, returns the mouse's position in the root :ref:`Viewport<class_Viewport>` using the coordinate system of the root :ref:`Viewport<class_Viewport>`.
  49. When received in :ref:`Control._gui_input<class_Control_method__gui_input>`, returns the mouse's position in the :ref:`CanvasLayer<class_CanvasLayer>` that the :ref:`Control<class_Control>` is in using the coordinate system of the :ref:`CanvasLayer<class_CanvasLayer>`.
  50. ----
  51. .. _class_InputEventMouse_property_position:
  52. - :ref:`Vector2<class_Vector2>` **position**
  53. +-----------+---------------------+
  54. | *Default* | ``Vector2(0, 0)`` |
  55. +-----------+---------------------+
  56. | *Setter* | set_position(value) |
  57. +-----------+---------------------+
  58. | *Getter* | get_position() |
  59. +-----------+---------------------+
  60. When received in :ref:`Node._input<class_Node_method__input>` or :ref:`Node._unhandled_input<class_Node_method__unhandled_input>`, returns the mouse's position in the :ref:`Viewport<class_Viewport>` this :ref:`Node<class_Node>` is in using the coordinate system of this :ref:`Viewport<class_Viewport>`.
  61. When received in :ref:`Control._gui_input<class_Control_method__gui_input>`, returns the mouse's position in the :ref:`Control<class_Control>` using the local coordinate system of the :ref:`Control<class_Control>`.
  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.)`