Class TypingConfig

java.lang.Object
com.github.tommyettinger.textra.TypingConfig

public class TypingConfig extends Object
Configuration class that easily allows the user to fine tune the library's functionality.
  • Field Details

    • DEFAULT_WAIT_VALUE

      public static float DEFAULT_WAIT_VALUE
      Default time in seconds that an empty WAIT token should wait for. Default value is 0.250.
    • DEFAULT_SPEED_PER_CHAR

      public static float DEFAULT_SPEED_PER_CHAR
      Time in seconds that takes for each char to appear in the default speed. Default value is 0.035.
    • MIN_SPEED_MODIFIER

      public static float MIN_SPEED_MODIFIER
      Minimum value for the SPEED token. This value divides DEFAULT_SPEED_PER_CHAR to calculate the final speed. Keep it above zero. Default value is 0.001.
    • MAX_SPEED_MODIFIER

      public static float MAX_SPEED_MODIFIER
      Maximum value for the SPEED token. This value divides DEFAULT_SPEED_PER_CHAR to calculate the final speed. Default value is 100.
    • CHAR_LIMIT_PER_FRAME

      public static int CHAR_LIMIT_PER_FRAME
      Defines how many chars can appear per frame. Use a value less than 1 to disable this limit. Default value is -1.
    • DEFAULT_CLEAR_COLOR

      public static com.badlogic.gdx.graphics.Color DEFAULT_CLEAR_COLOR
      Default color for the CLEARCOLOR token. Can be overriden by TypingLabel.getClearColor().
    • INTERVAL_MULTIPLIERS_BY_CHAR

      public static com.badlogic.gdx.utils.ObjectFloatMap<Character> INTERVAL_MULTIPLIERS_BY_CHAR
      Returns a map of characters and their respective interval multipliers, of which the interval to the next char should be multiplied for.
    • GLOBAL_VARS

      public static final com.badlogic.gdx.utils.ObjectMap<String,​String> GLOBAL_VARS
      Map of global variables that affect all TypingLabel instances at once.
  • Constructor Details

    • TypingConfig

      public TypingConfig()
  • Method Details

    • registerEffect

      public static void registerEffect(String startTokenName, String endTokenName, Class<? extends Effect> effectClass)
      Registers a new effect to TypingLabel.
      Parameters:
      startTokenName - Name of the token that starts the effect, such as WAVE.
      endTokenName - Name of the token that ends the effect, such as ENDWAVE.
      effectClass - Class of the effect, such as WaveEffect.class.
    • unregisterEffect

      public static void unregisterEffect(String startTokenName, String endTokenName)
      Unregisters an effect from TypingLabel.
      Parameters:
      startTokenName - Name of the token that starts the effect, such as WAVE.
      endTokenName - Name of the token that ends the effect, such as ENDWAVE.