class_audiolistener2d.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. :github_url: hide
  2. .. meta::
  3. :keywords: sound
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioListener2D.xml.
  8. .. _class_AudioListener2D:
  9. AudioListener2D
  10. ===============
  11. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. Overrides the location sounds are heard from.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. 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**.
  17. 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.
  18. .. rst-class:: classref-reftable-group
  19. Methods
  20. -------
  21. .. table::
  22. :widths: auto
  23. +-------------------------+--------------------------------------------------------------------------+
  24. | |void| | :ref:`clear_current<class_AudioListener2D_method_clear_current>`\ (\ ) |
  25. +-------------------------+--------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`is_current<class_AudioListener2D_method_is_current>`\ (\ ) |const| |
  27. +-------------------------+--------------------------------------------------------------------------+
  28. | |void| | :ref:`make_current<class_AudioListener2D_method_make_current>`\ (\ ) |
  29. +-------------------------+--------------------------------------------------------------------------+
  30. .. rst-class:: classref-section-separator
  31. ----
  32. .. rst-class:: classref-descriptions-group
  33. Method Descriptions
  34. -------------------
  35. .. _class_AudioListener2D_method_clear_current:
  36. .. rst-class:: classref-method
  37. |void| **clear_current**\ (\ ) :ref:`🔗<class_AudioListener2D_method_clear_current>`
  38. Disables the **AudioListener2D**. If it's not set as current, this method will have no effect.
  39. .. rst-class:: classref-item-separator
  40. ----
  41. .. _class_AudioListener2D_method_is_current:
  42. .. rst-class:: classref-method
  43. :ref:`bool<class_bool>` **is_current**\ (\ ) |const| :ref:`🔗<class_AudioListener2D_method_is_current>`
  44. Returns ``true`` if this **AudioListener2D** is currently active.
  45. .. rst-class:: classref-item-separator
  46. ----
  47. .. _class_AudioListener2D_method_make_current:
  48. .. rst-class:: classref-method
  49. |void| **make_current**\ (\ ) :ref:`🔗<class_AudioListener2D_method_make_current>`
  50. Makes the **AudioListener2D** active, setting it as the hearing point for the sounds. If there is already another active **AudioListener2D**, it will be disabled.
  51. This method will have no effect if the **AudioListener2D** is not added to :ref:`SceneTree<class_SceneTree>`.
  52. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  53. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  54. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  55. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  56. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  57. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  58. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  59. .. |void| replace:: :abbr:`void (No return value.)`