Xbasic

TEXT Function

Syntax

OutputString as C = TEXT(C text,N XPos,N YPos[,C text_alignment])

Arguments

text

The text to draw on the bitmap.

XPos

The horizontal coordinate of the bitmap to use for alignment.

YPos

The vertical coordinate of the bitmap to use for alignment.

text_alignment

Optional. Default = "top-left". The point on the text to use for alignment. Possible values include one argument in the format "argument" or combinations of two arguments in the format "first_argument-second_argument".

First argument
Second argument
"top" - default

"left" - default

"center"

"center"

"bottom"

"right"

You may also use: "rotate" when you use a True Type font. See SET_ROTATE()-

>

Description

TEXT() draws the indicated Text at the specified coordinates.

Example

The following example displays the text "Sample" centered vertically and horizontally on the bitmap.

ui_bitmap_create("test", 4, 1)
ui_bitmap_draw("test",<<%code%
set_font("Verdana,20,biu", "blue", "white")
inner_Rect(0, 0, 4, 1)
text("Sample", bitmap_width("test")/2, bitmap_height("test")/2, "center")
%code%)
ui_dlg_box("","{image=test}")

Limitations

Used only in the Code sections of UI_BITMAP_DRAW(), UI_SCREEN_DRAW(), and UI_PRINTER_DRAW().

See Also