Package arc.flabel

Interface FListener


public interface FListener
Simple listener for fancy label events.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    end()
    Called when the char progression reaches the end.
    default void
    event(String event)
    Called each time an EVENT token is processed.
    default void
    onChar(char ch)
    Called when a new character is displayed.
    default String
    Called when variable tokens are replaced in text.
  • Method Details

    • event

      default void event(String event)
      Called each time an EVENT token is processed.
      Parameters:
      event - Name of the event specified in the token. e.g. {EVENT=player_name} will have player_name as argument.
    • end

      default void end()
      Called when the char progression reaches the end.
    • replaceVariable

      default String replaceVariable(String variable)
      Called when variable tokens are replaced in text. This is an alternative method to deal with variables, other than directly assigning replacement values to the label. Replacements returned by this method have priority over direct values, unless null is returned.
      Parameters:
      variable - The variable name assigned to the {VAR} token. For example, in {VAR=townName}, the variable will be townName
      Returns:
      The replacement String, or null if this method should be ignored and the regular values should be used instead.
    • onChar

      default void onChar(char ch)
      Called when a new character is displayed. May be called many times per frame depending on the label configurations and text speed. Useful to do a certain action each time a character is displayed, like playing a sound effect.