Expressive Text on screen using Blueprints

🔀
The following guide shows you the simplest way to display text directly on-screen. You could also follow
🥤
Expressive Text inside UI
if you already have a “master UI” and want to display the text nested to it.
 
The simplest way to display text directly on screen is using the Blueprint Functions provided:
notion image
 
Here’s how we use them to display three sentences in subtitle style:
 
Open the level blueprint (We’re doing this on the level blueprint but you could do it from any other blueprint)
notion image
 
First, create 3 ExpressiveTextFields variables that are going to contain the 3 different sentences respectively:
notion image
And here’s the value for LineOne:
notion image
  1. Setting Default Style to “Subtitles” since that’s the only style we’re going to apply.
  1. On Alignment, we set the text to be centered at the bottom and apply a 10% of parent offset from the bottom — check out
    đź“Ź
    Justification, Alignment & Positioning
    to learn more about how these parameters work.
  1. Width Settings is set to only occupy 70% of the parent size (i.e. the game screen) so it overflows sooner and doesn’t fill the screen with text from end-to-end.
  1. Justification is also set to center.
  1. Finally, we set the text to be whatever we want.
 
For LineTwo and LineThree we use the same settings as above, changing the text only.
 
Now it’s time to plug these variables into the macro:
notion image
In the macro itself we’re able to define how long to display the text for - something useful about this macro is that it only continues execution when the given time has passed, meaning we can chain them together to transition between sentences.
 
Now you can hit Play ▶️ and see the results:
notion image
ON THIS PAGE