Home2L - C/C++ API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
Public Member Functions | List of all members
CTextSet Class Reference

Description

Typesetter for longer formatted texts.

Definition at line 663 of file ui_base.H.

#include "ui_base.H"

Public Member Functions

void Clear ()
 Clear everything.
 
void AddLines (const char *text, CTextFormat fmt, bool *retAbbreviated=NULL)
 Add text with a given format. If the 'maxHeight' parameter is set in 'fmt', the text is automatically abbreviated if it is too long. The value returned via '*retAbbreviated' indicates whether the text was abbreviated.
 
int GetHeight ()
 Accumulated height in pixels according to all previous AddLines() invocations.
 
SDL_Surface * Render (SDL_Surface *dst=NULL, SDL_Rect *dstRect=NULL)
 Render everything and return a new surface containing the text. More...
 

Member Function Documentation

◆ Render()

SDL_Surface * CTextSet::Render ( SDL_Surface *  dst = NULL,
SDL_Rect *  dstRect = NULL 
)

Render everything and return a new surface containing the text.

If 'dst' is NULL, a suitable surface is created, which needs to be free'd later. Its dimensions are set to those of 'dstRect' or, if 'dstRect' is NULL, to a minimum area required for the text. If 'dst' is not NULL, the text is painted into 'dst', and 'dst' is returned. 'dstRect' is (if not NULL) the sub-area inside 'dst' into which the text will be placed. In any case, text reflow and abbreviation is based on the settings in 'fmt' ('maxWidth', 'maxHeight'). Hence, these values in 'fmt' should not be larger than implied limits passed via 'dst'/'dstRect'.


The documentation for this class was generated from the following file: