TheMan
Joined: 03 Jan 2006 Posts: 10
|
Posted: Sun May 07, 2006 7:56 am Post subject: Font Help |
|
|
Hey, earlier today I was looking into sort of porting over the LUA way of simple png font loading, but I've ran into a few problems. Maybe you guys can help. Currently, it runs, but the font doesn't get displayed.
The font part of the code is here, and the rest is at the rapidshare link.
| Code: | int char2Font(char char_input[255]) {
int indexNumber = 0;
int i;
for(i=0;i++;i<=strlen(inputString)) {
if (stricmp(inputString[i], char_input)==0) {
return indexNumber;
}
indexNumber = indexNumber + letterPixelsWide;
}
}
void blitChar(char text[255], int posX, int posY) {
blitAlphaImageToScreen(char2Font(text), 0, letterPixelsWide, letterPixelsTall, font, posX, posY);
}
void blitString(int posX, int posY, char text[255]) {
int incX = 0;
int i;
strupr(text);
for(i=0;i++;i<=strlen(text)) {
blitChar(text[i], posX + incX, posY);
incX = incX + letterPixelsWide;
}
} |
http://rapidshare.de/files/19803101/Font.zip.html
Thanks! |
|