Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


energy display


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Matt   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 October 1999 - 03:14 PM

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


Sponsor:

#2 Facehat   Members   -  Reputation: 696

Like
Likes
Like

Posted 17 October 1999 - 03:14 PM

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:

code:

//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 .

--TheGoop





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS