class_audiolistener2d.rst 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/AudioListener2D.xml.
  6. .. _class_AudioListener2D:
  7. AudioListener2D
  8. ===============
  9. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Overrides the location sounds are heard from.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Once added to the scene tree and enabled using :ref:`make_current<class_AudioListener2D_method_make_current>`, this node will override the location sounds are heard from. Only one **AudioListener2D** can be current. Using :ref:`make_current<class_AudioListener2D_method_make_current>` will disable the previous **AudioListener2D**.
  15. If there is no active **AudioListener2D** in the current :ref:`Viewport<class_Viewport>`, center of the screen will be used as a hearing point for the audio. **AudioListener2D** needs to be inside :ref:`SceneTree<class_SceneTree>` to function.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +-------------------------+--------------------------------------------------------------------------------+
  22. | void | :ref:`clear_current<class_AudioListener2D_method_clear_current>` **(** **)** |
  23. +-------------------------+--------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`is_current<class_AudioListener2D_method_is_current>` **(** **)** |const| |
  25. +-------------------------+--------------------------------------------------------------------------------+
  26. | void | :ref:`make_current<class_AudioListener2D_method_make_current>` **(** **)** |
  27. +-------------------------+--------------------------------------------------------------------------------+
  28. .. rst-class:: classref-section-separator
  29. ----
  30. .. rst-class:: classref-descriptions-group
  31. Method Descriptions
  32. -------------------
  33. .. _class_AudioListener2D_method_clear_current:
  34. .. rst-class:: classref-method
  35. void **clear_current** **(** **)**
  36. Disables the **AudioListener2D**. If it's not set as current, this method will have no effect.
  37. .. rst-class:: classref-item-separator
  38. ----
  39. .. _class_AudioListener2D_method_is_current:
  40. .. rst-class:: classref-method
  41. :ref:`bool<class_bool>` **is_current** **(** **)** |const|
  42. Returns ``true`` if this **AudioListener2D** is currently active.
  43. .. rst-class:: classref-item-separator
  44. ----
  45. .. _class_AudioListener2D_method_make_current:
  46. .. rst-class:: classref-method
  47. void **make_current** **(** **)**
  48. Makes the **AudioListener2D** active, setting it as the hearing point for the sounds. If there is already another active **AudioListener2D**, it will be disabled.
  49. This method will have no effect if the **AudioListener2D** is not added to :ref:`SceneTree<class_SceneTree>`.
  50. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  51. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  52. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  53. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  54. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  55. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  56. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`