Options
All
  • Public
  • Public/Protected
  • All
Menu

Provides convenient functions for managing background music.

Index

Functions

adjustVolume

  • adjustVolume(newVolume: number, numFrames?: number): Promise<void>
  • Adjust the BGM volume, optionally over the course of several frames.

    Parameters

    • newVolume: number

      The target volume level.

    • Optional numFrames: number

      The number of frames over which to adjust the volume.

    Returns Promise<void>

    A promise that resolves when the volume reaches the new level.

override

  • override(fileName: string, fadeFrames?: number): void
  • Temporarily override the normal BGM with a specific track, with optional crossfade.

    Parameters

    • fileName: string

      SphereFS path of the music track to play.

    • Optional fadeFrames: number

      Duration of the optional crossfade transition, in frames.

    Returns void

play

  • play(fileName: string, fadeFrames?: number): void
  • Change the track currently at the top of the music stack, with optional crossfade.

    Parameters

    • fileName: string

      SphereFS path of the music track to play.

    • Optional fadeFrames: number

      Duration of the optional crossfade transition, in frames.

    Returns void

pop

  • pop(fadeFrames?: number): void
  • Remove the music currently at the top of the music stack and resume the previously playing track.

    Parameters

    • Optional fadeFrames: number

      Duration of the optional crossfade transition, in frames.

    Returns void

push

  • push(fileName: string, fadeFrames?: number): void
  • Push a new track onto the top of the music stack. The previous track can be resumed by calling pop.

    Parameters

    • fileName: string

      SphereFS path of the music file to play.

    • Optional fadeFrames: number

      Duration of the optional crossfade transition, in frames.

    Returns void

reset

  • reset(fadeFrames?: number): void
  • Reset the music manager to normal operation after the game has called override.

    Parameters

    • Optional fadeFrames: number

      Duration of the optional crossfade, in frames.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc