Drag[en]gine Script Module DragonScript
1.21
|
Replace variables with resolved content. More...
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... | |
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 "{".
StyledTextDefinition Dragengine.Utils.StyledText.STDVariableResolver.getDefinition | ( | ) |
Styled text definition to add the visited content to.
STDVariableResolver Dragengine.Utils.StyledText.STDVariableResolver.new | ( | StyledTextDefinition | definition | ) |
Create converter.
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.
|
protected |
Resolve variables.
void Dragengine.Utils.StyledText.STDVariableResolver.visitImage | ( | STDNImage | node | ) |
Visit image node.
Reimplemented from Dragengine.Utils.StyledText.Definition.Nodes.DefaultSTDNodeVisitor.
void Dragengine.Utils.StyledText.STDVariableResolver.visitNode | ( | STDNode | node | ) |
Visit node.
Reimplemented from Dragengine.Utils.StyledText.Definition.Nodes.DefaultSTDNodeVisitor.
void Dragengine.Utils.StyledText.STDVariableResolver.visitText | ( | STDNText | node | ) |
Visit text node.
Reimplemented from Dragengine.Utils.StyledText.Definition.Nodes.DefaultSTDNodeVisitor.