Apply Text Material
Intro
Apply Text Material can be used as a Material Behaviour on a Text Shape to set the materials of characters, lines, words or partial strings in a procedural way. For example, set the last word's color to blue or set the word Cavalry
to green each time it appears in a string.
UI
- Behaviour
- Fill
- Stroke
Mode - Choose a mode for the selection:
- Regex - Set a Regular Expression to determine which parts of the string will be selected. There are several presets available at the top of the Attribute Editor UI.
- Specific Indices - Manually enter the indices to determine which lines/words/characters are selected.
- All - Use this setting when using a Range Falloff via another Behaviour. See example below.
Index Mode - When the Mode is set to Specific Indices, select which level is affected:
- Line - Fill each line within the string defined by Specific Indices.
- Word - Fill each word within the string defined by Specific Indices.
- Character - Fill each character within the string defined by Specific Indices.
Specific Indices - When the Mode is set to Specific Indices, set the indices to select. Values should be comma ,
separated for lists or colon :
separated for ranges. e.g. 0,1:3,8
will select indices 0, 1, 2, 3 and 8. You can also enter first
or last
to procedurally select those indices. Note that a space character is included as an index.
Regex - Enter a Regular Expression. See Working with Regex for more information.
Capture Group Indices - Where a Regular Expression includes capture groups, determine which groups are returned. Values should be comma ,
separated for lists or colon :
separated for ranges. See Working with Regex for more information.
Overwrite Blend Mode - When checked, a Blend Mode can be set for the selection.
Blend Mode - Set the blend mode.
Filters - A list of connected Filters. Use the + button to create and connect a Filter or drag and drop an existing one to connect it.
See Common Attributes (Fill tab).
Any existing Fill must be overridden to remove it. To do this, enable the Fill and set the Alpha to 0
.
See Common Attributes (Stroke tab).
Any existing Stroke must be overridden to remove it. To do this, enable the Stroke and set the Alpha to 0
.
- Create a Text Shape.
- Using the
+
button on the Material Behaviours attribute and add an Apply Text Material. - Set the Apply Text Material's Mode to All.
- Go to the Apply Text Material's Fill tab, right click on the Color attribute > Add Behaviour > Color Blend.
- Go the Color Blend's Falloff tab and right click > Add Falloff > Range Falloff.
The Range Falloff can now be used to set each character's color from either end of the Color Blend's gradient.