class_listener.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 Listener.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Listener:
  6. Listener
  7. ========
  8. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Overrides the location sounds are heard from.
  10. Description
  11. -----------
  12. Once added to the scene tree and enabled using :ref:`make_current<class_Listener_method_make_current>`, this node will override the location sounds are heard from. This can be used to listen from a location different from the :ref:`Camera<class_Camera>`.
  13. Methods
  14. -------
  15. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  16. | void | :ref:`clear_current<class_Listener_method_clear_current>` **(** **)** |
  17. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  18. | :ref:`Transform<class_Transform>` | :ref:`get_listener_transform<class_Listener_method_get_listener_transform>` **(** **)** |const| |
  19. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  20. | :ref:`bool<class_bool>` | :ref:`is_current<class_Listener_method_is_current>` **(** **)** |const| |
  21. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  22. | void | :ref:`make_current<class_Listener_method_make_current>` **(** **)** |
  23. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  24. Method Descriptions
  25. -------------------
  26. .. _class_Listener_method_clear_current:
  27. - void **clear_current** **(** **)**
  28. Disables the listener to use the current camera's listener instead.
  29. ----
  30. .. _class_Listener_method_get_listener_transform:
  31. - :ref:`Transform<class_Transform>` **get_listener_transform** **(** **)** |const|
  32. Returns the listener's global orthonormalized :ref:`Transform<class_Transform>`.
  33. ----
  34. .. _class_Listener_method_is_current:
  35. - :ref:`bool<class_bool>` **is_current** **(** **)** |const|
  36. Returns ``true`` if the listener was made current using :ref:`make_current<class_Listener_method_make_current>`, ``false`` otherwise.
  37. **Note:** There may be more than one Listener marked as "current" in the scene tree, but only the one that was made current last will be used.
  38. ----
  39. .. _class_Listener_method_make_current:
  40. - void **make_current** **(** **)**
  41. Enables the listener. This will override the current camera's listener.
  42. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  43. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  44. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`