Drawtab Function

Posts 19 of 9 · Page 1 of 1
Drawtab Function
Im working on a drawtab function to speed things up a little when i'm making my hack
Ive got this:
Code:
void Drawtab( bool selected, int x, int y, int w, int h, D3DCOLOR tabcolor, D3DCOLOR Borderoff, D3DCOLOR Borderon, IDirect3DDevice9* pDevice )
{
	POINT cPos;
	GetCursorPos(&cPos);
	if(cPos.x > x && cPos.x < w && cPos.y > y && cPos.y < h)
	{
		if(GetAsyncKeyState(VK_LBUTTON)<0)
		{
			selected = true;
		}
		if(GetAsyncKeyState(VK_RBUTTON)<0)
		{
			selected = false;
		}
	}
	if(selected)
	{
		DrawBox(x,y,w,h,tabcolor ,Borderon,pDevice);
	}
	else
	{
		DrawBox(x,y,w,h,tabcolor ,Borderoff,pDevice);
	}
}
Im using it like this:
Code:
if(menu)
{
Drawtab(false, 60,80,76,56,Orange ,White, Green, pDevice);
}
When i click it, the border doesn't change colors...
I know i screwed up somewhere obvious, dont tell me the code i need to change, just tell me where i went wrong...
Thanks in advance.
Hehe obvious error. Lol well when it is false the color will be tabcolor which is the same as true since in the code


D3DCOlOR TABCOLOR // that would make them both same color


idk if i make sense...
Code:
void Drawtab( bool selected, int x, int y, int w, int h, D3DCOLOR tabcolor, D3DCOLOR Borderoff, D3DCOLOR Borderon, IDirect3DDevice9* pDevice )
see u only put one tab color.. so in the function u put..
Code:
	if(selected)
	{
		DrawBox(x,y,w,h,tabcolor ,Borderon,pDevice);
	}
	else
	{
		DrawBox(x,y,w,h,tabcolor ,Borderoff,pDevice);
	}
for the color of both... THey would look same color.. maybe tabcolor2? o.O
Quote Originally Posted by Nubzgetkillz View Post
Hehe obvious error. Lol well when it is false the color will be tabcolor which is the same as true since in the code


D3DCOlOR TABCOLOR // that would make them both same color


idk if i make sense...
Code:
void Drawtab( bool selected, int x, int y, int w, int h, D3DCOLOR tabcolor, D3DCOLOR Borderoff, D3DCOLOR Borderon, IDirect3DDevice9* pDevice )
see u only put one tab color.. so in the function u put..
Code:
	if(selected)
	{
		DrawBox(x,y,w,h,tabcolor ,Borderon,pDevice);
	}
	else
	{
		DrawBox(x,y,w,h,tabcolor ,Borderoff,pDevice);
	}
for the color of both... THey would look same color.. maybe tabcolor2? o.O
lol naw im just trying to change the border color... Borderon, Borderoff...
they dont change
or u can just change

if(selected)
{
DrawBox(x,y,w,h,tabcolor ,Borderon,pDevice);
}
else
{
DrawBox(x,y,w,h,tabcolor ,Borderoff,pDevice);
}

too

if(selected)
{
DrawBox(x,y,w,h,Red,Red,pDevice);
}
else
{
DrawBox(x,y,w,h,Green , Green,pDevice);
}

and remove those from Drawtab( x,y,w,h,pdevice);
You'll need to add text because you won't be able to tell which box controls which tab/hack.
Quote Originally Posted by NOOB View Post
You'll need to add text because you won't be able to tell which box controls which tab/hack.
i know, im just getting a basic function working ill add that later
Quote Originally Posted by _Fk127_ View Post
i know, im just getting a basic function working ill add that later
Well I fixed up your function and it works just fine

want the code? since u said in the thread u don't want coding just tell u what is wrong
Quote Originally Posted by Nubzgetkillz View Post
Well I fixed up your function and it works just fine

want the code? since u said in the thread u don't want coding just tell u what is wrong
Either way works, im just wondering where i screwed up.
Thx nubz
Here is what I did with code.. you may not like but o well

don't forget
bool selected = false;
i didn't add in functions
Code:
void Drawtab(int x, int y, int w, int h, D3DCOLOR oncolor, D3DCOLOR onbordercolor,IDirect3DDevice9* pDevice )
{
	DrawBox(x,y,w,h,RED,RED,pDevice);
	if(isMouseinRegion(x,y,x+w,y+h))
	{
		if(GetAsyncKeyState(VK_LBUTTON)&1)
		{
			selected =! selected;
		}
	}
	if(selected)
	{
		DrawBox(x,y,w,h,oncolor,onbordercolor,pDevice);
	}
}
btw u need ismouseinregion function or just convert to the other method

vid:

Posts 19 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?