head 1.1; branch 1.1.1; access ; symbols start:1.1.1.1 PAlibDoc:1.1.1; locks ; strict; comment @# @; 1.1 date 2005.11.02.08.30.27; author jandujar; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2005.11.02.08.30.27; author jandujar; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @ PA_lib: Text output system

Text output system


Defines

#define PA_ShowFont(screen)   PA_LoadBgMap(screen, PAbgtext[screen], (void*)PA_textmap[screen], BG_256X256)
 Show the current font used. This is just for debug, no real use ingame

Functions

void PA_InitText (bool screen, u8 bg_select)
 Output text on the gba screen. Works only in modes 0-2
void PA_SetTileLetter (bool screen, u16 x, u16 y, char letter)
 Output a letter on the DS screen.
void PA_OutputText (bool screen, u16 x, u16 y, char *text,...)
 Output text on the DS screen. Works only in modes 0-2
u16 PA_OutputSimpleText (bool screen, u16 x, u16 y, const char *text)
 Output simple text on the DS screen. Works only in modes 0-2. Much faster than PA_OutputText, but much more limited... Returns the number of letters
u32 PA_BoxText (bool screen, u16 basex, u16 basey, u16 maxx, u16 maxy, const char *text, u32 limit)
 Output text on the DS screen. This text is limited to a chosen box, and you can chose the number of letters to output (can be used to show 'typed' text, just put 10000 if you want to show all the text...). Returns the number of letters outputed
u32 PA_BoxTextNoWrap (bool screen, u16 basex, u16 basey, u16 maxx, u16 maxy, const char *text, u32 limit)
 Output text on the DS screen. This text is limited to a chosen box, and you can chose the number of letters to output (can be used to show 'typed' text, just put 10000 if you want to show all the text...). Returns the number of letters outputed. This function does not support word wrapping
void PA_SetTextCol (bool screen, u8 r, u8 g, u8 b)
 Change the screen text's color (last color in the palette)
void PA_SetTextFont (bool screen, u8 font)
 Change the screen's font, using one of those given in PA_lib...
void PA_SetTextCustomFont (bool screen, void *tiles, void *map)
 Change the screen's font using a custom font
s16 PA_SmartText (bool screen, s16 basex, s16 basey, s16 maxx, s16 maxy, char *text, u8 color, u8 size, u8 transp, s32 limit)
 This is a variable width and variable size function to draw text on the screen. It draws on an 8 bit background (see PA_Init8bitBg for more info), and has options such as size, transaprency, and box limits, as well as the color. Only problem : it does not take commands such as d, etc... The function returns the number of characters it outputed
s16 PA_CenterSmartText (bool screen, s16 basex, s16 basey, s16 maxx, s16 maxy, char *text, u8 color, u8 size, u8 transp)
 Basicaly the same as the SmartText function, but this time centered...
bool PA_CompareText (char *text1, char *text2)
 Compare a string to a second. Example : PA_CompareText(Playname, "Mollusk");
void PA_CopyText (char *text1, char *text2)
 Copy one string into another

Detailed Description

Allows you to output text...

Define Documentation

#define PA_ShowFont screen   )     PA_LoadBgMap(screen, PAbgtext[screen], (void*)PA_textmap[screen], BG_256X256)
 

Show the current font used. This is just for debug, no real use ingame

Parameters:
screen Chose de screen (0 or 1)


Function Documentation

u32 PA_BoxText bool  screen,
u16  basex,
u16  basey,
u16  maxx,
u16  maxy,
const char *  text,
u32  limit
 

Output text on the DS screen. This text is limited to a chosen box, and you can chose the number of letters to output (can be used to show 'typed' text, just put 10000 if you want to show all the text...). Returns the number of letters outputed

Parameters:
screen Chose de screen (0 or 1)
basex X coordinate in TILES (0-31) where to begin writing the text
basey Y coordinate in TILES (0-19) where to begin writing the text
maxx X coordinate in TILES (0-31) where to stop writing the text
maxy Y coordinate in TILES (0-19) where to stop writing the text
text String to output.
limit Maximum number of letters to show this time

u32 PA_BoxTextNoWrap bool  screen,
u16  basex,
u16  basey,
u16  maxx,
u16  maxy,
const char *  text,
u32  limit
 

Output text on the DS screen. This text is limited to a chosen box, and you can chose the number of letters to output (can be used to show 'typed' text, just put 10000 if you want to show all the text...). Returns the number of letters outputed. This function does not support word wrapping

Parameters:
screen Chose de screen (0 or 1)
basex X coordinate in TILES (0-31) where to begin writing the text
basey Y coordinate in TILES (0-19) where to begin writing the text
maxx X coordinate in TILES (0-31) where to stop writing the text
maxy Y coordinate in TILES (0-19) where to stop writing the text
text String to output.
limit Maximum number of letters to show this time

