Advertisement

bitmap font engine

Started by January 09, 2001 08:36 PM
1 comment, last by Valhalla 24 years ago
Hi all I am coding a game and want to be able to display such things as high score, player''s score, lives left etc. I plan on storing the numbers 0-9 as bitmaps and need some help on how I can "convert" the player''s score to a format that I can display using the prestored bitmap numbers. How are you guys displaying scores, lives left etc? I was going to somehow go thru the player''s score and go thru it from left to right and for each number in the score, use the corresponding bitmap image and the final image would be the sum result of this score. Make sense?! If there is a easier/better way, please point me in the right direction. Don
Donald Cathcart
I would just do that, but I would use itoa() in stdlib to convert the integer score into a character string. That will make getting the actual digits easier. Also if you have a font engine or something for writing text, all you have to do is send it your string.
Advertisement
just use sprintf to do the conversion, it's much easier.

  char text[20];sprintf(text, "%i", PlayerScore);   


that's about it...

--
david@neonstar.net
neonstar entertainment

Edited by - neonstar on January 9, 2001 10:28:24 PM
--david@neonstar.netneonstar entertainment

This topic is closed to new replies.

Advertisement