| UObjectBase
|
Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/Engine/ViewportStatsSubsystem.h |
Include |
#include "Engine/ViewportStatsSubsystem.h" |
class UViewportStatsSubsystem : public UWorldSubsystem
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<UViewportStatsSubsystem>()) { Bind a member function delegate to the subsystem... FViewportDisplayCallback Callback; Callback.BindDynamic(this, &UCustomClass::DisplayViewportMessage); ViewportSubsystem->AddDisplayDelegate(Callback);
... or use inline lambda functions ViewportSubsystem->AddDisplayDelegate([]([FText](API\Runtime\Core\Internationalization\FText)& OutText, FLinearColor & OutColor) { Some kind of state management OutText = NSLOCTEXT("FooNamespace", "Blarg", "Display message here"); OutColor = FLinearColor::Red; return bShouldDisplay; }); }
Name | Description | ||
---|---|---|---|
|
DisplayDelegates |
Array of delegates that will be displayed if they return true when evaluated |
|
|
UniqueDisplayMessages |
Array of unique one-off timed messages to display each frame no matter what |
Name | Description | ||
---|---|---|---|
|
AddDisplayDelegate ( |
Add a dynamic delegate to the display subsystem. |
|
|
AddDisplayDelegate ( |
Add a callback function to the display subsystem. |
|
|
AddTimedDisplay ( |
Add a message to be displayed on the viewport of this world |
|
|
Draw |
Draw the messages in this subsystem to the given viewport |
|
|
RemoveDisplayDelegate ( |
Remove a callback function from the display subsystem |
Name | Description | ||
---|---|---|---|
|
Deinitialize() |
Implement this for deinitialization of instances of the system |
Name |
Description |
|
---|---|---|
|
FUniqueDisplayData |