Package com.github.tommyettinger.textra
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 intCHAR_LIMIT_PER_FRAMEDefines how many chars can appear per frame.static com.badlogic.gdx.graphics.ColorDEFAULT_CLEAR_COLORDefault color for theCLEARCOLORtoken.static floatDEFAULT_SPEED_PER_CHARTime in seconds that takes for each char to appear in the default speed.static floatDEFAULT_WAIT_VALUEDefault time in seconds that an emptyWAITtoken should wait for.static com.badlogic.gdx.utils.ObjectMap<java.lang.String,java.lang.String>GLOBAL_VARSMap of global variables that affect allTypingLabelinstances at once.static com.badlogic.gdx.utils.IntFloatMapINTERVAL_MULTIPLIERS_BY_CHARReturns a map of characters and their respective interval multipliers, of which the interval to the next char should be multiplied for.static floatMAX_SPEED_MODIFIERMaximum value for theSPEEDtoken.static floatMIN_SPEED_MODIFIERMinimum value for theSPEEDtoken. -
Constructor Summary
Constructors Constructor Description TypingConfig() -
Method Summary
Modifier and Type Method Description static voidregisterEffect(java.lang.String startTokenName, Effect.EffectBuilder builder)Registers a new effect to TypingLabel.static voidunregisterEffect(java.lang.String startTokenName)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_VALUEDefault time in seconds that an emptyWAITtoken should wait for. Default value is0.250. -
DEFAULT_SPEED_PER_CHAR
public static float DEFAULT_SPEED_PER_CHARTime in seconds that takes for each char to appear in the default speed. Default value is0.035. -
MIN_SPEED_MODIFIER
public static float MIN_SPEED_MODIFIERMinimum value for theSPEEDtoken. This value dividesDEFAULT_SPEED_PER_CHARto calculate the final speed. Keep it above zero. Default value is0.001. -
MAX_SPEED_MODIFIER
public static float MAX_SPEED_MODIFIERMaximum value for theSPEEDtoken. This value dividesDEFAULT_SPEED_PER_CHARto calculate the final speed. Default value is100. -
CHAR_LIMIT_PER_FRAME
public static int CHAR_LIMIT_PER_FRAMEDefines how many chars can appear per frame. Use a value less than1to disable this limit. Default value is-1. -
DEFAULT_CLEAR_COLOR
public static com.badlogic.gdx.graphics.Color DEFAULT_CLEAR_COLORDefault color for theCLEARCOLORtoken. Can be overriden byTypingLabel.getClearColor(). -
INTERVAL_MULTIPLIERS_BY_CHAR
public static com.badlogic.gdx.utils.IntFloatMap INTERVAL_MULTIPLIERS_BY_CHARReturns 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_VARSMap of global variables that affect allTypingLabelinstances at once.
-
-
Constructor Details
-
TypingConfig
public TypingConfig()
-
-
Method Details
-
registerEffect
Registers a new effect to TypingLabel.- Parameters:
startTokenName- Name of the token that starts the effect, such as WAVE.builder- Typically a lambda or method reference that creates an Effect.
-
unregisterEffect
public static void unregisterEffect(java.lang.String startTokenName)Unregisters an effect from TypingLabel.- Parameters:
startTokenName- Name of the token that starts the effect, such as WAVE.
-