Cauldron2D.Audio.Keyed (Cauldron2D v0.2.2)

Copy Markdown View Source

A sound event under a key, as Cauldron2D.Audio.keyed/4, moved/2 and stopped/2 build it for Cauldron2D.Audio.play/2.

  • :play — sound name under key, at at, replacing whatever sounds under key; with loop true, round and round until stopped
  • :move — the sound under key is now at at
  • :stop — let the sound under key go over fade seconds

at is {x, y} against the listener, nil for full level centred, or {:level, gain, pan} for a level the game works out itself. With music true the music level scales it instead of the effects level.

Summary

Types

position()

@type position() :: {number(), number()} | {:level, number(), number()} | nil

t()

@type t() :: %Cauldron2D.Audio.Keyed{
  action: :play | :move | :stop,
  at: position(),
  fade: float(),
  key: term(),
  loop: boolean(),
  music: boolean(),
  name: term()
}