drawUIText

GraphicsModuleInterface::drawUIText

Draws text on the User Interface.

Declaration

virtual void drawUIText(FontID fontID, const std::wstring& text, AnchorPoint anchorPoint, CoordinateType coordinateType, const Math::vec2& position, float rotation, const Math::vec2& scale, const Math::vec4& color) = 0;

Parameters

Name

Type

Description

fontID

FontID

The font to use to draw the text.

text

const std::wstring&

The text to draw.

anchorPoint

AnchorPoint

The anchor point of the text.

coordinateType

CoordinateType

The coordinate type used by position.

position

const Math::vec2&

The position where the text will be drawn.

rotation

float

The rotation of the text.

scale

const Math::vec2&

The scale of the text.

color

const Math::vec4&

The color and opacity of the text.

Returns

None.

Notes

If text is directly written on the source code, the string literal “L” must be used, for example: L”NutshellEngine”.

If a scale’s axis (x or y) is negative, the text will be flipped. For example, if scale is equal to Math::vec2(-1.0f, 1.0f), the text will have its original proportion but will be flipped horizontally.