Documentation
¶
Overview ¶
Once added to the scene tree and enabled using Instance.MakeCurrent, this node will override the location sounds are heard from. Only one graphics.gd/classdb/AudioListener2D can be current. Using Instance.MakeCurrent will disable the previous graphics.gd/classdb/AudioListener2D.
If there is no active graphics.gd/classdb/AudioListener2D in the current graphics.gd/classdb/Viewport, center of the screen will be used as a hearing point for the audio. graphics.gd/classdb/AudioListener2D needs to be inside graphics.gd/classdb/SceneTree to function.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsAudioListener2D() Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode2D() Node2D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) ClearCurrent()
- func (self Instance) ID() ID
- func (self Instance) IsCurrent() bool
- func (self Instance) MakeCurrent()
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsAudioListener2D ¶
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.AudioListener2D
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsAudioListener2D ¶
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) ClearCurrent ¶
func (self Instance) ClearCurrent()
Disables the graphics.gd/classdb/AudioListener2D. If it's not set as current, this method will have no effect.
func (Instance) IsCurrent ¶
Returns true if this graphics.gd/classdb/AudioListener2D is currently active.
func (Instance) MakeCurrent ¶
func (self Instance) MakeCurrent()
Makes the graphics.gd/classdb/AudioListener2D active, setting it as the hearing point for the sounds. If there is already another active graphics.gd/classdb/AudioListener2D, it will be disabled.
This method will have no effect if the graphics.gd/classdb/AudioListener2D is not added to graphics.gd/classdb/SceneTree.