class_listener.rst 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.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. **Note:** There is no 2D equivalent for this node yet.
  14. Methods
  15. -------
  16. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  17. | void | :ref:`clear_current<class_Listener_method_clear_current>` **(** **)** |
  18. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  19. | :ref:`Transform<class_Transform>` | :ref:`get_listener_transform<class_Listener_method_get_listener_transform>` **(** **)** |const| |
  20. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`is_current<class_Listener_method_is_current>` **(** **)** |const| |
  22. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  23. | void | :ref:`make_current<class_Listener_method_make_current>` **(** **)** |
  24. +-----------------------------------+-------------------------------------------------------------------------------------------------+
  25. Method Descriptions
  26. -------------------
  27. .. _class_Listener_method_clear_current:
  28. - void **clear_current** **(** **)**
  29. Disables the listener to use the current camera's listener instead.
  30. ----
  31. .. _class_Listener_method_get_listener_transform:
  32. - :ref:`Transform<class_Transform>` **get_listener_transform** **(** **)** |const|
  33. Returns the listener's global orthonormalized :ref:`Transform<class_Transform>`.
  34. ----
  35. .. _class_Listener_method_is_current:
  36. - :ref:`bool<class_bool>` **is_current** **(** **)** |const|
  37. Returns ``true`` if the listener was made current using :ref:`make_current<class_Listener_method_make_current>`, ``false`` otherwise.
  38. **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.
  39. ----
  40. .. _class_Listener_method_make_current:
  41. - void **make_current** **(** **)**
  42. Enables the listener. This will override the current camera's listener.
  43. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  44. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  45. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`