TEXT

 

SetFont

Sets the current drawing font. The font must be loaded with LoadFont

Usage:

SetFont font_variable

 

DeleteFont

Frees a font from memory. After that you can't use the same font variable again unless you load another font into it.

Usage:

DeleteFont font_variable

 

Text

Draws a text to the screen using the current drawing font and colour.

Usage:

Text X, Y, number/string

 

CenterText

Draws a text to the screen using the current drawing font and colour.

Usage:

Text X, Y, number/string [, centerOptions]

 

VerticalText

Draws a text to the screen, just like Text or CenterText. But vertically.

Usage:

VerticalText X, Y, number/string

 

Print

Draw text straight to the front buffer. We recommend using the Text-command instead. If parameter is omitted, an empty line will be drawn.

Usage:

Print [number/string]

 

Write

Works the same way as Print, but does not change line.

Usage:

Write [number/string]

 

Locate

Sets the position that the next text drawing command will at. Coordinates are provided as pixels.

Usage:

Locate X, Y

 

AddText

Adds a text permanently to the screen. This means you don't have to constantly re-draw it on each DrawScreen call. The static text can be erased with the ClearText-command. Utilize Locate to define text position.

Usage:

AddText Stri$

Example:

FrameLimit 40

Locate 30,30

AddText "This text is sticky and won't go away"

AddText "unless you use the Cleartext command."

AddText "Thank god, this demo features also that"

AddText "command."

AddText ""

Color 255,0,0

AddText "Press SPACE to clear the text."

plusx=2

plusy=2

Repeat

    'update the game itself

    x=x+plusx

    y=y+plusy   

    If x<0 Or x>400 Then plusx= -plusx

    If y<0 Or y>300 Then plusy= -plusy   

    Color Rand(255),Rand(255),Rand(255)

    Circle x-20,y-20,40   

    'clear the text?

    If KeyHit(cbkeyspace) Then ClearText

    DrawScreen

Until EscapeKey()

 

ClearText

Clears all static text added with the AddText-command.

 

LoadFont

Loads a truetype or raster font into memory. Apply the font with the SetFont-command. The font will be fetched from Windows\Fonts-directory. Don’t ever load anything within a loop!

Usage:

font_variable = LoadFont ("Name" [, size][, bold][, italic][, underline])

 

TextWidth

Tells how long the given string would be in printed form according to current font, in pixels.

Usage:

width = TextWidth(Stri$)

 

TextHeight

Tells how high the given string would be in printed form according to current font, in pixels.

Usage:

width = TextHeight(Stri$)