CD3D Font - Always on top? & color
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
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
"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
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
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.
Render all of the objects in your 3D world first, then render your frame stats on top of that.
neneboricua
neneboricua
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
__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
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]
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
Popular Topics
Advertisement