I hereby introduce
my bitmap font class - CBFont, and availiable from my website.
Currently designed to work with FontMap Gen bitmaps, it needs to be tested with other bitmap fonts later on.
May also need to be optimised a bit more.
An example test program :
#include "DarkSDK.h"
#include "CBFont.hpp"
void DarkSDK(void)
{
CBFont test;
float scale;
dbSyncOn();
dbSyncRate(0);
test.charsStart(0);
if (test.loadFontFile("test.bmp",16,16)==false)
{
MessageBox(NULL,"Unable to load bitmap font","*Error*",MB_OK);
return;
}
test.setCharSet((float) 0.6);
if (test.createText("Hello World!",100,100,true)==false)
{
MessageBox(NULL,"Unable to generate fonts","*error*",MB_OK);
}
scale=0.0;
test.move((float) 0.0,(float) 100.0,0,1,(float) 0.0,(float) 0.01);
while (LoopSDK())
{
dbCLS(0);
dbText(0,0,dbStr(dbScreenFPS()));
if (dbEscapeKey()) return;
if (dbSpaceKey())
{
test.positionText((float) dbRnd(100),(float) dbRnd(100));
}
else
if (dbUpKey())
{
test.createText("1",200,300);
}
test.update(1.0);
dbSync();
}
}
Let me know if you find any bugs etc etc