![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SubtitleManager.h>
Public Member Functions | |
| void | KillAllSubtitles (void) |
| void | KillSubtitles (PTRINT SubtitleID) |
| void | TrimRegionToSafeZone (FCanvas *Canvas, FIntRect &InOutSubtitleRegion) |
| void | SplitLinesToSafeZone (FCanvas *Canvas, FIntRect &SubtitleRegion) |
| PTRINT | FindHighestPrioritySubtitle (float CurrentTime) |
| ENGINE_API void | QueueSubtitles (PTRINT SubtitleID, float Priority, bool bManualWordWrap, bool bSingleLine, float SoundDuration, const TArray< FSubtitleCue > &Subtitles, float InStartTime, float InCurrentTime) |
| void | DisplaySubtitle (FCanvas *Canvas, FActiveSubtitle *Subtitle, FIntRect &Parms, const FLinearColor &Color) |
| ENGINE_API void | DisplaySubtitles (FCanvas *InCanvas, FIntRect &SubtitleRegion, float InAudioTimeSeconds) |
| bool | HasSubtitles () |
| float | GetCurrentSubtitlesHeight () |
| FSubtitleManagerSetSubtitleText & | OnSetSubtitleText () |
| void ENGINE_API | SetMovieSubtitle (UObject *SubtitleOwner, const TArray< FString > &Subtitles) |
Static Public Member Functions | |
| static void | QueueSubtitles (const FQueueSubtitleParams &QueueSubtitlesParams) |
| static ENGINE_API FSubtitleManager * | GetSubtitleManager () |
Subtitle manager. Handles prioritization and rendering of subtitles.
| void FSubtitleManager::DisplaySubtitle | ( | FCanvas * | Canvas, |
| FActiveSubtitle * | Subtitle, | ||
| FIntRect & | Parms, | ||
| const FLinearColor & | Color | ||
| ) |
Draws a subtitle at the specified pixel location.
| void FSubtitleManager::DisplaySubtitles | ( | FCanvas * | InCanvas, |
| FIntRect & | SubtitleRegion, | ||
| float | InAudioTimeSeconds | ||
| ) |
Display the currently queued subtitles and cleanup after they have finished rendering.
| Canvas | Where to render the subtitles. |
| CurrentTime | Current world time. |
Find the highest priority subtitle from the list of currently active ones.
| CurrentTime | The time at which to find the subtitle. |
|
inline |
Get the height of currently rendered subtitles.
|
static |
Get the subtitle manager singleton instance.
|
inline |
Whether there are any active subtitles.
Kill specified subtitles.
| SubtitleId | Identifier of the subtitles to kill. |
|
inline |
HACK: Returns the delegate for setting subtitle text
|
static |
| void FSubtitleManager::QueueSubtitles | ( | PTRINT | SubtitleID, |
| float | Priority, | ||
| bool | bManualWordWrap, | ||
| bool | bSingleLine, | ||
| float | SoundDuration, | ||
| const TArray< FSubtitleCue > & | Subtitles, | ||
| float | InStartTime, | ||
| float | InCurrentTime | ||
| ) |
Add an array of subtitles to the active list
| SubTitleID | The controlling id that groups sets of subtitles together. |
| Priority | Used to prioritize subtitles; higher values have higher priority. Subtitles with a priority 0.0f are not displayed. |
| StartTime | Time at which the subtitles start (in seconds). |
| SoundDuration | Time after which the subtitles do not display (in seconds). |
| Subtitles | Collection of lines of subtitle and time offset to play them. |
| void FSubtitleManager::SetMovieSubtitle | ( | UObject * | SubtitleOwner, |
| const TArray< FString > & | Subtitles | ||
| ) |
HACK: Accept a movie subtitle and display it to all currently registered displays. This will not work with the old Canvas drawing system.
| SubtitleOwner | The owner of the movie subtitle. If this is null, the subtitle will not be set |
| MovieSubtitles | The subtitle text to display to all currently active displays |
If any of the active subtitles need to be split into multiple lines, do so now.
Note: This assumes the width of the subtitle region does not change while the subtitle is active.
Trim the SubtitleRegion to the safe 80% of the canvas.
| Canvas | The canvas to trim to. |
| InOutSubtitleRegion | The trim region. |