TextAlign is used to tell the display class how to position a piece of text.
By default the coordinates you enter for the print*() functions take the upper left corner of the text as the "anchor" point. You can customize this behavior to, for example, make the coordinates refer to the center of the text.
All text alignments consist of an X and Y-coordinate alignment. For the alignment along the X-axis these options are allowed:
- LEFT (x-coordinate of anchor point is on left)
- CENTER_HORIZONTAL (x-coordinate of anchor point is in the horizontal center of the text)
- RIGHT (x-coordinate of anchor point is on right)
For the Y-Axis alignment these options are allowed:
- TOP (y-coordinate of anchor is on the top of the text)
- CENTER_VERTICAL (y-coordinate of anchor is in the vertical center of the text)
- BASELINE (y-coordinate of anchor is on the baseline of the text)
- BOTTOM (y-coordinate of anchor is on the bottom of the text)
These options are then combined to create combined TextAlignment options like:
- TOP_LEFT (default)
- CENTER (anchor point is in the middle of the text bounds)
- ...
Enumerator |
---|
TOP | |
CENTER_VERTICAL | |
BASELINE | |
BOTTOM | |
LEFT | |
CENTER_HORIZONTAL | |
RIGHT | |
TOP_LEFT | |
TOP_CENTER | |
TOP_RIGHT | |
CENTER_LEFT | |
CENTER | |
CENTER_RIGHT | |
BASELINE_LEFT | |
BASELINE_CENTER | |
BASELINE_RIGHT | |
BOTTOM_LEFT | |
BOTTOM_CENTER | |
BOTTOM_RIGHT | |
Definition at line 47 of file display.h.