FCanvasTextItemBase

Base item used for drawing text

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/CanvasItem.h

Include

#include "CanvasItem.h"

Syntax

class FCanvasTextItemBase : public FCanvasItem

Remarks

Base item used for drawing text

Variables

Name Description

Protected variable

FBatchedElement...

 

BatchedElements

These are used by the DrawStringInternal function. Used for batching.

Public variable

bool

 

bCentreX

Centre the text in the viewport on horizontally.

Public variable

bool

 

bCentreY

Centre the text in the viewport on vertically.

Public variable

bool

 

bDontCorrectStereoscopic

Disables correction of font render issue when using stereoscopic display.

Public variable

bool

 

bOutlined

Draw an outline on the text.

Public variable

float

 

Depth

Depth sort key.

Public variable

FVector2D

 

DrawnSize

The size of the drawn text after the draw call.

Public variable

FFontRenderInfo

 

FontRenderInfo

Custom font render information.

Public variable

float

 

HorizSpacingAdjust

Horizontal spacing adjustment.

Public variable

FLinearColor

 

OutlineColor

The color of the outline.

Public variable

FVector2D

 

Scale

The scale of the text

Public variable

FLinearColor

 

ShadowColor

The color of the shadow

Public variable

FVector2D

 

ShadowOffset

The offset of the shadow.

Protected variable

FCanvasTileItem

 

TileItem

Background tile used to fixup 3d text issues.

Constructors

Name Description

Public function

FCanvasTextItemBase

(
    const FVector2D& InPosition,
    const FLinearColor& InColor
)

Functions

Name Description

Public function

void

 

DisableShadow()

Disable the shadow

Protected function

void

 

DrawStringInternal

(
    FCanvas* InCanvas,
    const FVector2D& DrawPos,
    const FLinearColor& DrawColor
)

Internal string draw

In a method to make it simpler to do effects like shadow, outline

Public function

void

 

EnableShadow

(
    const FLinearColor& InColor,
    const FVector2D& InOffset
)

Set the shadow offset and color.

Protected function Const

ESimpleEleme...

 

GetTextBlendMode

(
    const bool bHasShadow
)

Get the blend mode we should use to draw this text

Protected function Const

FVector2D

 

GetTextSize

(
    float DPIScale
)

Get the measured size of the text to draw

Protected function Const

bool

 

HasValidText()

Does this text item have valid text to draw?

Overridden from FCanvasItem

Name Description

Public function Virtual

void

 

Draw

(
    FCanvas* InCanvas
)

Draw the item at the given coordinates.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback