Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Engine
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UStreamableRenderAsset
- UTexture
- UTextureRenderTarget
- UTextureRenderTarget2D
- UCanvasRenderTarget2D
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/Engine/CanvasRenderTarget2D.h |
Include | #include "Engine/CanvasRenderTarget2D.h" |
Syntax
UCLASS (BlueprintType, Blueprintable, MinimalAPI)
class UCanvasRenderTarget2D : public UTextureRenderTarget2D
Remarks
CanvasRenderTarget2D is 2D render target which exposes a Canvas interface to allow you to draw elements onto it directly. Use CreateCanvasRenderTarget2D() to create a render target texture by unique name, then bind a function to the OnCanvasRenderTargetUpdate delegate which will be called when the render target is updated. If you need to repaint your canvas every single frame, simply call UpdateResource() on it from a Tick function. Also, remember to hold onto your new canvas render target with a reference so that it doesn't get garbage collected.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
bool | bShouldClearRenderTargetOnReceiveUpdate | If true, clear the render target to green whenever OnReceiveUpdate() is called. |
![]() ![]() ![]() ![]() |
FOnCanvasRenderTargetUpdate | OnCanvasRenderTargetUpdate | Called when this Canvas Render Target is asked to update its texture resource. |
![]() ![]() ![]() ![]() |
ETextureRenderTargetSampleCount | SampleCount | MSAA sample count. |
![]() ![]() |
TWeakObjectPtr< UWorld > | World | The world this render target will be used with |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UCanvasRenderTarget2D
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() ![]() |
UCanvasRenderTarget2D * | CreateCanvasRenderTarget2D
(
UObject* WorldContextObject, |
Creates a new canvas render target and initializes it to the specified dimensions |
![]() |
void | Don't delete the underlying resource if it already exists | |
![]() ![]() ![]() |
void | Gets a specific render target's size from the global map of canvas render targets. | |
![]() ![]() ![]() |
UWorld * | GetWorld () |
|
![]() |
void | ||
![]() ![]() ![]() |
void | ReceiveUpdate
(
UCanvas* Canvas, |
Allows a Blueprint to implement how this Canvas Render Target 2D should be updated. |
![]() |
void | ||
![]() ![]() ![]() |
void | SetSampleCount
(
ETextureRenderTargetSampleCount InSampleCount |
|
![]() |
void | SetShouldClearRenderTargetOnReceiveUpdate
(
bool bInShouldClearRenderTargetOnReceiveUpdate |
|
![]() ![]() |
bool |
Overridden from UTextureRenderTarget2D
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() ![]() ![]() |
ETextureRenderTargetSampleCount |
Overridden from UTexture
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() ![]() |
void | Updates the the canvas render target texture's resource. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
bool | CanEditChange
(
const FProperty* InProperty |
Called by the editor to query whether a property of this object is allowed to be modified. |
![]() ![]() |
void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Called when a property on this object has been modified externally |