Archived

This topic is now archived and is closed to further replies.

Landi

GDI stuff, help!

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
<< 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

Share this post


Link to post
Share on other sites