First commit 🎉
This commit is contained in:
commit
43ea213f9b
728 changed files with 37080 additions and 0 deletions
23
addons/popochiu/engine/audio_manager/audio_cue_music.gd
Normal file
23
addons/popochiu/engine/audio_manager/audio_cue_music.gd
Normal file
|
@ -0,0 +1,23 @@
|
|||
@tool
|
||||
class_name AudioCueMusic
|
||||
extends PopochiuAudioCue
|
||||
## A specific type of [PopochiuAudioCue] designed for playing music.
|
||||
|
||||
|
||||
#region Public #####################################################################################
|
||||
## Plays this audio cue. It can fade for [param fade_duration] seconds, and you can change the track
|
||||
## starting position in seconds with [param music_position].
|
||||
func play(fade_duration := 0.0, music_position := 0.0) -> void:
|
||||
PopochiuUtils.e.am.play_music_cue(resource_name, fade_duration, music_position)
|
||||
|
||||
|
||||
## Plays this audio cue. It can fade for [param fade_duration] seconds, and you can change the track
|
||||
## starting position in seconds with [param music_position].[br][br]
|
||||
## [i]This method is intended to be used inside a [method Popochiu.queue] of instructions.[/i]
|
||||
func queue_play(fade_duration := 0.0, music_position := 0.0) -> Callable:
|
||||
return func ():
|
||||
await play(fade_duration, music_position)
|
||||
await PopochiuUtils.e.get_tree().process_frame
|
||||
|
||||
|
||||
#endregion
|
Loading…
Add table
Add a link
Reference in a new issue