Navigation
Unreal Engine C++ API Reference > Runtime > Engine
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Public/CanvasTypes.h |
Include | #include "CanvasTypes.h" |
Syntax
class FCanvas
Remarks
Encapsulates the canvas state.
Variables
Type | Name | Description | |
---|---|---|---|
float | AlphaModulate | ||
int32 | LastElementIndex | Store index of last Element off to avoid semi expensive Find() | |
TMap< int32, int32 > | SortedElementLookupMap | Map from sortkey to array index of SortedElements for faster lookup of existing entries | |
TArray< FCanvasSortElement > | SortedElements | Batched canvas elements to be sorted for rendering. Sort order is back-to-front | |
TSharedPtr< FCanvasWordWrapper > | WordWrapper | Private class for handling word wrapping behavior. |
Constructors
Type | Name | Description | |
---|---|---|---|
FCanvas
(
FRenderTarget* InRenderTarget, |
Constructor. For situations where a world is not available, but time information is | ||
FCanvas
(
FRenderTarget* InRenderTarget, |
Constructor. | ||
FORCEINLINE_DEBUGGABLE | FCanvas
(
FRenderTarget* InRenderTarget, |
Destructors
Type | Name | Description | |
---|---|---|---|
~FCanvas () |
Destructor. |
Functions
Type | Name | Description | |
---|---|---|---|
void | AddTileRenderItem
(
float X, |
Generates a new FCanvasTileRendererItem for the current sortkey and adds it to the sortelement list of items to render | |
void | AddTriangleRenderItem
(
const FCanvasUVTri& Tri, |
Generates a new FCanvasTriangleRendererItem for the current sortkey and adds it to the sortelement list of items to render | |
ESimpleElementBlendMode | BlendToSimpleElementBlend
(
EBlendMode BlendMode |
Translate EBlendMode into ESimpleElementBlendMode used by tiles | |
FMatrix | CalcBaseTransform2D
(
uint32 ViewSizeX, |
Generate a 2D projection for the canvas. | |
FMatrix | CalcBaseTransform3D
(
uint32 ViewSizeX, |
Generate a 3D projection for the canvas. Use this if you want to transform in 3D | |
FMatrix | CalcProjectionMatrix
(
uint32 ViewSizeX, |
Generate a projection matrix for the canvas. Used for CalcBaseTransform3D | |
FMatrix | CalcViewMatrix
(
uint32 ViewSizeX, |
Generate a view matrix for the canvas. Used for CalcBaseTransform3D | |
void | Clear
(
const FLinearColor& Color |
Clear the canvas | |
void | Clear the list of dirty batches that need to be rendered by the canvas | ||
void | CopyTransformStack
(
const FCanvas& Copy |
Copy the conents of the TransformStack from an existing canvas | |
FCanvas * | Create
(
FRDGBuilder& GraphBuilder, |
||
FORCEINLINE_DEBUGGABLEFCanvas * | Create
(
FRDGBuilder& GraphBuilder, |
||
void | DrawItem
(
FCanvasItem& Item |
Draw a CanvasItem | |
void | DrawItem
(
FCanvasItem& Item, |
Draw a CanvasItem at the given coordinates | |
void | DrawItem
(
FCanvasItem& Item, |
Draw a CanvasItem at the given coordinates | |
void | |||
int32 | DrawShadowedString
(
double StartX, |
Draw an string centered on given location. | |
int32 | DrawShadowedText
(
double StartX, |
||
void | DrawTile
(
double X, |
||
void | DrawTile
(
double X, |
Draw arbitrary aligned rectangle. | |
void | Flush_GameThread
(
bool bForce |
Sends a message to the rendering thread to draw the batched elements. | |
void | Flush_RenderThread
(
FRHICommandListImmediate& RHICmdList, |
Sends a message to the rendering thread to draw the batched elements. | |
void | Flush_RenderThread
(
FRDGBuilder& GraphBuilder, |
||
uint32 | Accessor for allowed canvas modes | ||
FBatchedElements * | GetBatchedElements
(
EElementType InElementType, |
Returns a FBatchedElements pointer to be used for adding vertices and primitives for rendering. | |
const FMatrix & | Get the bottom-most element of the transform stack. | ||
float | |||
float | |||
float | |||
float | GetDPIScale () |
||
ERHIFeatureLevel::Type | Access current feature level | ||
const FMatrix & | Get the current top-most transform entry | ||
FHitProxyConsumer * | |||
FHitProxyId | |||
FIntPoint | |||
FRenderTarget * | Get the current render target for the canvas | ||
FSceneInterface * | GetScene () |
||
EShaderPlatform | Access current shader platform | ||
FCanvasSortElement & | GetSortElement
(
int32 DepthSortKey |
Get the sort element for the given sort key. Allocates a new entry if one does not exist | |
const FGameTime & | GetTime () |
Access gameplay time | |
FMatrix | GetTransform () |
Get the current top-most transform entry without the canvas projection | |
const TArray< FTransformEntry > & | Returns the transform stack | ||
const FIntRect & | GetViewRect () |
||
bool | Determine if the canvas has dirty batches that need to be rendered | ||
bool | IsHitTesting () |
||
bool | |||
bool | |||
bool | |||
int32 | Pop sort key off of the stack. | ||
void | PopTransform () |
Removes the top transform from the canvas's transform stack. | |
void | PushAbsoluteTransform
(
const FMatrix& Transform |
Pushes a transform onto the canvas's transform stack. | |
void | PushDepthSortKey
(
int32 InSortKey |
Push sort key onto the stack. Rendering is done with the current sort key stack entry. | |
void | PushRelativeTransform
(
const FMatrix& Transform |
Pushes a transform onto the canvas's transform stack, multiplying it with the current top of the stack. | |
void | SetAllowedModes
(
uint32 InAllowedModes |
Toggle allowed canvas modes | |
void | SetBaseTransform
(
const FMatrix& Transform |
Replace the base (ie. TransformStack(0)) transform for the canvas with the given matrix | |
void | SetHitProxy
(
HHitProxy* HitProxy |
Sets the hit proxy which will be used for subsequent canvas primitives. | |
void | SetParentCanvasSize
(
FIntPoint InParentSize |
||
void | SetRenderTarget_GameThread
(
FRenderTarget* NewRenderTarget |
Sets the render target which will be used for subsequent canvas primitives. | |
void | SetRenderTargetDirty
(
bool bDirty |
Marks render target as dirty so that it will be resolved to texture | |
void | SetRenderTargetRect
(
const FIntRect& ViewRect |
Sets a rect that should be used to offset rendering into the viewport render target If not set the canvas will render to the full target | |
void | SetRenderTargetScissorRect
(
const FIntRect& ScissorRect |
The clipping rectangle used when rendering this canvas | |
void | SetScaledToRenderTarget
(
bool bScale |
||
void | SetStereoRendering
(
bool bStereo |
||
void | SetUseInternalTexture
(
const bool bInUseInternalTexture |
||
int32 | Return top sort key of the stack. | ||
void | WrapString
(
FTextSizingParameters& Parameters, |
Classes
Type | Name | Description | |
---|---|---|---|
FCanvasSortElement | Contains all of the batched elements that need to be rendered at a certain depth sort key | ||
FTransformEntry | Entry for the transform stack which stores a matrix and its CRC for faster comparisons |
Enums
Type | Name | Description | |
---|---|---|---|
ECanvasAllowModes | Enum for canvas features that are allowed | ||
ECanvasDrawMode | |||
EElementType | Enum that describes what type of element we are currently batching. |