s16 PA_CenterSmartText bool  screen,
s16  basex,
s16  basey,
s16  maxx,
s16  maxy,
char *  text,
u8  color,
u8  size,
u8  transp
 

Basicaly the same as the SmartText function, but this time centered...

Parameters:
screen Chose de screen (0 or 1)
basex X coordinate of the top left corner
basey Y coordinate of the top left corner
maxx X coordinate of the down right corner
maxy Y coordinate of the down right corner
text Text, such as "Hello World"
color Palette color to use (0-255)
size Size of the text, from 0 (really small) to 4 (pretty big)
transp Transparency. Setting this to 0 will overwrite all drawing in the text zone. 1 will write the text without erasing the drawing. 2 won't output anything (just to count the letters), 3 is rotated one way, 4 rotated the other way

inline bool PA_CompareText char *  text1,
char *  text2
[inline]
 

Compare a string to a second. Example : PA_CompareText(Playname, "Mollusk");

Parameters:
text1 First string
text2 Second string...

inline void PA_CopyText char *  text1,
char *  text2
[inline]
 

Copy one string into another

Parameters:
text1 String to change
text2 String to copy into the other

void PA_InitText bool  screen,
u8  bg_select
 

Output text on the gba screen. Works only in modes 0-2

Parameters:
screen Chose de screen (0 or 1)
bg_select Background number (0-3)

u16 PA_OutputSimpleText bool  screen,
u16  x,
u16  y,
const char *  text
 

Output simple text on the DS screen. Works only in modes 0-2. Much faster than PA_OutputText, but much more limited... Returns the number of letters

Parameters:
screen Chose de screen (0 or 1)
x X coordinate in TILES (0-31) where to begin writing the text
y Y coordinate in TILES (0-19) where to begin writing the text
text String to output.

void PA_OutputText bool  screen,
u16  x,
u16  y,
char *  text,
  ...
 

Output text on the DS screen. Works only in modes 0-2

Parameters:
screen Chose de screen (0 or 1)
x X coordinate in TILES (0-31) where to begin writing the text
y Y coordinate in TILES (0-19) where to begin writing the text
text String to output. The following commands are avaiblable : %s to output another string, %d to output a value, %fX to output a float with X digits, \n to go to the line. Here's an example : PA_OutputText(0, 0, 1, "My name is %s and I have only %d teeth", "Mollusk", 20);

void PA_SetTextCol bool  screen,
u8  r,
u8  g,
u8  b
 

Change the screen text's color (last color in the palette)

Parameters:
screen Chose de screen (0 or 1)
r Red amount (0-31)
g Green amount (0-31)
b Blue amount (0-31)

void PA_SetTextCustomFont bool  screen,
void *  tiles,
void *  map
 

Change the screen's font using a custom font

Parameters:
screen Chose de screen (0 or 1)
tiles Font tiles
map Font map

void PA_SetTextFont bool  screen,
u8  font
 

Change the screen's font, using one of those given in PA_lib...

Parameters:
screen Chose de screen (0 or 1)
font Font (0 for normal, 1 for 3 colored font)

inline void PA_SetTileLetter bool  screen,
u16  x,
u16  y,
char  letter
[inline]
 

Output a letter on the DS screen.

Parameters:
screen Chose de screen (0 or 1)
x X coordinate in TILES (0-31) where to write the letter
y Y coordinate in TILES (0-19) where to write the letter
letter Letter... 'a', 'Z', etc...

s16 PA_SmartText bool  screen,
s16  basex,
s16  basey,
s16  maxx,
s16  maxy,
char *  text,
u8  color,
u8  size,
u8  transp,
s32  limit
 

This is a variable width and variable size function to draw text on the screen. It draws on an 8 bit background (see PA_Init8bitBg for more info), and has options such as size, transaprency, and box limits, as well as the color. Only problem : it does not take commands such as d, etc... The function returns the number of characters it outputed

Parameters:
screen Chose de screen (0 or 1)
basex X coordinate of the top left corner
basey Y coordinate of the top left corner
maxx X coordinate of the down right corner
maxy Y coordinate of the down right corner
text Text, such as "Hello World"
color Palette color to use (0-255)
size Size of the text, from 0 (really small) to 4 (pretty big)
transp Transparency. Setting this to 0 will overwrite all drawing in the text zone. 1 will write the text without erasing the drawing. 2 won't output anything (just to count the letters), 3 is rotated one way, 4 rotated the other way
limit You can give a maximum number of characters to output. This can be usefull to have a slowing drawing text (allow to draw 1 more character each frame...)


Generated on Fri Oct 28 23:16:52 2005 for PA_lib by  doxygen 1.3.9.1
@ 1.1.1.1 log @Initial import of PalibDoc, begin on PAlib0.64b @ text @@