Class Sound.SoundBuilder

java.lang.Object
org.collebol.engine.audio.Sound.SoundBuilder
Enclosing class:
Sound

public static class Sound.SoundBuilder extends Object
The SoundBuilder class is used to construct Sound objects with specific properties.
  • Constructor Details

    • SoundBuilder

      public SoundBuilder(int id, String path)
      SoundBuilder constructor.
      Parameters:
      id - the unique id of the sound.
      path - the path to the sound file.
  • Method Details

    • position

      public Sound.SoundBuilder position(Vector2D position)
      Parameters:
      position - position where the sound must play from.
      Returns:
      instance.
    • volume

      public Sound.SoundBuilder volume(float volume)
      Parameters:
      volume - default volume of the source.
      Returns:
      instance
    • pitch

      public Sound.SoundBuilder pitch(float pitch)
      Parameters:
      pitch - default pitch of the source.
      Returns:
      instance
    • refDistance

      public Sound.SoundBuilder refDistance(float refDistance)
      Parameters:
      refDistance - default the distance where you can hear the sound at full volume.
      Returns:
      instance
    • rollOffFactor

      public Sound.SoundBuilder rollOffFactor(float factor)
      Parameters:
      factor - default float how fast the volume decreases.
      Returns:
      instance