class_audiostreamplayer2d.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AudioStreamPlayer2D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AudioStreamPlayer2D:
  5. AudioStreamPlayer2D
  6. ===================
  7. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Plays audio in 2D.
  12. Member Functions
  13. ----------------
  14. +----------------------------+-----------------------------------------------------------------------------------------------------+
  15. | :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_get_playback_position>` **(** **)** |
  16. +----------------------------+-----------------------------------------------------------------------------------------------------+
  17. | void | :ref:`play<class_AudioStreamPlayer2D_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  18. +----------------------------+-----------------------------------------------------------------------------------------------------+
  19. | void | :ref:`seek<class_AudioStreamPlayer2D_seek>` **(** :ref:`float<class_float>` to_position **)** |
  20. +----------------------------+-----------------------------------------------------------------------------------------------------+
  21. | void | :ref:`stop<class_AudioStreamPlayer2D_stop>` **(** **)** |
  22. +----------------------------+-----------------------------------------------------------------------------------------------------+
  23. Signals
  24. -------
  25. .. _class_AudioStreamPlayer2D_finished:
  26. - **finished** **(** **)**
  27. Emitted when the audio stops playing.
  28. Member Variables
  29. ----------------
  30. .. _class_AudioStreamPlayer2D_area_mask:
  31. - :ref:`int<class_int>` **area_mask** - Areas in which this sound plays.
  32. .. _class_AudioStreamPlayer2D_attenuation:
  33. - :ref:`float<class_float>` **attenuation** - Dampens audio over distance with this as an exponent.
  34. .. _class_AudioStreamPlayer2D_autoplay:
  35. - :ref:`bool<class_bool>` **autoplay** - If ``true`` audio plays when added to scene tree. Default value: ``false``.
  36. .. _class_AudioStreamPlayer2D_bus:
  37. - :ref:`String<class_string>` **bus** - Bus on which this audio is playing.
  38. .. _class_AudioStreamPlayer2D_max_distance:
  39. - :ref:`float<class_float>` **max_distance** - Maximum distance from which audio is still hearable.
  40. .. _class_AudioStreamPlayer2D_playing:
  41. - :ref:`bool<class_bool>` **playing** - If ``true`` audio is playing.
  42. .. _class_AudioStreamPlayer2D_stream:
  43. - :ref:`AudioStream<class_audiostream>` **stream** - The :ref:`AudioStream<class_audiostream>` object to be played.
  44. .. _class_AudioStreamPlayer2D_volume_db:
  45. - :ref:`float<class_float>` **volume_db** - Base volume without dampening.
  46. Description
  47. -----------
  48. Plays audio that dampens with distance from screen center.
  49. Member Function Description
  50. ---------------------------
  51. .. _class_AudioStreamPlayer2D_get_playback_position:
  52. - :ref:`float<class_float>` **get_playback_position** **(** **)**
  53. Returns the position in the :ref:`AudioStream<class_audiostream>`.
  54. .. _class_AudioStreamPlayer2D_play:
  55. - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  56. Plays the audio from the given position 'from_position', in seconds.
  57. .. _class_AudioStreamPlayer2D_seek:
  58. - void **seek** **(** :ref:`float<class_float>` to_position **)**
  59. Sets the position from which audio will be played, in seconds.
  60. .. _class_AudioStreamPlayer2D_stop:
  61. - void **stop** **(** **)**
  62. Stops the audio.