Post[Release]Shadowed Text!

Posts 115 of 24 · Page 1 of 2
[Release]Shadowed Text!

The default PrintText I use function:
[PHP]void PrintText(char pString[], int x, int y, D3DCOLOR col, ID3DXFont *font)
{
RECT FontRect = { x, y, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);
}[/PHP]
Using:
[PHP]PrintText("", x, y, D3DCOLOR_XRGB(Red, Green, Blue), pFont)[/PHP]


PrintText - Shadow upper-right function:
[PHP]void ShadowedUR(char pString[], int x, int y, D3DCOLOR col, D3DCOLOR colshadow, ID3DXFont *font)
{
// Shadow
RECT FontRect2 = { x+2, y-2, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect2, DT_LEFT | DT_WORDBREAK, colshadow);

// Text
RECT FontRect = { x, y, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);
}[/PHP]
PrintText - Shadow upper-right use:
[PHP]ShadowedUR("", x, y, D3DCOLOR_XRGB(Red, Green, Blue), D3DCOLOR(0, 0, 0), pFont)[/PHP]

PrintText - Shadow lower-right function:
[PHP]void ShadowedLR(char pString[], int x, int y, D3DCOLOR col, D3DCOLOR colshadow, ID3DXFont *font)
{
// Shadow
RECT FontRect2 = { x+2, y+2, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect2, DT_LEFT | DT_WORDBREAK, colshadow);

// Text
RECT FontRect = { x, y, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);
}[/PHP]
PrintText - Shadow lower-right use:
[PHP]ShadowedLR("", x, y, D3DCOLOR_XRGB(Red, Green, Blue), D3DCOLOR(0, 0, 0), pFont)[/PHP]

PrintText - Shadow upper-left function:
[PHP]void ShadowedUL(char pString[], int x, int y, D3DCOLOR col, D3DCOLOR colshadow, ID3DXFont *font)
{
// Shadow
RECT FontRect2 = { x-2, y-2, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect2, DT_LEFT | DT_WORDBREAK, colshadow);

// Text
RECT FontRect = { x, y, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);
}[/PHP]
PrintText - Shadow upper-left use:
[PHP]ShadowedUL("", x, y, D3DCOLOR_XRGB(Red, Green, Blue), D3DCOLOR(0, 0, 0), pFont)[/PHP]

PrintText - Shadow lower-left function:
[PHP]void ShadowedLL(char pString[], int x, int y, D3DCOLOR col, D3DCOLOR colshadow, ID3DXFont *font)
{
// Shadow
RECT FontRect2 = { x+2, y+2, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect2, DT_LEFT | DT_WORDBREAK, colshadow);

// Text
RECT FontRect = { x, y, x+500, y+30 };
font->DrawText( NULL, pString, -1, &FontRect, DT_LEFT | DT_WORDBREAK, col);
}[/PHP]
PrintText - Shadow lower-left use:
[PHP]ShadowedLL("", x, y, D3DCOLOR_XRGB(Red, Green, Blue), D3DCOLOR(0, 0, 0), pFont)[/PHP]


Example:
[PHP]ShadowedUL("Upper-Left Shadow", 10, 13, D3DCOLOR_XRGB(255, 0, 0), D3DCOLOR_XRGB(0, 0, 0), pFont);
ShadowedLL("Lower-Left Shadow", 150, 13, D3DCOLOR_XRGB(255, 0, 0), D3DCOLOR_XRGB(0, 0, 0), pFont);
ShadowedUR("Upper-Right Shadow", 300, 13, D3DCOLOR_XRGB(255, 0, 0), D3DCOLOR_XRGB(0, 0, 0), pFont);
ShadowedLR("Lower-Right Shadow", 450, 13, D3DCOLOR_XRGB(255, 0, 0), D3DCOLOR_XRGB(0, 0, 0), pFont);[/PHP]



Remember to give credits and press thanks!








They flickr like badly for me.
Quote Originally Posted by -0x00 View Post
They flickr like badly for me.

Well it's not my code's fault. It's how your drawing your font...
Very nice, very nice indeed.
DrawText(x, y, ...);
DrawText(x - 2, y + 2, ...);
Can someone show a picture of what it would look like please?
If you want to see what I looks like, then try it. It's not noob proof.
Frick that, I'll stick to hotkeys lol!
Pretty simple Gj anyway :P
Quote Originally Posted by BuRnYoUrSoUl View Post
Very nice,
Quote Originally Posted by L3G3ND_KILL3R View Post
ahaha
gj
i was looking for these /

Please don't say it. Press Thanks!
I pressed the thanks button /
Quote Originally Posted by seeplusplus View Post
Thank you...
Do you think you can help me with 3D text? /

Your -Immortal right?
Posts 115 of 24 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?