SRetainerWidget

The [SRetainerWidget](API\Runtime\UMG\Slate\SRetainerWidget) renders children widgets to a render target first before later rendering that render target to the screen.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

UMG

Header

/Engine/Source/Runtime/UMG/Public/Slate/SRetainerWidget.h

Include

#include "Slate/SRetainerWidget.h"

Syntax

class SRetainerWidget :
    public SCompoundWidget,
    public FSlateInvalidationRoot

Remarks

The SRetainerWidget renders children widgets to a render target first before later rendering that render target to the screen. This allows both frequency and phase to be controlled so that the UI can actually render less often than the frequency of the main game render. It also has the side benefit of allow materials to be applied to the render target after drawing the widgets to apply a simple post process.

Constructors

Name Description

Public function

SRetainerWidget()

Destructors

Name Description

Public function

~SRetainerWidget()

Functions

Name Description

Public function

void

 

Construct

(
    const FArguments& Args
)

Constructor

Public function Const

UMaterialIns...

 

GetEffectMaterial()

Protected function Const

bool

 

IsAnythingVisibleToRender()

Protected function

void

 

OnRetainerModeChanged()

Protected function

EPaintRetain...

 

PaintRetainedContentImpl

(
    const FSlateInvalidationContext& C...,
    const FGeometry& AllottedGeometry,
    int32 LayerId
)

Protected function

void

 

RefreshRenderingMode()

Public function

void

 

RequestRender()

Requests that the retainer redraw the hosted content next time it's painted.

Public function

void

 

SetContent

(
    const TSharedRef< SWidget >& InCon...
)

Public function

void

 

SetEffectMaterial

(
    UMaterialInterface* EffectMate...
)

Public function

void

 

SetRenderingPhase

(
    int32 Phase,
    int32 PhaseCount
)

Public function

void

 

SetRetainedRendering

(
    bool bRetainRendering
)

Public function

void

 

SetTextureParameter

(
    FName TextureParameter
)

Public function

void

 

SetWorld

(
    UWorld* World
)

Protected function Const

bool

 

ShouldBeRenderingOffscreen()

Overridden from SWidget

Name Description

Protected function Virtual Const

const FSlate...

 

Advanced_AsInvalidationRoot()

Protected function Virtual Const

bool

 

Advanced_IsInvalidationRoot()

Protected function Virtual Const

FVector2D

 

ComputeDesiredSize

(
    float LayoutScaleMultiplier
)

Compute the ideal size necessary to display this widget.

Protected function Virtual

bool

 

CustomPrepass

(
    float LayoutScaleMultiplier
)

Public function Virtual

FChildren &#...

 

Debug_GetChildrenForReflector()

Returns all Widgets, including widget hidden from the invalidation system.

Public function Virtual

FChildren &#...

 

GetChildren()

Returns the useful children (if any) of this widget.

Protected function Virtual Const

int32

 

OnPaint

(
    const FPaintArgs& Args,
    const FGeometry& AllottedGeometry,
    const FSlateRect& MyCullingRect,
    FSlateWindowElementList& OutDrawEl...,
    int32 LayerId,
    const FWidgetStyle& InWidgetStyle,
    bool bParentEnabled
)

SCompoundWidget interface

Overridden from FSlateInvalidationRoot

Classes

Name

Description

Public struct

FArguments

Enums

Name

Description

Protected enum

EPaintRetainedContentResult

Constants