PA_Text.h

Go to the documentation of this file.
00001 #ifndef _PA_Text
00002 #define _PA_Text
00003 
00004 
00005 #define PA_InitCustomTextEx(screen, bg_select, tiles, map, pal) {\
00006    PAbgtext[screen] = bg_select;\
00007    PA_LoadSimpleBg(screen, bg_select, tiles, Blank, BG_256X256, 0, 1);\
00008    PA_LoadBgPal(screen, bg_select, (void*)pal);\
00009    PA_textmap[screen] = (u16*)map;PA_textpal[screen] = (u16*)pal;}
00010 
00011 
00018 //#include "../PA.h"
00019 #include "PA_Tile.h"
00020 
00021 #include "../../../lib/arm9/PA/Text/all_gfx.h" // Include the text !
00022 
00023 
00025 // Système pour le texte
00027 
00028 
00029 extern u16 textcol[2]; // Garde en mémoire la couleur du texte
00030 extern u8 PAbgtext[2];
00031 
00032 
00033 extern u16 *PA_textmap[2]; //Pointeur vers la map et les tiles...
00034 extern u8 *PA_texttiles[2];
00035 extern u16 *PA_textpal[2];
00036 
00037 extern s8 PA_font[2];  // 0 pour normal, 1 pour dégradé, -1 pour custom
00038 
00039 
00040 
00041 
00042 // Texte à taille variable
00043 #ifdef TEXT_ALLSIZES
00044        #include "text0.h" // La police à taille variable...
00045        #include "text1.h" // La police à taille variable...
00046        #include "text2.h" // La police à taille variable...
00047        #include "text3.h" // La police à taille variable...
00048        #include "text4.h" // La police à taille variable...
00049        extern const u8 *textData[5];
00050        extern const u8 policeheight[5];
00051        extern const u16 policewidth[5];
00052        extern const u8 policesize[5][256];       
00053 #endif
00054 
00055 
00056 typedef void(*letterfp)(u8 size, bool screen, u16 x, u16 y, char lettertemp, u8 color);
00057 
00058 
00059 
00060 
00061 extern letterfp letters[5];
00062 
00063 
00064 extern u8 PAtext_pal[2];
00065 
00066 
00067 
00068 
00069 
00089 void PA_InitText(bool screen, u8 bg_select);
00090 
00091 
00109 extern inline void PA_SetTileLetter(bool screen, u16 x, u16 y, char letter) {
00110        PA_SetMapTileAll(screen, PAbgtext[screen], x, y, PA_textmap[screen][(u16)letter] + (PAtext_pal[screen] << 12));
00111 }
00112 
00113 extern inline void PA_SetTextTileCol(bool screen, u8 color)
00114 {
00115        PAtext_pal[screen] = color;
00116 }
00117 
00118 
00119 
00120 
00138 void PA_OutputText(bool screen, u16 x, u16 y, char* text, ...);
00139 
00157 u16 PA_OutputSimpleText(bool screen, u16 x, u16 y, const char *text);
00158 
00185 u32 PA_BoxText(bool screen, u16 basex, u16 basey, u16 maxx, u16 maxy, const char *text, u32 limit);
00186 
00213 u32 PA_BoxTextNoWrap(bool screen, u16 basex, u16 basey, u16 maxx, u16 maxy, const char *text, u32 limit);
00214 
00215 
00234 void PA_SetTextCol(bool screen, u16 r, u16 g, u16 b);
00235 
00236 
00237 
00238 //void PA_InitCustomTextEx(bool screen, u8 bg_select, void *tiles, void *map, void *pal);
00239 
00240 
00257 #define PA_InitCustomText(screen, bg_select, text) PA_InitCustomTextEx(screen, bg_select, text##_Tiles, text##_Map, text##_Pal)
00258 
00268 #define PA_ShowFont(screen) PA_LoadBgMap(screen, PAbgtext[screen], (void*)PA_textmap[screen], BG_256X256)
00269 
00270 
00271 
00272 
00273 
00309 s16 PA_SmartText(bool screen, s16 basex, s16 basey, s16 maxx, s16 maxy, char* text, u8 color, u8 size, u8 transp,  s32 limit);
00310 
00311 
00312 
00345 s16 PA_CenterSmartText(bool screen, s16 basex, s16 basey, s16 maxx, s16 maxy, char* text, u8 color, u8 size, u8 transp);
00346 
00347 
00348 
00360 extern inline bool PA_CompareText(char *text1, char *text2){
00361        bool ok = 1; // Devrait etre bon
00362        u8 i = 0; 
00363        while(ok && text2[i]){
00364               if (text1[i] != text2[i]) ok = 0;
00365               i++;
00366        }
00367        return ok;
00368 }
00369 
00370 
00382 extern inline void PA_CopyText(char *text1, char *text2){
00383 u8 i = 0;
00384 text1[i] = text2[i];
00385        do{
00386               i++;
00387               text1[i] = text2[i];
00388        }
00389        while (text2[i]);
00390 }
00391 
00392 
00393 
00394 void PA_OutputTextSpecial0(bool screen, int x1, int y,char *text);
00395 void PA_OutputTextSpecial1(bool screen, int x1, int y,char *text);
00396 void PA_OutputTextSpecial2(bool screen, int x1, int y,char *text);
00397 void PA_OutputTextSpecial3(bool screen, int x1, int y,char *text);
00398 void PA_OutputTextSpecial4(bool screen, int x1, int y,char *text);
00399 void PA_OutputTextSpecial5(bool screen, int x1, int y,char *text);
00400  // end of Text
00402 
00403 
00404 
00405 #endif
00406 
00407 

Generated on Wed Dec 21 17:41:56 2005 for PAlib by  doxygen 1.3.9.1