drawTextAt

drawTextAt(text:  String;
           x1:    Real;
           y1:    Real;
           color: Integer);

The drawTextAt method of the Window class draws a text string on a form or control using the current values of the drawFont and drawTextAlign properties. If this method is not called from a paint event, set the autoRedraw property to true.

The drawTextAt property is not affected by the mode defined in the drawMode property.

The drawTextAt method parameters are listed in the following table.

Parameter Description
text Text string that is to be drawn
x1, y1 Horizontal and vertical positions for the text
color Color of the text

The way in which the text is drawn is determined by the value of the drawTextAlign property, as listed in the following table.

Window Class Constant Value Description
DrawTextAlign_Left 0 Left-aligned
DrawTextAlign_Right 1 Right-aligned
DrawTextAlign_Center 2 Center-aligned (centered)

The text is drawn in a single line, unless it has embedded carriage return characters within it. Each embedded carriage return character forces a new line for the remaining text.

The text always starts at the vertical point specified by the y1 parameter.