I thought i might explain it here since it wasn't really obvious to me and took me a while to figure out. Do note i only have tested the result using the sdk in windows since i don't have my dingoo yet. Here i go :
1) Writing text to the screen :
------------------------------------
It seems the font is defined in the basefont.sbn file, this file should be included in your directory where your game / app resides. So copy it over to the folder !
to actually write text to the screen do the following :
- init the S2D engine as usual and then use the following :
- Code: Select all
StringManager *Sm = new StringManager(); //create a string manager instance
Pixel *Color = new Pixel(255,255,255); // create a color for the text
VisString *String = new VisString("Some Text"); // create a visstring instance with some default text
Rect DrawRect; //coordinates where we will draw (the left & Top)
DrawRect.bottom = 240;
DrawRect.left = 50;
DrawRect.right = 320;
DrawRect.top = 50;
Sm->Init(English,""); // i'm not too sure what the 2nd parameter should hold but it could be the path where the basefont.sbn file is
Sm->SetVRAMPtr(g_pEng->m_pDraw2D->GetVRAMPtr(),320,240); //g_pEng is your Engine instance
Sm->DrawString(String,*Color,DrawRect); //Draw the string
2) Change The default font (/ generated new basefont.sbn file)
---------------------------------------------------------------------------
- goto the tools folder of the SDK you'll see a font.xml and a stringcompiler.exe file
- Right Click and drag the font.xml file onto the stringcompiler.exe file and choose "open with" if a context menu pops up.
- Next select your font settings and press ok.
- a new basefont.sbn will be generated
- copy the basefont.sbn file to your projects directory replacing the old one if you had already copied one over.
and you have your new font !!!
Pretty easy once you know how to use it !
cheers
willems davy
aka joyrider