GDI stuff, help!

Started by
3 comments, last by Landi 20 years, 6 months ago
I am nearly done my program in C++. I am using DirectDraw and have all of the bitmaps done. I am just wondering now how can I put regular text, not bitmap text but text like with texout or drawtext commands over the bitmap. also how would I do the same with shapes like rectangle, elipse etc. if anyone can help me please do, your help will be greatly appreciated. thanks
Advertisement
what I am trying to do is place the score over the bitmap so the player can see it as they progress, any ideas on how to make the score appear over the bitmap and have it update as the player goes on. well mostly the first part, I think I know how to update it. but how do you draw it!!

please help if you can

thanks
I''m not quite sure I understand the question. Wouldn''t drawtext work? Your first post makes it sound as though that''s not the kind of text output you''re expecting, neither would be drawing the text via a bitmap font. So.. yeah. Kinda confused.
<< what I am trying to do is place the score over the bitmap >>

If the bitmap is moving, you''ll have to move the score along with it if that''s what you mean. I''m displaying scores after a ghost gets eaten in my PacMan clone, so I just display the score in place of the bitmap for a few seconds using an int score_countdown starting at 300 or so and decremented 1 each frame so the score amount stays on the screen a few seconds. For a white score on black background....

int x,y,score;
char text[80]; // for display text output

SetTextColor(back_dc, RGB(255,255,255)); // white text color
SetBkColor(back_dc, RGB(0,0,0)); // black background

sprintf(text,"%d", score);
TextOut(back_dc, x, y, text, strlen(text));

Phil P

SetBkMode(hdc,TRANSPARENT);
TextOut(whatever);

[edited by - historycaesar on October 7, 2003 7:02:18 AM]

This topic is closed to new replies.

Advertisement