Package 

Class TextDelegate


  • 
    public class TextDelegate
    
                        

    To replace static text in an animation at runtime, create an instance of this class and call setText to replace the hard coded animation text (input) with the text of your choosing (output).

    Alternatively, extend this class and override getText and if the text hasn't already been set by setText then it will call getText.

    • Method Detail

      • setCacheText

         void setCacheText(boolean cacheText)

        Sets whether or not TextDelegate will cache (memoize) the results of getText.If this isn't necessary then set it to false.

      • getText

         String getText(String layerName, String input)

        Override this to replace the animation text with something dynamic. This can be used fortranslations or custom data.

        Parameters:
        layerName - the name of the layer with text
        input - the string at the layer with text
      • getText

         String getText(String input)

        Override this to replace the animation text with something dynamic. This can be used fortranslations or custom data.

      • setText

         void setText(String input, String output)

        Update the text that will be rendered for the given input text.

      • invalidateText

         void invalidateText(String input)

        Invalidates a cached string with the given input.