A way to Code Tabs in D3D Menu.
TITLE ^^
First, Credits: Solify(Used his base but not his checkboxes function

.. Similar but not exact), Rusty, IcySeal(Sealione), Seeplusplus, Everyone!! i mean it lol..., Whoever created drawbox, draw text, etc! You know what I mean.
Minimal Credits to me
Necessary(YOU WILL NEED) Functions:
Code:
bool isMouseinRegion(int x1, int y1, int x2, int y2)
{
POINT cPos;
GetCursorPos(&cPos);
if(cPos.x > x1 && cPos.x < x2 && cPos.y > y1 && cPos.y < y2){
return true;
} else {
return false;
}
}
Code:
//Draw box Function
void FillRGB( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
{
D3DRECT rec = { x, y, x + w, y + h };
pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, color, 0, 0 );
}
//Draw Border Function
void DrawBorder( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
{
FillRGB( x, (y + h - px), w, px, BorderColor, pDevice );
FillRGB( x, y, px, h, BorderColor, pDevice );
FillRGB( x, y, w, px, BorderColor, pDevice );
FillRGB( (x + w - px), y, px, h, BorderColor, pDevice );
}
void DrawBox( int x, int y, int w, int h, D3DCOLOR BoxColor, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
{
FillRGB( x, y, w, h, BoxColor, pDevice );
DrawBorder( x, y, w, h, 1, BorderColor, pDevice );
}
Code:
void DrawText(int x,int y,DWORD color,char *text, LPDIRECT3DDEVICE9 pDevice){
RECT rect;
SetRect( &rect, x, y, x, y );
Directx_Font->DrawTextA(NULL,text,-1,&rect, DT_LEFT|DT_NOCLIP, color);
}
Now Drawing the Tabs:
Declarations:
Code:
Tab1 = false;
Tab2 = false;
Code:
//If Tab1 is chosen then Tab2 will be false(off) .. must add all tabs that you have.
if(isMouseinRegion(100,274,100+100,274+25)){
if(GetAsyncKeyState(VK_LBUTTON)&1){
Tab1 = true;
Tab2 = false;
}
}
if(isMouseinRegion(50,300,50+50,300+25)){
if(GetAsyncKeyState(VK_LBUTTON)&1){
Tab1 = false;
Tab2 = true;
}
}
How to use the code:
Tab1x = X coord. Tab1y = Y coord, Tab1x+width = Xcoord+width... last one self explanatory
Code:
if(isMouseinRegion(Tab1x, Tab1y,Tab1x+width, Tab1y+height)
Actually drawing the Tabs visually:
Code:
//Tab1
DrawBox(50,200,50,25,Grey,White,pDevice);
DrawText(60,205,White,"Tab1 Text", pDevice);
//Tab2
DrawBox(100,200,50,25,Grey,White,pDevice);
DrawText(110,205,White,"Tab2 Text", pDevice);
For the Text I suggest you add too X and Y coord because it can be centered, Do this depending on Text Size
Explanation of the codes.. These are using the functions posted above.
Code:
DrawBox(Xcoord,Ycoord,Width,Height,Background Color,Border Color,pDevice);
DrawText(Xcoord,Ycoord,Text Color,"Tab1 Text", pDevice);
Declare Hacks. Depends I used bool not int.
Code:
hack1 = false;
hack2 = false;
Now for when you activate hacks.
Code:
if(Tab1 == true)
{
DrawBox(50,226,170,100,Grey,White,pDevice);//Main box with hacks, Change Size to your liking
DrawBox(55,240,10,10,TGrey,White,pDevice);//hack1 checkbox
DrawText(70,237,White,"hack1",pDevice);//hack1 text
//This checks if The checkbox is checked
if(isMouseinRegion(55,240,55+10,240+10)){
if(GetAsyncKeyState(VK_LBUTTON)&1){
hack1 =! hack1;
}
}
//If checkbox is checked then the hack will be activated and the checkbox will be filled/checked/whatever
if(chams) {
DrawBox(55,240,10,10,Grey,Cyan,pDevice);//hack1 checkbox checked
}
}
if(Tab2 == true)
{
DrawBox(50,226,170,100,Grey,White,pDevice);//Main box with hacks
DrawBox(55,240,10,10,Grey,White,pDevice);//hack2 checkbox DrawText(70,237,White,"hack2",pDevice);//hack2 text
//This checks if The checkbox is checked
if(isMouseinRegion(55,240,55+10,240+10)){ //inside same as activating tabs
if(GetAsyncKeyState(VK_LBUTTON)&1){
hack2 =! hack2;
}
}
//If checkbox is checked then the hack will be activated and the checkbox will be filled/checked/whatever
if(nametags) {
DrawBox(55,240,10,10,Grey,Cyan,pDevice);//hack2 box filled
}
}
Now to Make the checkboxes do something. not just get filled.
Code:
if(hack1) {
PushToConsole("Ptc 1");
} else {
PushToConsole("Ptc 0");
}
if(hack2) {
PushToConsole("Ptc2 1");
} else {
PushToConsole("Ptc2 0");
}
HERE IS SCREENSHOT OF MY VERSION..
And if you need help on any of this just ask.. and anything needed to be added/edited/revised just post and say!
ok bye thanks if you liked!