Skip to content

TSdlTtfRendererTextEngine

A text engine for drawing text on an SDL renderer.

Definition

Unit: Neslib.Sdl3.Ttf

type TSdlTtfRendererTextEngine = class(TSdlTtfTextEngine) ... end

Inheritance

Inherits: TSdlTtfTextEngine

See Also

Constructors

Name Description
Create(TSdlProperties) Create a text engine for drawing text on an SDL renderer, with the specified properties.
Create(TSdlRenderer) Create a text engine for drawing text on an SDL renderer.

Methods

Name Description
DestroyHandle
Draw(TSdlTtfText, TSdlPointF) Draw text to an SDL renderer.
Draw(TSdlTtfText, Single, Single) Draw text to an SDL renderer.

Constructor Descriptions

Create

Create a text engine for drawing text on an SDL renderer, with the specified properties.

These are the supported properties:

  • TSdlTtfProperty.RendererTextEngineRenderer: the renderer to use for creating textures and drawing text
  • TSdlTtfProperty.RendererTextAtlasTextureSize: the size of the texture atlas

constructor Create(const AProps: TSdlProperties); overload

Parameters

AProps: TSdlProperties : The properties to use.

Exceptions

ESdlError: Raised on failure.

Remarks

This constructor should be called on the thread that created the renderer.


Create

Create a text engine for drawing text on an SDL renderer.

constructor Create(const ARenderer: TSdlRenderer); overload

Parameters

ARenderer: TSdlRenderer : The renderer to use for creating textures and drawing text.

Exceptions

ESdlError: Raised on failure.

Remarks

This constructor should be called on the thread that created the renderer.


Method Descriptions

DestroyHandle

procedure DestroyHandle; override


Draw(TSdlTtfText, TSdlPointF)

Draw text to an SDL renderer.

AText must have been created using TSdlTtfRendererTextEngine and will draw using the renderer passed to its constructor.

procedure Draw(const AText: TSdlTtfText; const APosition: TSdlPointF); overload; inline

Exceptions

ESdlError: Raised on failure.

Parameters

AText: TSdlTtfText : The text to draw.

APosition: TSdlPointF : The coordinate in pixels, positive from the top-left edge towards the bottom-right.

Remarks

This function should be called on the thread that created the text.


Draw(TSdlTtfText, Single, Single)

Draw text to an SDL renderer.

AText must have been created using TSdlTtfRendererTextEngine and will draw using the renderer passed to its constructor.

procedure Draw(const AText: TSdlTtfText; const AX, AY: Single); overload; inline

Exceptions

ESdlError: Raised on failure.

Parameters

AText: TSdlTtfText : The text to draw.

AX: Single : The x coordinate in pixels, positive from the left edge towards the right.

AY: Single : The y coordinate in pixels, positive from the top edge towards the bottom.

Remarks

This function should be called on the thread that created the text.