AudioCueMusic - carenalgas/popochiu GitHub Wiki

Description

Inherits AudioCue.

An AudioCue intended to play music.

Methods

Public

  • play( float fade_duration = 0.0, float music_position = 0.0 ) void

    🍑 Use this to play this audio cue inside an E.run() (a.k.a. queue of instructions) 🍑

    Plays the music track. It can fade for fade_duration seconds. You can change the track starting position in seconds with music_position. Can be yield.

    func on_room_transition_finished() -> void:
      E.run([
        A.mx_classic.play(1.5),
        A.sfx_intro.play(),
        "Player: I like this music..."
      ])
    
  • play_now( float fade_duration = 0.0, float music_position = 0.0 ) void

    Plays the music track immediately. It can fade for fade_duration seconds. You can change the track starting position in seconds with music_position. Can be yield.

    func on_interact() -> void:
      A.mx_radio_emotion.play_now()
    
      E.run([
        '...',
        "Player: Wait...",
        "Player: That radio station",
        '...',
        "Player: Is it Fernando Martínez?"
      ])