Listener2D.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Listener2D" inherits="Node2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Overrides the location sounds are heard from.
  5. </brief_description>
  6. <description>
  7. Once added to the scene tree and enabled using [method make_current], this node will override the location sounds are heard from. Only one [Listener2D] can be current. Using [method make_current] will disable the previous [Listener2D].
  8. If there is no active [Listener2D] in the current [Viewport], center of the screen will be used as a hearing point for the audio. [Listener2D] needs to be inside [SceneTree] to function.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="clear_current">
  14. <return type="void" />
  15. <description>
  16. Disables the [Listener2D]. If it's not set as current, this method will have no effect.
  17. </description>
  18. </method>
  19. <method name="is_current" qualifiers="const">
  20. <return type="bool" />
  21. <description>
  22. Returns [code]true[/code] if this [Listener2D] is currently active.
  23. </description>
  24. </method>
  25. <method name="make_current">
  26. <return type="void" />
  27. <description>
  28. Makes the [Listener2D] active, setting it as the hearing point for the sounds. If there is already another active [Listener2D], it will be disabled.
  29. This method will have no effect if the [Listener2D] is not added to [SceneTree].
  30. </description>
  31. </method>
  32. </methods>
  33. <constants>
  34. </constants>
  35. </class>