Class RetainerBox
The Retainer Box renders children widgets to a render target first before later rendering that render target to the screen.
Inherited Members
Namespace: UE4.UMG
Assembly: UE4DotNet.dll
Syntax
public class RetainerBox : ContentWidget
Remarks
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.
- Single Child
- Caching / Performance
Properties
| Improve this Doc View SourceDefaultObject
Get UE4 Default Object for this Class
Declaration
public static RetainerBox DefaultObject { get; }
Property Value
Type | Description |
---|---|
RetainerBox |
EffectMaterial
The effect to optionally apply to the render target.
Declaration
public MaterialInterface EffectMaterial { get; }
Property Value
Type | Description |
---|---|
MaterialInterface |
Remarks
We will set the texture sampler based on the name set in the @TextureParameter property.
If you want to adjust transparency of the final image, make sure you set Blend Mode to AlphaComposite (Pre-Multiplied Alpha) and make sure to multiply the alpha you're apply across the surface to the color and the alpha of the render target, otherwise you won't see the expected color.
Phase
The Phase this widget will draw on.
Declaration
public int Phase { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
If the Phase is 0, and the PhaseCount is 1, the widget will be drawn fresh every frame. If the Phase were 0, and the PhaseCount were 2, this retainer would draw a fresh frame every other frame. So in a 60Hz game, the UI would render at 30Hz.
PhaseCount
The PhaseCount controls how many phases are possible know what to modulus the current frame count by to determine if this is the current frame to draw the widget on.
Declaration
public int PhaseCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
If the Phase is 0, and the PhaseCount is 1, the widget will be drawn fresh every frame. If the Phase were 0, and the PhaseCount were 2, this retainer would draw a fresh frame every other frame. So in a 60Hz game, the UI would render at 30Hz.
RenderOnInvalidation
Declaration
public bool RenderOnInvalidation { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
RenderOnPhase
Declaration
public bool RenderOnPhase { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
StaticClass
Get UE4 Class
Declaration
public static Class StaticClass { get; }
Property Value
Type | Description |
---|---|
Class |
TextureParameter
The texture sampler parameter of the @EffectMaterial, that we'll set to the render target.
Declaration
public Name TextureParameter { get; }
Property Value
Type | Description |
---|---|
Name |
Methods
| Improve this Doc View SourceGetEffectMaterial()
Get the current dynamic effect material applied to the retainer box.
Declaration
public MaterialInstanceDynamic GetEffectMaterial()
Returns
Type | Description |
---|---|
MaterialInstanceDynamic |
New(UObject, Name)
Spawn an object of this class
Declaration
public static RetainerBox New(UObject obj = null, Name name = default(Name))
Parameters
Type | Name | Description |
---|---|---|
UObject | obj | |
Name | name |
Returns
Type | Description |
---|---|
RetainerBox |
RequestRender()
Requests the retainer redrawn the contents it has.
Declaration
public void RequestRender()
SetEffectMaterial(MaterialInterface)
Set a new effect material to the retainer widget.
Declaration
public void SetEffectMaterial(MaterialInterface EffectMaterial)
Parameters
Type | Name | Description |
---|---|---|
MaterialInterface | EffectMaterial |
SetRenderingPhase(Int32, Int32)
Requests the retainer redrawn the contents it has.
Declaration
public void SetRenderingPhase(int RenderPhase, int TotalPhases)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | RenderPhase | |
System.Int32 | TotalPhases |
SetTextureParameter(Name)
Sets the name of the texture parameter to set the render target to on the material.
Declaration
public void SetTextureParameter(Name TextureParameter)
Parameters
Type | Name | Description |
---|---|---|
Name | TextureParameter |
Operators
| Improve this Doc View SourceImplicit(IntPtr to RetainerBox)
Convert from IntPtr to UObject
Declaration
public static implicit operator RetainerBox(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | p |
Returns
Type | Description |
---|---|
RetainerBox |