Results 1 to 9 of 9
  1. #1
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    724
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy

    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.

  2. #2
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    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

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  3. #3
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    724
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    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

  4. #4
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    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);

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  5. #5
    NOOB's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    3,863
    Reputation
    425
    Thanks
    8,598
    You'll need to add text because you won't be able to tell which box controls which tab/hack.

  6. #6
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    724
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    Quote Originally Posted by ᴺᴼᴼᴮ 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

  7. #7
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    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

    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  8. #8
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    724
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    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
    Last edited by _Fk127_; 11-29-2010 at 06:16 PM.

  9. #9
    Nubzgetkillz's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    hacktown
    Posts
    838
    Reputation
    13
    Thanks
    411
    My Mood
    Amazed
    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:


    Member since September 25, 2010

    Current Objectives:
    • Graduate college with a degree in Computer Science
    • Find a decent job in the Computer Science Field
    • Learn more programming languages

    Looking for Elo Boosting Job - League of Legends
    Looking for Bronze -> Gold Jobs


    Skype: whatthedream

  10. The Following User Says Thank You to Nubzgetkillz For This Useful Post:

    _Fk127_ (11-29-2010)