Class TypingAdapterBuilder

java.lang.Object
com.shr4pnel.casino.builders.TypingAdapterBuilder

public class TypingAdapterBuilder extends Object
Build TypingAdapters on the fly, which can play sounds when text has finished typing, or fire other events relating to a TypingLabel that has finished typing
  • Constructor Details

    • TypingAdapterBuilder

      public TypingAdapterBuilder()
  • Method Details

    • setSound

      public TypingAdapterBuilder setSound(String path)
      Set a sound to play at the end of the TypingLabel
      Parameters:
      path - Path to the audio file relative to assets/
      Returns:
      The current instance
    • setSound

      public TypingAdapterBuilder setSound(String path, float vol)
      Set a sound to play at the end of the TypingLabel
      Parameters:
      path - Path to the audio file relative to assets/
      vol - The volume of the sound effect from 0-1
      Returns:
      The current instance
    • dontStopSound

      public TypingAdapterBuilder dontStopSound()
      Do not interrupt other sound effects when the typing label has finished
      Returns:
      The current instance
    • chainTypingLabel

      public TypingAdapterBuilder chainTypingLabel(com.rafaskoberg.gdx.typinglabel.TypingLabel tl, com.badlogic.gdx.scenes.scene2d.ui.Window w)
      Chain a typing label, start a typing label when another has finished
      Parameters:
      tl - The new typing label
      w - The window to render the typing label inside
      Returns:
      The current instance
    • delay

      public TypingAdapterBuilder delay(int delayMillis)
      Set a delay, before performing any set actions at the end of a typinglabel
      Parameters:
      delayMillis - How long to wait in ms
      Returns:
      The current instance
    • addEvent

      public TypingAdapterBuilder addEvent(String s)
      Add a TypingLabel event to fire
      Parameters:
      s - The name of the event
      Returns:
      The current instance
    • build

      public com.rafaskoberg.gdx.typinglabel.TypingAdapter build()
      Build the typing adapter, with previously set parameters
      Returns:
      A TypingAdapter