STextBlock::OnPaint

Overwritten from [SWidget](API\Runtime\SlateCore\Widgets\SWidget).

Choose your operating system:

Windows

macOS

Linux

Override Hierarchy

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Widgets/Text/STextBlock.h

Include

#include "Widgets/Text/STextBlock.h"

Source

/Engine/Source/Runtime/Slate/Private/Widgets/Text/STextBlock.cpp

Syntax

virtual int32 OnPaint
(
    const FPaintArgs & Args,
    const FGeometry & AllottedGeometry,
    const FSlateRect & MyCullingRect,
    FSlateWindowElementList & OutDrawElements,
    int32 LayerId,
    const FWidgetStyle & InWidgetStyle,
    bool bParentEnabled
) const

Remarks

Overwritten from SWidget.

LeafWidgets provide a visual representation of themselves. They do so by adding DrawElement(s) to the OutDrawElements. DrawElements should have their positions set to absolute coordinates in Window space; for this purpose the Slate system provides the AllottedGeometry parameter. AllottedGeometry describes the space allocated for the visualization of this widget.

Whenever possible, LeafWidgets should avoid dealing with layout properties. See TextBlock for an example.