跳轉到主要內容

StringVisuals

touchgfx/lcd/LCD.hpp

The visual elements when writing a string.

Public Functions

StringVisuals()
Initializes a new instance of the LCD class.
StringVisuals(const Font * svFont, colortype svColor, uint8_t svAlpha, Alignment svAlignment, int16_t svLinespace, TextRotation svRotation, TextDirection svTextDirection, uint8_t svIndentation, WideTextAction svWideTextAction =WIDE_TEXT_NONE)
Construct a StringVisual object for rendering text.

Public Attributes

Alignmentalignment
The alignment to use. Default is LEFT.
uint8_talpha
8-bit alpha value. Default is 255 (solid).
colortypecolor
RGB color value. Default is 0 (black).
const Font *font
The font to use.
uint8_tindentation
Indentation of text inside rectangle. Text will start this far from the left/right edge.
int16_tlinespace
Line space in pixels for multiline strings. Default is 0.
TextRotationrotation
Orientation (rotation) of the text. Default is TEXT_ROTATE_0.
TextDirectiontextDirection
The direction to use. Default is LTR.
WideTextActionwideTextAction
What to do with wide text lines.

Public Functions Documentation

StringVisuals

Initializes a new instance of the LCD class.

StringVisuals

StringVisuals(const Font *svFont ,
colortypesvColor ,
uint8_tsvAlpha ,
AlignmentsvAlignment ,
int16_tsvLinespace ,
TextRotationsvRotation ,
TextDirectionsvTextDirection ,
uint8_tsvIndentation ,
WideTextActionsvWideTextAction =WIDE_TEXT_NONE
)

Construct a StringVisual object for rendering text.

Parameters:
svFontThe Font with which to draw the text.
svColorThe color with which to draw the text.
svAlphaAlpha blending. Default value is 255 (solid)
svAlignmentHow to align the text.
svLinespaceLine space in pixels between each line, in case the text contains newline characters.
svRotationHow to rotate the text.
svTextDirectionThe text direction.
svIndentationThe indentation of the text from the left and right of the text area rectangle.
svWideTextAction(Optional) What to do with lines longer than the width of the TextArea.

Public Attributes Documentation

alignment

Alignment alignment

The alignment to use. Default is LEFT.

alpha

uint8_t alpha

8-bit alpha value. Default is 255 (solid).

color

colortype color

RGB color value. Default is 0 (black).

font

const Font * font

The font to use.

indentation

uint8_t indentation

Indentation of text inside rectangle. Text will start this far from the left/right edge.

linespace

int16_t linespace

Line space in pixels for multiline strings. Default is 0.

rotation

TextRotation rotation

Orientation (rotation) of the text. Default is TEXT_ROTATE_0.

textDirection

TextDirection textDirection

The direction to use. Default is LTR.

wideTextAction

WideTextAction wideTextAction

What to do with wide text lines.