Show / Hide Table of Contents

Class CanvasRenderTarget2D

CanvasRenderTarget2D is 2D render target which exposes a Canvas interface to allow you to draw elements onto it directly.

Inheritance
System.Object
UObject
Texture
TextureRenderTarget
TextureRenderTarget2D
CanvasRenderTarget2D
Inherited Members
TextureRenderTarget2D.SizeX
TextureRenderTarget2D.SizeY
TextureRenderTarget2D.ClearColor
TextureRenderTarget2D.AddressX
TextureRenderTarget2D.AddressY
TextureRenderTarget2D.bForceLinearGamma
TextureRenderTarget2D.bGPUSharedFlag
TextureRenderTarget2D.bAutoGenerateMips
TextureRenderTarget2D.RenderTargetFormat
TextureRenderTarget2D.OverrideFormat
TextureRenderTarget.TargetGamma
Texture.Source
Texture.LightingGuid
Texture.AssetImportData
Texture.AdjustBrightness
Texture.AdjustBrightnessCurve
Texture.AdjustVibrance
Texture.AdjustSaturation
Texture.AdjustRGBCurve
Texture.AdjustHue
Texture.AdjustMinAlpha
Texture.AdjustMaxAlpha
Texture.CompressionNoAlpha
Texture.CompressionNone
Texture.DeferCompression
Texture.MaxTextureSize
Texture.CompressionQuality
Texture.bDitherMipMapAlpha
Texture.AlphaCoverageThresholds
Texture.bPreserveBorder
Texture.bFlipGreenChannel
Texture.bForcePVRTC4
Texture.PowerOfTwoMode
Texture.PaddingColor
Texture.bChromaKeyTexture
Texture.ChromaKeyThreshold
Texture.ChromaKeyColor
Texture.MipGenSettings
Texture.CompositeTexture
Texture.CompositeTextureMode
Texture.CompositePower
Texture.LODBias
Texture.NumCinematicMipLevels
Texture.CompressionSettings
Texture.Filter
Texture.LODGroup
Texture.SRGB
Texture.bUseLegacyGamma
Texture.NeverStream
Texture.bNoTiling
Texture.bUseCinematicMipLevels
Texture.bAsyncResourceReleaseHasBeenStarted
Texture.CachedCombinedLODBias
Texture.AssetUserData
UObject.TransientPackage
UObject.CastTo<T>(UObject)
UObject.CastTo(UObject, Type)
UObject.RemoveObject(UObject)
UObject.MakeObjectArrayField<T>(NativeArray*)
UObject.NotImplemented<T>()
UObject.Construct()
UObject.GetHashCode()
UObject.GetName()
UObject.ToString()
UObject.Name
UObject._None
UObject.None
UObject.ObjPointer
UObject.LoadObjectFromClass(Class, UObject, String, String, LoadFlags, PackageMap, Boolean)
UObject.LoadClass(Class, UObject, String, String, LoadFlags, PackageMap)
UObject.GetPropertyFor<T>(Name)
UObject.ExecuteUbergraph
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: UE4.Engine
Assembly: UE4DotNet.dll
Syntax
public class CanvasRenderTarget2D : TextureRenderTarget2D
Remarks

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.

Properties

| Improve this Doc View Source

bShouldClearRenderTargetOnReceiveUpdate

Declaration
public bool bShouldClearRenderTargetOnReceiveUpdate { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

DefaultObject

Get UE4 Default Object for this Class

Declaration
public static CanvasRenderTarget2D DefaultObject { get; }
Property Value
Type Description
CanvasRenderTarget2D
| Improve this Doc View Source

StaticClass

Get UE4 Class

Declaration
public static Class StaticClass { get; }
Property Value
Type Description
Class

Methods

| Improve this Doc View Source

CreateCanvasRenderTarget2D(UObject, SubclassOf<CanvasRenderTarget2D>, Int32, Int32)

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

Declaration
public static CanvasRenderTarget2D CreateCanvasRenderTarget2D(UObject WorldContextObject, SubclassOf<CanvasRenderTarget2D> CanvasRenderTarget2DClass, int Width, int Height)
Parameters
Type Name Description
UObject WorldContextObject
SubclassOf<CanvasRenderTarget2D> CanvasRenderTarget2DClass
System.Int32 Width
System.Int32 Height
Returns
Type Description
CanvasRenderTarget2D
Remarks

param WorldContextObject The world where this render target will be rendered for @param CanvasRenderTarget2DClass Class of the render target. Unless you want to use a special sub-class, you can simply pass UCanvasRenderTarget2D::StaticClass() here. @param Width Width of the render target. @param Height Height of the render target.

@return Returns the instanced render target.

| Improve this Doc View Source

GetSize()

Gets a specific render target's size from the global map of canvas render targets.

Declaration
public (int, int) GetSize()
Returns
Type Description
System.ValueTuple<System.Int32, System.Int32>
Remarks

@param Width Output variable for the render target's width @param Height Output variable for the render target's height

| Improve this Doc View Source

New(UObject, Name)

Spawn an object of this class

Declaration
public static CanvasRenderTarget2D New(UObject obj = null, Name name = default(Name))
Parameters
Type Name Description
UObject obj
Name name
Returns
Type Description
CanvasRenderTarget2D
| Improve this Doc View Source

UpdateResource()

Updates the the canvas render target texture's resource.

Declaration
public void UpdateResource()
Remarks

This is where the render target will create or find a canvas object to use. It also calls UpdateResourceImmediate() to clear the render target texture from the deferred rendering list, to stop the texture from being cleared the next frame. From there it will ask the rendering thread to set up the RHI viewport. The canvas is then set up for rendering and then the user's update delegate is called. The canvas is then flushed and the RHI resolves the texture to make it available for rendering.

Events

| Improve this Doc View Source

ReceiveUpdate

Allows a Blueprint to implement how this Canvas Render Target 2D should be updated.

Declaration
public event CanvasRenderTarget2D.ReceiveUpdate_delegate ReceiveUpdate
Event Type
Type Description
CanvasRenderTarget2D.ReceiveUpdate_delegate
Remarks

@param Canvas Canvas object that can be used to paint to the render target @param Width Width of the render target. @param Height Height of the render target.

Operators

| Improve this Doc View Source

Implicit(IntPtr to CanvasRenderTarget2D)

Convert from IntPtr to UObject

Declaration
public static implicit operator CanvasRenderTarget2D(IntPtr p)
Parameters
Type Name Description
System.IntPtr p
Returns
Type Description
CanvasRenderTarget2D
  • Improve this Doc
  • View Source
Back to top Generated by DocFX