🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

text...

Started by
0 comments, last by ViPeR007 24 years, 7 months ago
What would be a good way of displaying text on the screen (in the postition and colour you want) for a certain amount of time?

Example: I want to display "Weapon 1 Selected!!" for 7 seconds in the lower left corner.

Thanx,
ViPeR

Advertisement
you can either use the window's GDI function TextOut or you can write your own text function, which basically would just have an indexed array of all the letters and symbols in some sort of binary format. as for timing how long its shown for, you could have a small struct

struct msg
{
char *text, color;
unsigned short x, y;
unsigned short timeinit, length;
};

for each message on the screen (maybe a global expandable linked list) and each frame you would run through the list of current messages and compare timeinit to timeGetTime(), and if timeGetTime()-timinit > length, you remove that message from the list, otherwise you blit it onto your buffer at (x,y)
hope this helps

This topic is closed to new replies.

Advertisement