Package ilcd
Class Control

Public Method setTextAlignment

static void setTextAlignment(int mode, int width, int height)

Throws:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

Parameter Range Description
mode Bit 0 ... 7 alignment properties
width 0 ... display width (0 = full display) width of the alignment area
height 0 ... display height (0 = full display) height of the alignment area

This powerful method helps you to align text on the screen automatically. The next invocation of the methode Draw.writeText(String), Draw.writeTextMessage(int) or Control.getTextExtent(String) will align, word-wrap and crop text corresponding to the mode set by this method in the specified area. A maximum of 1024 characters and 48 text lines can be aligned. The mode consists of the following bits:

mode
TEXT_CENTER_HORIZONTALLY
TEXT_CENTER_VERTICALLY
TEXT_RIGHT_JUSTIFY
TEXT_BOTTOM_JUSTIFY
TEXT_DO_NOT_WORD_WRAP
TEXT_ADD_HORIZONTAL_SPACE_OF_BORDER
TEXT_ADD_VERTICAL_SPACE_OF_BORDER
TEXT_TURN_ALIGNMENT_ON

Note

Example

Control.setTextAlignment(Control.TEXT_CENTER_HORIZONTALLY |
                         Control.TEXT_CENTER_VERTICALLY |
                         Control.TEXT_TURN_ALIGNMENT_ON,
                         200, 100);

This will set text alignment to center subsequently outputted text horizontally and vertically in an area of 200 pixels width and 100 pixels height.

See also:

Draw.writeText(String)
Draw.writeTextMessage(int)
Control.getTextExtent(String)
Attribute.setLineStyle(int)
Control.setFontsScaling(int)
ANSI Support