Table of Contents

Subtitles UGUI

alt_text

Assigns the current text cue from subtitles active on the MediaPlayer to a uGUI Text component.

An optional background Image component can be adjusted to fit the size of the text with some padding.

Properties
Property Function
Media Player The MediaPlayer component used to retrieve the subtitle text cues
Text The Text component to update with subtitle text
Background Image An optional Image component which is resized to fit the text
Background Horizontal Padding Number of pixels to use to pad the background image horizontally
Background Vertical Padding Number of pixels to use to pad the background image vertically
Max Characters The maximum number of characters to display. Text strings longer than this will be truncated. Useful to prevent unexpected very long text displaying.

 

Tip

A version of this component for TextMeshPro could easily be made

 

alt_text