hey guys, I recently got into coding with C++ since I was bored of VB and I have been watching this tutorials series and have been doing okay so far Ive completed my D3D Menu but the problem is the background(Black) is a solid color when in game but the text for hacks that is being drawn is transparent(yellow) so trees and other game objects make the text transparent.
Draw Text:
Code:
void Hacks::Draw_Text(LPCSTR TextToDraw, int x, int y, D3DCOLOR Colour)
{
RECT rct = {x- 120, y, x+ 120, y + 15};
m_font->DrawText(NULL, TextToDraw, -1, &rct, DT_NOCLIP, Colour);
}
Use:
Code:
void Hacks::DrawMenu(IDirect3DDevice9 *d3dDevice)
{
if(!hack[HIDE_MENU].on)
{
DrawFilledRect( 45, 40, 200, (40*MAX_MENU_ITEMS),fontBlack, d3dDevice );
int y = 40;
for(int i = 0; i < MAX_MENU_ITEMS; i ++)
{
DrawFilledRect( 49, 26+y, 150, 13, hack[i].on ? fontGreen : fontBlack, d3dDevice );
if(MenuIndex == i)
{
DrawBorderBox(49, 26+y, 150, 13, 1, fontRed, d3dDevice );
}
Draw_Text(hack[i].name.c_str(), 170 , 25+y, fontYellow);
y+= 30;
}
}
}
Code:
D3DCOLOR fontRed = D3DCOLOR_ARGB(255, 255, 0, 0);
D3DCOLOR fontGreen = D3DCOLOR_ARGB(255, 0, 255, 0);
D3DCOLOR fontBlue = D3DCOLOR_ARGB(255, 0, 00, 255);
D3DCOLOR fontWhite = D3DCOLOR_ARGB(255, 255, 255, 255);
D3DCOLOR fontBlack = D3DCOLOR_ARGB(151, 0, 0, 0);
D3DCOLOR fontYellow = D3DCOLOR_ARGB(255, 246, 238,0);
/*---------------------------------------------------*/
void Hacks::CreateFont(IDirect3DDevice9 *d3dDevice, std::string choiceFont)
{
D3DXCreateFont( d3dDevice, 15, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
choiceFont.c_str(), &m_font );
}
Can anyone see where I've gone wrong.
Thanks