I have been reworking PeeJays Bitmap Font routines for using more than one font, colors and scrolling messages

A short example how to use the library:

// First we add two fonts and put the font-id into variables  // We need to tell it the size of the grafic, the desired space   // between characters and what sprite-number to start   // importing at but only the first time. The routine expects the  // grafic to be 16x16 characters, if not you need to specify the size  big = AddFont("smallfont.png",  336, 368, 2, 1000)  small = AddFont("smallfont2.png", 160, 224, 1)    // Main color and alpha-mode of the text (r, g, b, font, alpha)  TextColor(128,255,128, big, 0)  TextColor(128,255,128, small, 0.7)    DrawText("This text is kerned.",0,50,TRUE)  DrawText("This text is not kerned.",0,80,FALSE)    WrapText("Sometimes we just want to be able to type long strings and not have to worry about when to stop - this is where word wrap comes in.",0,50,640,TRUE,2,big)    CentreText("This text is centralised on the screen",320,50,TRUE,2,big)    TextColor(0,0,255)  RightText("This text is right justified and blue",640,50,TRUE,2,big)    JustifyText("And finally, we have the ability to call a function to allow us to fully justify text. This allows for text to be displayed filling the entire area, and evenly spaced.",0,50,640,2,small)

This code is intended for GL Basic.

Download Bitmap Font Routines

Leave a Reply