CD3D Font - Always on top? & color

Started by
8 comments, last by 3Dgangsta 20 years, 2 months ago
I have displayed the font using CD3D but the text goes behind the objects. How can I make it to be always on top for like health, ammo etc.... And is thurr a list of colors anywhere on the web? Because I have no idea what they are except for 0xff000000 = white. Thanks a lot. -Rob
-Rob
Advertisement
here is how you figure out the colors
and 0xff000000 should not be white....it shoult be black actually

"0x" means it is a hex number
00 - first two places are for the color red
00 - second two places are for color green
00 - last two places are for color blue

00 - lowest value
ff - highest value

you know color ranges from 0 to 255 right ?

well 00 = 0 and ff = 255

it is just converting decimal numbers to binary numbers and then putting them in the right place in the color number

example

unsigned int color = 0;unsigned int alpha = 255;  // all visible or transparent i dont remember// just some random colorunsigned int red = 63;unsigned int green = 199;unsigned int blue = 0;// put alpha in correct placealpha = (alpha << 6);// put red in correct place using shiftsred = (red << 4);// put green in correct placegreen = (green << 2);// blue is already in correct place// OR them together to get the colorcolor = alpha | red | green | blue;



"A soldier is a part of the 1% of the population that keeps the other 99% free" - Lt. Colonel Todd, 1/38th Infantry, Ft. Benning, GA
ok thanks
-Rob
To generate those colors, look at the D3DCOLOR_ARGB or D3DCOLOR_XRGB macros. All you do is input the correct integer value (0-255) for A(alpha), R, G, and B. They work pretty much the same as the code ncsu gave.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
ok cool ill check it out.

Does anyone know how to fix the always on top problem?

-Rob
-Rob
Render all of the objects in your 3D world first, then render your frame stats on top of that.

neneboricua
Thank you very much!!

-Rob
-Rob
0x00000000
__A R G B

alpha red green blue, each one is trated as a hex pair 00 - ff if you dont know hex, the digits are.... 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f (jsut a note its not case sensitive and i actually prefer caps)

so... ff = 255
hex | decimal
00 = 0

01 = 1

10 = 16

20 = 32

40 = 64



uhhh.. hope that helped, if not, this may

[HexDigit1][HexDigit2]

decimal number = (HexDigit1 * 16) + HexDigit2
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
I see, but what if there is 3 numbers. Say 123, how whould you turn that into a decimal. Or can hexideciamls only be 2 digits. Thanks

-Rob
-Rob
123 = 0x7b

b = 11

((16^1) * 7 ) + ((16^0) * 11) = 123

Hope this helps

[edited by - KillSwitch414 on February 20, 2004 11:05:16 AM]

This topic is closed to new replies.

Advertisement