0.2.0-dev Download ZIP
33 lines ·1.6 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="AudioListener2D" inherits="Node2D" api_type="core" keywords="sound" 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 [AudioListener2D] can be current. Using [method make_current] will disable the previous [AudioListener2D]. |
| 8 | If there is no active [AudioListener2D] in the current [Viewport], center of the screen will be used as a hearing point for the audio. [AudioListener2D] 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 [AudioListener2D]. 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 [AudioListener2D] is currently active. |
| 23 | </description> |
| 24 | </method> |
| 25 | <method name="make_current"> |
| 26 | <return type="void" /> |
| 27 | <description> |
| 28 | Makes the [AudioListener2D] active, setting it as the hearing point for the sounds. If there is already another active [AudioListener2D], it will be disabled. |
| 29 | This method will have no effect if the [AudioListener2D] is not added to [SceneTree]. |
| 30 | </description> |
| 31 | </method> |
| 32 | </methods> |
| 33 | </class> |