Class TypingConfig

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

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

    Fields
    Modifier and Type Field Description
    static int CHAR_LIMIT_PER_FRAME
    Defines how many chars can appear per frame.
    static com.badlogic.gdx.graphics.Color DEFAULT_CLEAR_COLOR
    Default color for the CLEARCOLOR token.
    static float DEFAULT_SPEED_PER_CHAR
    Time in seconds that takes for each char to appear in the default speed.
    static float DEFAULT_WAIT_VALUE
    Default time in seconds that an empty WAIT token should wait for.
    static com.badlogic.gdx.utils.ObjectMap<java.lang.String,​java.lang.String> GLOBAL_VARS
    Map of global variables that affect all TypingLabel instances at once.
    static com.badlogic.gdx.utils.IntFloatMap 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.
    static float MAX_SPEED_MODIFIER
    Maximum value for the SPEED token.
    static float MIN_SPEED_MODIFIER
    Minimum value for the SPEED token.
  • Constructor Summary

    Constructors
    Constructor Description
    TypingConfig()  
  • Method Summary

    Modifier and Type Method Description
    static void registerEffect​(java.lang.String startTokenName, java.lang.String endTokenName, java.lang.Class<? extends Effect> effectClass)
    Registers a new effect to TypingLabel.
    static void unregisterEffect​(java.lang.String startTokenName, java.lang.String endTokenName)
    Unregisters an effect from TypingLabel.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.IntFloatMap 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. The keys are technically primitive ints, but only a char is used for each key.
    • GLOBAL_VARS

      public static final com.badlogic.gdx.utils.ObjectMap<java.lang.String,​java.lang.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​(java.lang.String startTokenName, java.lang.String endTokenName, java.lang.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​(java.lang.String startTokenName, java.lang.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.