CYBERMIX | FORUM

Hello, Guest !

We would like to invite you to join our community.

Register & Login now Smile

( " We are currently recruiting forum staffs " )
CYBERMIX | FORUM

Hello, Guest !

We would like to invite you to join our community.

Register & Login now Smile

( " We are currently recruiting forum staffs " )
. Login Register
CYBERMIX | FORUM

WE POST EVERYTHING YOU NEED


You are not connected. Please login or register

Like this topic? Then share our topic !

URL Direct
BBcode
HTML
[DirectX] D3D Menu

View previous topic View next topic Go down  Message [Page 1 of 1]

Post: #1Wed Feb 11, 2015 11:56 pm

Anonymous

Guest

Guest
Hey guys, i think i've finish my first menu [DirectX] D3D Menu  Image
Of course i've got help from the community specially Crypt [DirectX] D3D Menu  Image

I know there are other ways to do that, but i had a few problems with some deprecated functions lol, had to implement a few things!

Vars
Code:
LPD3DXFONT d_font, m_font;
int iIndicator = 0;

BOOL iWH= false;
BOOL iCH = false;

Drawing my Menu options.. [DirectX] D3D Menu  Image
Code:
void DrawMenuOption(LPDIRECT3DDEVICE9 pDevice, int y, char * szText, BOOL Option, int Indication)
{
char on[3] = "ON";
char off[4] = "OFF";
char opt[100];

if (Option)
strcpy_s(opt, 100, on);
else
strcpy_s(opt, 100, off);

D3DXCreateFont(pDevice, 16, 0, FW_BOLD, 0, 0, 1, 0, 0, 0 | FF_DONTCARE, TEXT("Arial"), &m_font);
RECT rFont = { 20, y, 140, 100 };

if (Option)
{
m_font->DrawText(NULL, szText, -1, &rFont, DT_LEFT, GREEN);
m_font->DrawText(NULL, opt, -1, &rFont, DT_RIGHT, GREEN);
}
else
{
if (iIndicator == Indication)
{
m_font->DrawText(NULL, szText, -1, &rFont, DT_LEFT, YELLOW);
m_font->DrawText(NULL, opt, -1, &rFont, DT_RIGHT, YELLOW);
}
else
{
m_font->DrawTextA(NULL, szText, -1, &rFont, DT_LEFT, WHITE);
m_font->DrawTextA(NULL, opt, -1, &rFont, DT_RIGHT, WHITE);
}
}
}

Drawing my menu template
Code:
//DRAWING MY MENU [DirectX] D3D Menu  Clear
void g4xMenu(IDirect3DDevice9* dev, int x, int y, int w, int h)
{
D3DRECT bBord = { x - 2, y - 2, x + w + 2, y + h + 2 };
D3DRECT bRect = { x, y, x + w, y + h };
D3DRECT bTitle = { x + 7, y + 7, x + w - 7, y + h / 4 };

dev->Clear(1, &bBord, D3DCLEAR_TARGET | D3DCLEAR_TARGET, WHITE, 0, 0);
dev->Clear(1, &bRect, D3DCLEAR_TARGET | D3DCLEAR_TARGET, LIGHT_DARK_GRAY, 0, 0);
dev->Clear(1, &bTitle, D3DCLEAR_TARGET | D3DCLEAR_TARGET, DARK_GRAY, 0, 0);
DrawTextCenter(dev, "g4x - darkhook.net", 30, 23, WHITE);

//ADDING OPTIONS
DrawMenuOption(dev, 60, "Wallhack", iWH, 0);
DrawMenuOption(dev, 80, "Crosshair", iCH, 1);

}

EndScene
Code:
g4xMenu(pDevice, 10, 10, 170, 140);

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum