Jump to content
  • Advertisement


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


energy display

This topic is 6939 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

There are many ways to do this. For a status bar I'd simply draw a box outline, then use blt to colorfill the statusbar as far as you need it to be filled.

Heres a DirectDraw example:


//assume the outline has already been drawn
DDBLTFX ddbltfx;
RECT StatusRect;
ZeroMemory( &ddbltfx, sizeof(ddbltfx) );
ddbltfx.dwSize = sizeof(ddbltfx);
ddbltfx.dwFillColor = color;

SetRect(&StatusRect, left, top, right, bottom);

lpBackBuffer->Blt(&StatusRect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx);

Hmm... I guess that isn't a great example, but the concept still applies. At least it shows how to do colorfills in directdraw .


Share this post

Link to post
Share on other sites
how do you make those little displays that show a units energy like units and buildings have in the C&C series? source code would be nice if anyone has it

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!