class_audiostreamplayer2d.rst 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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:`int<class_int>` | :ref:`get_area_mask<class_AudioStreamPlayer2D_get_area_mask>` **(** **)** const |
  16. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`float<class_float>` | :ref:`get_attenuation<class_AudioStreamPlayer2D_get_attenuation>` **(** **)** const |
  18. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`String<class_string>` | :ref:`get_bus<class_AudioStreamPlayer2D_get_bus>` **(** **)** const |
  20. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`get_max_distance<class_AudioStreamPlayer2D_get_max_distance>` **(** **)** const |
  22. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer2D_get_playback_position>` **(** **)** |
  24. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`AudioStream<class_audiostream>` | :ref:`get_stream<class_AudioStreamPlayer2D_get_stream>` **(** **)** const |
  26. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`float<class_float>` | :ref:`get_volume_db<class_AudioStreamPlayer2D_get_volume_db>` **(** **)** const |
  28. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`is_autoplay_enabled<class_AudioStreamPlayer2D_is_autoplay_enabled>` **(** **)** |
  30. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`is_playing<class_AudioStreamPlayer2D_is_playing>` **(** **)** const |
  32. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`play<class_AudioStreamPlayer2D_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  34. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`seek<class_AudioStreamPlayer2D_seek>` **(** :ref:`float<class_float>` to_position **)** |
  36. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`set_area_mask<class_AudioStreamPlayer2D_set_area_mask>` **(** :ref:`int<class_int>` mask **)** |
  38. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`set_attenuation<class_AudioStreamPlayer2D_set_attenuation>` **(** :ref:`float<class_float>` curve **)** |
  40. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_autoplay<class_AudioStreamPlayer2D_set_autoplay>` **(** :ref:`bool<class_bool>` enable **)** |
  42. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`set_bus<class_AudioStreamPlayer2D_set_bus>` **(** :ref:`String<class_string>` bus **)** |
  44. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`set_max_distance<class_AudioStreamPlayer2D_set_max_distance>` **(** :ref:`float<class_float>` pixels **)** |
  46. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`set_stream<class_AudioStreamPlayer2D_set_stream>` **(** :ref:`AudioStream<class_audiostream>` stream **)** |
  48. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`set_volume_db<class_AudioStreamPlayer2D_set_volume_db>` **(** :ref:`float<class_float>` volume_db **)** |
  50. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`stop<class_AudioStreamPlayer2D_stop>` **(** **)** |
  52. +----------------------------------------+--------------------------------------------------------------------------------------------------------------------+
  53. Signals
  54. -------
  55. - **finished** **(** **)**
  56. Emitted when the audio stops playing.
  57. Member Variables
  58. ----------------
  59. - :ref:`int<class_int>` **area_mask** - Areas in which this sound plays.
  60. - :ref:`float<class_float>` **attenuation** - Dampens audio over distance with this as an exponent.
  61. - :ref:`bool<class_bool>` **autoplay** - If [code]true[/code] audio plays when added to scene tree. Default value: [code]false[/code].
  62. - :ref:`String<class_string>` **bus** - Bus on which this audio is playing.
  63. - :ref:`float<class_float>` **max_distance** - Maximum distance from which audio is still hearable.
  64. - :ref:`bool<class_bool>` **playing** - If [code]true[/code] audio is playing.
  65. - :ref:`AudioStream<class_audiostream>` **stream** - The [AudioStream] object to be played.
  66. - :ref:`float<class_float>` **volume_db** - Base volume without dampening.
  67. Description
  68. -----------
  69. Plays audio that dampens with distance from screen center.
  70. Member Function Description
  71. ---------------------------
  72. .. _class_AudioStreamPlayer2D_get_area_mask:
  73. - :ref:`int<class_int>` **get_area_mask** **(** **)** const
  74. .. _class_AudioStreamPlayer2D_get_attenuation:
  75. - :ref:`float<class_float>` **get_attenuation** **(** **)** const
  76. .. _class_AudioStreamPlayer2D_get_bus:
  77. - :ref:`String<class_string>` **get_bus** **(** **)** const
  78. .. _class_AudioStreamPlayer2D_get_max_distance:
  79. - :ref:`float<class_float>` **get_max_distance** **(** **)** const
  80. .. _class_AudioStreamPlayer2D_get_playback_position:
  81. - :ref:`float<class_float>` **get_playback_position** **(** **)**
  82. Returns the position in the :ref:`AudioStream<class_audiostream>`.
  83. .. _class_AudioStreamPlayer2D_get_stream:
  84. - :ref:`AudioStream<class_audiostream>` **get_stream** **(** **)** const
  85. .. _class_AudioStreamPlayer2D_get_volume_db:
  86. - :ref:`float<class_float>` **get_volume_db** **(** **)** const
  87. .. _class_AudioStreamPlayer2D_is_autoplay_enabled:
  88. - :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
  89. .. _class_AudioStreamPlayer2D_is_playing:
  90. - :ref:`bool<class_bool>` **is_playing** **(** **)** const
  91. .. _class_AudioStreamPlayer2D_play:
  92. - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  93. Plays the audio from the given position 'from_position', in seconds.
  94. .. _class_AudioStreamPlayer2D_seek:
  95. - void **seek** **(** :ref:`float<class_float>` to_position **)**
  96. Sets the position from which audio will be played, in seconds.
  97. .. _class_AudioStreamPlayer2D_set_area_mask:
  98. - void **set_area_mask** **(** :ref:`int<class_int>` mask **)**
  99. .. _class_AudioStreamPlayer2D_set_attenuation:
  100. - void **set_attenuation** **(** :ref:`float<class_float>` curve **)**
  101. .. _class_AudioStreamPlayer2D_set_autoplay:
  102. - void **set_autoplay** **(** :ref:`bool<class_bool>` enable **)**
  103. .. _class_AudioStreamPlayer2D_set_bus:
  104. - void **set_bus** **(** :ref:`String<class_string>` bus **)**
  105. .. _class_AudioStreamPlayer2D_set_max_distance:
  106. - void **set_max_distance** **(** :ref:`float<class_float>` pixels **)**
  107. .. _class_AudioStreamPlayer2D_set_stream:
  108. - void **set_stream** **(** :ref:`AudioStream<class_audiostream>` stream **)**
  109. .. _class_AudioStreamPlayer2D_set_volume_db:
  110. - void **set_volume_db** **(** :ref:`float<class_float>` volume_db **)**
  111. .. _class_AudioStreamPlayer2D_stop:
  112. - void **stop** **(** **)**
  113. Stops the audio.