Hi all, A simple question I hope.... but how do you guys create your score, etc "images", i.e do you split the score up into individual chars and display a single 0..9 image for each char? Or use a particular font (somehow) and just do a simple printf? Or some other method? thanks Andy.
We've always used a proprietory text class that splits the score into individual character images (pulled in from a large texture image containing all characters). I think this way, you have most freedom to do nice effects like waves, pulses rotations etc. and also the style of the characters themselves can be easily changed in some paint package, rather than having a fixed constant colour.
Yeah, I have a loop that goes through and breaks it up into individual characters (not just scores and numbers, but all the text), convert these characters into numbers via their ASCII values, and use the results to index a set of graphics (the "bitmap font"). Pretty much par for the course I think.
We have a couple of methods, both use bitmaps as the character images. First method is having one image with all the characters on it. There's a seperate table which is a look up for each character and what uv position it is in the image. We then either skip the width of the image + a defined spacing amount (this way you can have overlapping fonts) or look up in another table for a character to character kerning. This way you can have A and W overlapping correctly but preserving other kerning. The other system is for bigger fonts. You might have a large score font and only need the numbers. For this the font load function takes a directory, in that are files like 0.png, 1.png, 2.png... a.png _a.png. etc. ( a and _a are the upper and lower case). I just run through the visible character set trying to load each image, if it fails ignore it. There's a couple of special cases for characters that you can't have as a file name, like a '.' is called fullstop and so on. Then display each character and move on by the width of the image. Take a look at Bitmap Font Builder . Handles converting your windows font to an image and can write out the uv's for you. You can then load your image into whatever paint package and touch it up.
Thanks all. And where do you guys normally get your groovy game fonts from? I came seem to find many that look funky enough. Although I must admit that I haven't looked too far into the paid web sites, just the free ones I can get hold of.
One thing I would like to mention... puh leeaaze use a fixed pitch font (or one with fixed pitch widths for the digits) for score or time. A wider score should be *always* bigger and I really really hate it if the digits are moving all over the place just because one of em changed. It looks so silly, distracting... busy for no reason. (fixed pitch=all characters have the same width) And fonts... there are many font sites. The pizzadude has a bunch of neat cartoony fonts. And there's also 1001fonts.com... and there are also some public domain fonts, but I hadn't found a matching font yet.
I either use my regular font class or a special digit only font class which was created specifically for scores. Its just a grid of bitmapped numbers and a littl routine to blt the right cells.