int TextAdd(int x, int y, char *text, int font);

 

Add a text label using the specified font.

 

Return Value

 

Returns an int handle to the text label.

 

Parameters

 

x

X coordinate.

 

y

Y coordinate.

 

text

Text to be added.

 

font

Font to be used.

 

Remarks

 

The TextAdd() function adds a text label at the specified x, y coordinates using the specified font. Use FontAdd() to initialize the desired font.  When TextAdd() uses a custom bitmap font, it allocates memory for the string displayed, including any future use of that display.  The size of the string provided to this call is the maximum size of any subsequent string passed to TextSetText().

 

The above behavior does not apply to TextAdd() when using a system font.  Any string value may be passed, up to 100 characters in length.

 

Availability

 

Available in DragonFireSDK 2.0 and later.

 

Example

 

Description: This program will load text images from folder name FontMedium, add "Hello" at 0, 0 using FontMedium and "Bye" at 100, 0 using FontMedium.

 

#include "DragonFireSDK.h"

 

void AppMain()

{

  FontMedium = FontAdd("FontMedium");

  TextAdd( 0, 0, "Hello", FontMedium);

  TextAdd(100, 0, "Bye",   FontMedium);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

 

}