Navigation
API > API/Runtime > API/Runtime/Engine
The Viewport Stats Subsystem offers the ability to add messages to the current viewport such as "LIGHTING NEEDS TO BE REBUILT" and "BLUEPRINT COMPILE ERROR".
Example usage:
if (UViewportStatsSubsystem* ViewportSubsystem = GetWorld()->GetSubsystem
// ... or use inline lambda functions ViewportSubsystem->AddDisplayDelegate([FText](API/Runtime/Core/FText)& OutText, [FLinearColor](API/Runtime/Core/FLinearColor)& OutColor { // Some kind of state management OutText = NSLOCTEXT("FooNamespace", "Blarg", "Display message here"); OutColor = FLinearColor::Red; return bShouldDisplay; }); }
| Name | UViewportStatsSubsystem |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/ViewportStatsSubsystem.h |
| Include Path | #include "Engine/ViewportStatsSubsystem.h" |
Syntax
UCLASS (Category="Viewport Stats Subsystem", MinimalAPI)
class UViewportStatsSubsystem : public UWorldSubsystem
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → USubsystem → UWorldSubsystem → UViewportStatsSubsystem
Structs
| Name | Remarks |
|---|---|
| FUniqueDisplayData |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 AddDisplayDelegate
(
FViewportDisplayCallback const& Delegate |
Add a dynamic delegate to the display subsystem. | Engine/ViewportStatsSubsystem.h |
|
int32 AddDisplayDelegate
(
FShouldDisplayFunc&& Callback |
Add a callback function to the display subsystem. | Engine/ViewportStatsSubsystem.h | |
void AddTimedDisplay
(
FText Text, |
Add a message to be displayed on the viewport of this world | Engine/ViewportStatsSubsystem.h |
|
| Draw the messages in this subsystem to the given viewport | Engine/ViewportStatsSubsystem.h | ||
void RemoveDisplayDelegate
(
const int32 IndexToRemove |
Remove a callback function from the display subsystem | Engine/ViewportStatsSubsystem.h |
|
Protected
Overridden from USubsystem
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void Deinitialize() |
Implement this for deinitialization of instances of the system | Engine/ViewportStatsSubsystem.h |