Drag[en]gine Script Module DragonScript  1.21
Dragengine.Utils.StyledText.STDVariableResolver Class Reference

Replace variables with resolved content. More...

Inheritance diagram for Dragengine.Utils.StyledText.STDVariableResolver:
Dragengine.Utils.StyledText.Definition.Nodes.DefaultSTDNodeVisitor Dragengine.Utils.StyledText.Definition.Nodes.STDNodeVisitor

Public Member Functions

StyledTextDefinition getDefinition ()
 Styled text definition to add the visited content to. More...
 
STDVariableResolver new (StyledTextDefinition definition)
 Create converter. More...
 
String resolveVariable (String variableName)
 Resolve variable returning the value to set in place of the variable. More...
 
void visitImage (STDNImage node)
 Visit image node. More...
 
void visitNode (STDNode node)
 Visit node. More...
 
void visitText (STDNText node)
 Visit text node. More...
 
- Public Member Functions inherited from Dragengine.Utils.StyledText.Definition.Nodes.DefaultSTDNodeVisitor
DefaultSTDNodeVisitor new ()
 Create default styled text definition node visitor. More...
 
void visitVideo (STDNVideo node)
 Visit video node. More...
 

Protected Member Functions

String resolveVariables (String text)
 Resolve variables. More...
 

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)

◆ visitNode()

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

◆ visitText()

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

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