.printaligned Method

Function:

Print texts, on several lines if necessary, within a specified rectangular area.

Syntax:

lcd.printaligned(byref str as string, x as word, y as word, width as word, height as word) as byte

Returns:

Total number of text lines produced.

See Also:

Working With Text


Part

Description

str

Text to print.

x

X coordinate of the top-left corner of the text output. Value range is 0 to lcd.width - 1.

y

Y coordinate of the top-left corner of the text output. Value range is 0 to lcd.height - 1.

width

Width of the print area in pixels.

height

Height of the print area in pixels.


Details

For this method to work, a font must first be selected with the lcd.setfont method. The lcd.textalignment, lcd.textorientation, lcd.texthorizontalspacing, and lcd.textverticalspacing properties will affect how the text is printed.

This method breaks the text into lines to stay within the specified rectangular output area. Whenever possible, text is split without breaking up the words. A word will be split if it is wider than the width of the print area. You can add arbitrary line brakes by inserting ` (ASCII code 96).

The display panel must be enabled (lcd.enabled = 1 — YES) for this method to work.


.printaligned Method

Details