This base User Widget provides you with a rich text box that plays text like a typewriter, one character at a time, with a configurable speed. You can skip to the end of the text if needed.
- Pre-calculates line breaks so that the text doesn't start to play a word near the end of the line then "jump down", it always knows where to start
- Pre-calculates the desired height of the text so that if embedded in a flexible height container, the height is correct before anything is played
- Supports decorators like inline images
- Respects explicit line breaks in your text
- Pauses on sentence terminators within a multi-sentence block (configurable)
Due to a quirk of the API used for sizing, this isn't a straight URichTextBlock
subclass you can drop straight in. Instead, you need to:
- Create a Widget Blueprint, subclassed from
UTypewriterTextWidget
- Place within it a
URichTextBlockForTypewriter
, namedLineText
(for binding) - Style the nested rich text box the way you want
- Then, in your other Widget Blueprints, make use of this
UTypewriterTextWidget
subclass in place of a rich text box - Call the
Play Line
andSkip To Line End
functions instead ofSet Text
to make use of the typewriter effect. - Listen to the
On Typewriter Line Finished
event to know when the typewriter effect has finished, or the line has been skipped to the end.
This was derived from Sam Bloomberg's work with some enhancements / adjustments. Both works are released under the MIT license.