Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Audio

Hierarchy

  • Audio

Index

Constructors

constructor

Properties

Private bgm_volume

bgm_volume: number

Private current_bgm

current_bgm: Sound = null

Private data

data: GoldenSun

Private game

game: Game

Private se_data

se_data: {} = {}

Type declaration

  • [se_key: string]: Phaser.AudioSprite

Static Private Readonly DEFAULT_BGM_VOLUME

DEFAULT_BGM_VOLUME: 0.6 = 0.6

Default bgm volume

Static Private Readonly VOLUME_ALTER_LOOP_TIME

VOLUME_ALTER_LOOP_TIME: 100 = 100

Volume change held threshold

Static Private Readonly VOLUME_STEP

VOLUME_STEP: 0.1 = 0.1

Volume step to apply upon volume altering

Methods

add_bgm

  • add_bgm(bgm_key: string, play?: boolean): void
  • Parameters

    • bgm_key: string
    • play: boolean = false

    Returns void

add_se

  • add_se(se_key: string): void
  • Parameters

    • se_key: string

    Returns void

Private alter_volume

  • alter_volume(delta: number): number
  • Changes the game volume.

    Parameters

    • delta: number

      Delta to apply to the volume

    Returns number

    Final game volume

initialize_controls

  • initialize_controls(): void
  • Initialize mute and volume alter controls.

    Returns void

pause_bgm

  • pause_bgm(): void

play_bgm

  • play_bgm(loop?: boolean, volume?: number): void
  • Parameters

    • loop: boolean = true
    • Optional volume: number

    Returns void

play_se

  • play_se(key: string, on_stop?: Function, position_shift?: number, volume?: number): void
  • Parameters

    • key: string
    • Optional on_stop: Function
    • position_shift: number = 0
    • volume: number = 1

    Returns void

resume_bgm

  • resume_bgm(): void

stop_bgm

  • stop_bgm(): void

Generated using TypeDoc