UTextureRenderTarget2D::ConstructTexture2D

Utility for creating a new [UTexture2D](API\Runtime\Engine\Engine\UTexture2D) from a TextureRenderTarget2D TextureRenderTarget2D must be square and a power of two size.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/TextureRenderTarget2D.h

Include

#include "Engine/TextureRenderTarget2D.h"

Source

/Engine/Source/Runtime/Engine/Private/TextureRenderTarget2D.cpp

Syntax

UTexture2D * ConstructTexture2D
(
    UObject * InOuter,
    const FString & NewTexName,
    EObjectFlags InObjectFlags,
    uint32 Flags,
    TArray< uint8 > * AlphaOverride
)

Remarks

Utility for creating a new UTexture2D from a TextureRenderTarget2D TextureRenderTarget2D must be square and a power of two size.

Returns

New UTexture2D object.

Parameters

Parameter

Description

Outer

Outer to use when constructing the new Texture2D.

NewTexName

Name of new UTexture2D object.

ObjectFlags

Flags to apply to the new Texture2D object

Flags

Various control flags for operation (see EConstructTextureFlags)

AlphaOverride

If specified, the values here will become the alpha values in the resulting texture

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss