Subtitle manager. 更多...
#include <SubtitleManager.h>
Public 成员函数 | |
| void | DisplaySubtitle (FCanvas *Canvas, FActiveSubtitle *Subtitle, FIntRect &Parms, const FLinearColor &Color) |
| Draws a subtitle at the specified pixel location. | |
| ENGINE_API void | DisplaySubtitles (FCanvas *InCanvas, FIntRect &SubtitleRegion, float InAudioTimeSeconds) |
| Display the currently queued subtitles and cleanup after they have finished rendering. 更多... | |
| PTRINT | FindHighestPrioritySubtitle (float CurrentTime) |
| Find the highest priority subtitle from the list of currently active ones. 更多... | |
| float | GetCurrentSubtitlesHeight () |
| Get the height of currently rendered subtitles. 更多... | |
| bool | HasSubtitles () |
| Whether there are any active subtitles. 更多... | |
| void | KillAllSubtitles (void) |
| Kill all the subtitles. | |
| void | KillSubtitles (PTRINT SubtitleID) |
| Kill specified subtitles. 更多... | |
| ENGINE_API FSubtitleManagerSetSubtitleText & | OnSetSubtitleText () |
| HACK: Returns the delegate for setting subtitle text | |
| void | 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 更多... | |
| void ENGINE_API | SetMovieSubtitle (UObject *SubtitleOwner, const TArray< FString > &Subtitles) |
| HACK: Accept a movie subtitle and display it to all currently registered displays. 更多... | |
| void | SplitLinesToSafeZone (FCanvas *Canvas, FIntRect &SubtitleRegion) |
| If any of the active subtitles need to be split into multiple lines, do so now. 更多... | |
| void | TrimRegionToSafeZone (FCanvas *Canvas, FIntRect &InOutSubtitleRegion) |
| Trim the SubtitleRegion to the safe 80% of the canvas. 更多... | |
静态 Public 成员函数 | |
| static ENGINE_API FSubtitleManager * | GetSubtitleManager () |
| Get the subtitle manager singleton instance. 更多... | |
Subtitle manager.
Handles prioritization and rendering of subtitles.
| ENGINE_API 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. |
| PTRINT FSubtitleManager::FindHighestPrioritySubtitle | ( | float | CurrentTime | ) |
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.
| void FSubtitleManager::KillSubtitles | ( | PTRINT | SubtitleID | ) |
Kill specified subtitles.
| SubtitleId | Identifier of the subtitles to kill. |
| 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 ENGINE_API 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. |