Files
godot-docs/classes/class_audiostreamplayer2d.rst
2018-08-21 00:37:52 +02:00

125 lines
4.0 KiB
ReStructuredText

.. 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:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_get_playback_position>` **(** **)** |
+----------------------------+-----------------------------------------------------------------------------------------------------+
| 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:`stop<class_AudioStreamPlayer2D_stop>` **(** **)** |
+----------------------------+-----------------------------------------------------------------------------------------------------+
Signals
-------
.. _class_AudioStreamPlayer2D_finished:
- **finished** **(** **)**
Emitted when the audio stops playing.
Member Variables
----------------
.. _class_AudioStreamPlayer2D_area_mask:
- :ref:`int<class_int>` **area_mask** - Areas in which this sound plays.
.. _class_AudioStreamPlayer2D_attenuation:
- :ref:`float<class_float>` **attenuation** - Dampens audio over distance with this as an exponent.
.. _class_AudioStreamPlayer2D_autoplay:
- :ref:`bool<class_bool>` **autoplay** - If ``true`` audio plays when added to scene tree. Default value: ``false``.
.. _class_AudioStreamPlayer2D_bus:
- :ref:`String<class_string>` **bus** - Bus on which this audio is playing.
.. _class_AudioStreamPlayer2D_max_distance:
- :ref:`float<class_float>` **max_distance** - Maximum distance from which audio is still hearable.
.. _class_AudioStreamPlayer2D_pitch_scale:
- :ref:`float<class_float>` **pitch_scale** - Changes the pitch and the tempo of the audio.
.. _class_AudioStreamPlayer2D_playing:
- :ref:`bool<class_bool>` **playing** - If ``true`` audio is playing.
.. _class_AudioStreamPlayer2D_stream:
- :ref:`AudioStream<class_audiostream>` **stream** - The :ref:`AudioStream<class_audiostream>` object to be played.
.. _class_AudioStreamPlayer2D_stream_paused:
- :ref:`bool<class_bool>` **stream_paused**
.. _class_AudioStreamPlayer2D_volume_db:
- :ref:`float<class_float>` **volume_db** - Base volume without dampening.
Description
-----------
Plays audio that dampens with distance from screen center.
Tutorials
---------
- :doc:`../learning/features/audio/index`
- :doc:`../tutorials/audio/audio_streams`
Member Function Description
---------------------------
.. _class_AudioStreamPlayer2D_get_playback_position:
- :ref:`float<class_float>` **get_playback_position** **(** **)**
Returns the position in the :ref:`AudioStream<class_audiostream>`.
.. _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_stop:
- void **stop** **(** **)**
Stops the audio.