Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Music

[13:7] extends: FxObj

Wraps FXGL's Music, a long-form audio track (typically loaded from an .mp3 file) for background music or recorded dialogue. Like Sound, Music holds an Audio object that carries the actual play / pause / stop / volume controls.

Methods

  • Music (Ajo = null)

    Wraps an existing Music AussomJavaObject. Normally obtained through fxgl.getAssetLoader().loadMusic(...) rather than constructed directly.

    • @p Ajo is an AussomJavaObject around an FXGL Music.
  • audio ()

    Returns the underlying Audio wrapper, on which play / pause / stop / setVolume / setLooping / setOnFinished live.

    • @r An Audio wrapper.
  • isDisposed ()

    Returns true if dispose has been called on this Music.

    • @r A bool.
  • getAudio ()

    Returns the underlying Audio AJO that backs this music.

  • dispose ()

    Disposes the music and releases any backing native resources. Use this when the wrapping engine is shutting down a scene.