123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the AudioStreamPlayer2D.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_AudioStreamPlayer2D:
- AudioStreamPlayer2D
- ===================
- **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
- **Category:** Core
- Brief Description
- -----------------
- Plays audio in 2D.
- Member Functions
- ----------------
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_area_mask<class_AudioStreamPlayer2D_get_area_mask>` **(** **)** const |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_attenuation<class_AudioStreamPlayer2D_get_attenuation>` **(** **)** const |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_string>` | :ref:`get_bus<class_AudioStreamPlayer2D_get_bus>` **(** **)** const |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_max_distance<class_AudioStreamPlayer2D_get_max_distance>` **(** **)** const |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_get_playback_position>` **(** **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`AudioStream<class_audiostream>` | :ref:`get_stream<class_AudioStreamPlayer2D_get_stream>` **(** **)** const |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_volume_db<class_AudioStreamPlayer2D_get_volume_db>` **(** **)** const |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_autoplay_enabled<class_AudioStreamPlayer2D_is_autoplay_enabled>` **(** **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_playing<class_AudioStreamPlayer2D_is_playing>` **(** **)** const |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`play<class_AudioStreamPlayer2D_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`seek<class_AudioStreamPlayer2D_seek>` **(** :ref:`float<class_float>` to_position **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_area_mask<class_AudioStreamPlayer2D_set_area_mask>` **(** :ref:`int<class_int>` mask **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_attenuation<class_AudioStreamPlayer2D_set_attenuation>` **(** :ref:`float<class_float>` curve **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_autoplay<class_AudioStreamPlayer2D_set_autoplay>` **(** :ref:`bool<class_bool>` enable **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_bus<class_AudioStreamPlayer2D_set_bus>` **(** :ref:`String<class_string>` bus **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_max_distance<class_AudioStreamPlayer2D_set_max_distance>` **(** :ref:`float<class_float>` pixels **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_stream<class_AudioStreamPlayer2D_set_stream>` **(** :ref:`AudioStream<class_audiostream>` stream **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_volume_db<class_AudioStreamPlayer2D_set_volume_db>` **(** :ref:`float<class_float>` volume_db **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`stop<class_AudioStreamPlayer2D_stop>` **(** **)** |
- +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
- Signals
- -------
- - **finished** **(** **)**
- Emitted when the audio stops playing.
- Member Variables
- ----------------
- - :ref:`int<class_int>` **area_mask** - Areas in which this sound plays.
- - :ref:`float<class_float>` **attenuation** - Dampens audio over distance with this as an exponent.
- - :ref:`bool<class_bool>` **autoplay** - If [code]true[/code] audio plays when added to scene tree. Default value: [code]false[/code].
- - :ref:`String<class_string>` **bus** - Bus on which this audio is playing.
- - :ref:`float<class_float>` **max_distance** - Maximum distance from which audio is still hearable.
- - :ref:`bool<class_bool>` **playing** - If [code]true[/code] audio is playing.
- - :ref:`AudioStream<class_audiostream>` **stream** - The [AudioStream] object to be played.
- - :ref:`float<class_float>` **volume_db** - Base volume without dampening.
- Description
- -----------
- Plays audio that dampens with distance from screen center.
- Member Function Description
- ---------------------------
- .. _class_AudioStreamPlayer2D_get_area_mask:
- - :ref:`int<class_int>` **get_area_mask** **(** **)** const
- .. _class_AudioStreamPlayer2D_get_attenuation:
- - :ref:`float<class_float>` **get_attenuation** **(** **)** const
- .. _class_AudioStreamPlayer2D_get_bus:
- - :ref:`String<class_string>` **get_bus** **(** **)** const
- .. _class_AudioStreamPlayer2D_get_max_distance:
- - :ref:`float<class_float>` **get_max_distance** **(** **)** const
- .. _class_AudioStreamPlayer2D_get_playback_position:
- - :ref:`float<class_float>` **get_playback_position** **(** **)**
- Returns the position in the :ref:`AudioStream<class_audiostream>`.
- .. _class_AudioStreamPlayer2D_get_stream:
- - :ref:`AudioStream<class_audiostream>` **get_stream** **(** **)** const
- .. _class_AudioStreamPlayer2D_get_volume_db:
- - :ref:`float<class_float>` **get_volume_db** **(** **)** const
- .. _class_AudioStreamPlayer2D_is_autoplay_enabled:
- - :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
- .. _class_AudioStreamPlayer2D_is_playing:
- - :ref:`bool<class_bool>` **is_playing** **(** **)** const
- .. _class_AudioStreamPlayer2D_play:
- - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
- Plays the audio from the given position 'from_position', in seconds.
- .. _class_AudioStreamPlayer2D_seek:
- - void **seek** **(** :ref:`float<class_float>` to_position **)**
- Sets the position from which audio will be played, in seconds.
- .. _class_AudioStreamPlayer2D_set_area_mask:
- - void **set_area_mask** **(** :ref:`int<class_int>` mask **)**
- .. _class_AudioStreamPlayer2D_set_attenuation:
- - void **set_attenuation** **(** :ref:`float<class_float>` curve **)**
- .. _class_AudioStreamPlayer2D_set_autoplay:
- - void **set_autoplay** **(** :ref:`bool<class_bool>` enable **)**
- .. _class_AudioStreamPlayer2D_set_bus:
- - void **set_bus** **(** :ref:`String<class_string>` bus **)**
- .. _class_AudioStreamPlayer2D_set_max_distance:
- - void **set_max_distance** **(** :ref:`float<class_float>` pixels **)**
- .. _class_AudioStreamPlayer2D_set_stream:
- - void **set_stream** **(** :ref:`AudioStream<class_audiostream>` stream **)**
- .. _class_AudioStreamPlayer2D_set_volume_db:
- - void **set_volume_db** **(** :ref:`float<class_float>` volume_db **)**
- .. _class_AudioStreamPlayer2D_stop:
- - void **stop** **(** **)**
- Stops the audio.
|