Package com.github.tommyettinger.textra
Class TypingConfig
java.lang.Object
com.github.tommyettinger.textra.TypingConfig
Configuration class that easily allows the user to fine tune the library's functionality.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intDefines how many chars can appear per frame.static com.badlogic.gdx.graphics.ColorDefault color for theCLEARCOLORtoken.static floatTime in seconds that takes for each char to appear in the default speed.static floatDefault time in seconds that an emptyWAITtoken should wait for.Map of global variables that affect allTypingLabelinstances at once.static com.badlogic.gdx.utils.ObjectFloatMap<Character>Returns a map of characters and their respective interval multipliers, of which the interval to the next char should be multiplied for.static floatMaximum value for theSPEEDtoken.static floatMinimum value for theSPEEDtoken. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidregisterEffect(String startTokenName, String endTokenName, Class<? extends Effect> effectClass)Registers a new effect to TypingLabel.static voidunregisterEffect(String startTokenName, String endTokenName)Unregisters an effect from TypingLabel.
-
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
Returns a map of characters and their respective interval multipliers, of which the interval to the next char should be multiplied for. -
GLOBAL_VARS
Map of global variables that affect allTypingLabelinstances 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
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.
-