Advertisement

text...

Started by November 02, 1999 08:15 PM
0 comments, last by ViPeR007 25 years, 4 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

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