Drag[en]gine Script Module DragonScript 1.23
Loading...
Searching...
No Matches
Dragengine.Utils.StyledText.STDVariableResolver Class Reference

Replace variables with resolved content. More...

Inheritance diagram for Dragengine.Utils.StyledText.STDVariableResolver:

Public Member Functions

StyledTextDefinition getDefinition ()
 Styled text definition to add the visited content to.
 
STDVariableResolver new (StyledTextDefinition definition)
 Create converter.
 
String resolveVariable (String variableName)
 Resolve variable returning the value to set in place of the variable.
 
void visitImage (STDNImage node)
 Visit image node.
 
void visitNode (STDNode node)
 Visit node.
 
void visitText (STDNText node)
 Visit text node.
 

Protected Member Functions

String resolveVariables (String text)
 Resolve variables.
 

Detailed Description

Replace variables with resolved content.

Subclass and implement the resolvVariable method to return the requested values. The visited content is added to a new styled text definition to keep the original intact. Tokens are contained between curly brackets like "{binding quit}". The special token "{{" is converted to "{".

Member Function Documentation

◆ getDefinition()

StyledTextDefinition Dragengine.Utils.StyledText.STDVariableResolver.getDefinition ( )

Styled text definition to add the visited content to.

◆ new()

STDVariableResolver Dragengine.Utils.StyledText.STDVariableResolver.new ( StyledTextDefinition  definition)

Create converter.

◆ resolveVariable()

String Dragengine.Utils.StyledText.STDVariableResolver.resolveVariable ( String  variableName)

Resolve variable returning the value to set in place of the variable.

The default implementation returns the variable name in curly brackets. This can be used as error fallback.

◆ resolveVariables()

String Dragengine.Utils.StyledText.STDVariableResolver.resolveVariables ( String  text)
protected

Resolve variables.

◆ visitImage()

void Dragengine.Utils.StyledText.STDVariableResolver.visitImage ( STDNImage  node)

Visit image node.

◆ visitNode()

void Dragengine.Utils.StyledText.STDVariableResolver.visitNode ( STDNode  node)

Visit node.

◆ visitText()

void Dragengine.Utils.StyledText.STDVariableResolver.visitText ( STDNText  node)

Visit text node.


The documentation for this class was generated from the following file: