UCanvasRenderTarget2D::CreateCanvasRenderTarget2D

Creates a new canvas render target and initializes it to the specified dimensions

Choose your operating system:

Windows

macOS

Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/CanvasRenderTarget2D.h

Include

#include "Engine/CanvasRenderTarget2D.h"

Source

/Engine/Source/Runtime/Engine/Private/CanvasRenderTarget2D.cpp

Syntax

static UCanvasRenderTarget2D * CreateCanvasRenderTarget2D
(
    UObject * WorldContextObject,
    TSubclassOf< UCanvasRenderTarget2D > CanvasRenderTarget2DClass,
    int32 Width,
    int32 Height
)

Remarks

Creates a new canvas render target and initializes it to the specified dimensions

Returns

Returns the instanced render target.

Parameters

Parameter

Description

WorldContextObject

The world where this render target will be rendered for

CanvasRenderTarget2DClass

Class of the render target. Unless you want to use a special sub-class, you can simply pass UCanvasRenderTarget2D::StaticClass() here.

Width

Width of the render target.

Height

Height of the render target.