Class AudioListener2D
- Namespace
- Godot
- Assembly
- GodotSharp.dll
Once added to the scene tree and enabled using MakeCurrent(), this node will override the location sounds are heard from. Only one AudioListener2D can be current. Using MakeCurrent() will disable the previous AudioListener2D.
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.
public class AudioListener2D : Node2D, IDisposable
- Inheritance
-
AudioListener2D
- Implements
- Inherited Members
Constructors
AudioListener2D()
public AudioListener2D()
Methods
ClearCurrent()
Disables the AudioListener2D. If it's not set as current, this method will have no effect.
public void ClearCurrent()
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
IsCurrent()
Returns true
if this AudioListener2D is currently active.
public bool IsCurrent()
Returns
MakeCurrent()
Makes the AudioListener2D active, setting it as the hearing point for the sounds. If there is already another active AudioListener2D, it will be disabled.
This method will have no effect if the AudioListener2D is not added to SceneTree.
public void MakeCurrent()