Choose your operating system:
Windows
macOS
Linux
| UObjectBase
|
Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/Engine/CanvasRenderTarget2D.h |
Include |
#include "Engine/CanvasRenderTarget2D.h" |
class UCanvasRenderTarget2D : public UTextureRenderTarget2D
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.
Name | Description | ||
---|---|---|---|
|
bShouldClearRenderTargetOnReceiveUpdate |
If true, clear the render target to green whenever OnReceiveUpdate() is called. |
|
|
OnCanvasRenderTargetUpdate |
Called when this Canvas Render Target is asked to update its texture resource. |
|
|
TWeakObjectPtr<... |
World |
The world this render target will be used with |
Name | Description | |
---|---|---|
|
UCanvasRenderTarget2D ( |
Name | Description | ||
---|---|---|---|
|
UCanvasRende... |
CreateCanvasRenderTarget2D ( |
Creates a new canvas render target and initializes it to the specified dimensions |
|
FastUpdateResource() |
Don't delete the underlying resource if it already exists |
|
|
GetSize |
Gets a specific render target's size from the global map of canvas render targets. |
|
|
UWorld * |
GetWorld() |
|
|
ReceiveUpdate |
Allows a Blueprint to implement how this Canvas Render Target 2D should be updated. |
|
|
RepaintCanvas() |
||
|
SetShouldClearRenderTargetOnReceiveUpdate ( |
||
|
ShouldClearRenderTargetOnReceiveUpdate() |
Name | Description | ||
---|---|---|---|
|
UpdateResource() |
Updates the the canvas render target texture's resource. |