Introducing MPGH's AIGA. The latest advancement in artificial intelligence. Click here now to learn more!
Results 1 to 6 of 6
  1. #1
    FlaVour's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    155
    Reputation
    7
    Thanks
    24
    My Mood
    Cynical

    D3D & c++ || Simple Color Slider

    Hey MPGH,
    maybe this will help some coder:


    Code:
    DWORD color[3], cur;
    
    
    	pMenu->DrawBorderedBox( 300, 100, 300, 120 , pMenu->col.background, pMenu->col.border, pDevice );
    	pMenu->DrawTextR( 310, 110, D3DCOLOR_ARGB(255, 220, 220, 220), "Color Slider 0.5" );
    	pMenu->DrawTextR( 307, 135, D3DCOLOR_ARGB(255, 255, 0, 0), "R:" );
    	pMenu->DrawTextR( 307, 150, D3DCOLOR_ARGB(255, 0, 255, 0), "G:" );
    	pMenu->DrawTextR( 307, 165, D3DCOLOR_ARGB(255, 0, 0, 255), "B:" );
    	pMenu->DrawBorderedBox( 325, 135+3, 255, 8, D3DCOLOR_ARGB(255, 255, 0, 0) /*Background*/, D3DCOLOR_ARGB(255, 200, 200, 200) /*Border*/, pDevice );
    	pMenu->DrawBox( 325+color[0], 135+1, 2, 11, D3DCOLOR_ARGB(255,255,255,255), pDevice );
    	pMenu->DrawBorderedBox( 325, 150+3, 255, 8, D3DCOLOR_ARGB(255, 0, 255, 0) /*Background*/, D3DCOLOR_ARGB(255, 200, 200, 200) /*Border*/, pDevice );
    	pMenu->DrawBox( 325+color[1], 150+1, 2, 11, D3DCOLOR_ARGB(255,255,255,255), pDevice );
    	pMenu->DrawBorderedBox( 325, 165+3, 255, 8, D3DCOLOR_ARGB(255, 0, 0, 255) /*Background*/, D3DCOLOR_ARGB(255, 200, 200, 200) /*Border*/, pDevice );
    	pMenu->DrawBox( 325+color[2], 165+1, 2, 11, D3DCOLOR_ARGB(255,255,255,255), pDevice );
    	pMenu->DrawTextR( 317, 184, D3DCOLOR_ARGB(255, 255, 255, 255), "Color:" );
    	pMenu->DrawBorderedBox( 370, 184+3, 70, 8, D3DCOLOR_ARGB(255, color[0], color[1], color[2]), D3DCOLOR_ARGB(255, 200, 200, 200), pDevice );
    	pMenu->DrawTextR( 310, 200, D3DCOLOR_ARGB(255, 220, 220, 220), "Use +/- to change value, 1/2/3 to choose color" );
    
    	if(GetAsyncKeyState(VK_ADD) && color[cur] < 255)
    		color[cur]++;
    	if(GetAsyncKeyState(VK_SUBTRACT) && color[cur] > 0)
    		color[cur]--;
    
    	int key[3] = { 0x31, 0x32, 0x33 };
    	for( int i = 0; i < 3; i++ )
    	{
    		if(GetAsyncKeyState(key[i])&1)
    			cur = i;
    	}
    Code:
    CREDITZ:
    Yazzn
    Code:
    Comment by yazzn:
    Thanks to Neo III, his color slider was a big inspiration for me. 
    
    PS: color[0] = r; color[1] = g; color[2] = b;
    [Respect List]
    All they respect me


    [My projects]
    Crossfire NA Public Hack with menu together with sapass209

    [html]"Sir we're surrounded!"
    "Excellent, then we can attack in all directions".[/html]



  2. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,159
    Reputation
    490
    Thanks
    2,253
    Looks good but i already seen this on UC

  3. #3
    FlaVour's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    155
    Reputation
    7
    Thanks
    24
    My Mood
    Cynical
    Quote Originally Posted by whit View Post
    Looks good but i already seen this on UC
    you got right...i copied from there(with creditz ) because i thought maybe a coder can work with it..
    [Respect List]
    All they respect me


    [My projects]
    Crossfire NA Public Hack with menu together with sapass209

    [html]"Sir we're surrounded!"
    "Excellent, then we can attack in all directions".[/html]



  4. #4
    EminemJr's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    3,251
    Reputation
    8
    Thanks
    301
    My Mood
    Tired
    Looks nice and thanks for the code

  5. #5
    wtfhaksftw's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Posts
    108
    Reputation
    10
    Thanks
    7
    My Mood
    Stressed
    Lol im pretty sure almost all good coders go to uc :P

  6. #6
    Pxpc2's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    231
    Reputation
    6
    Thanks
    11
    My Mood
    Angelic
    Thats pretty complicated.
    Looks even more than c++;
    Even thought not.

    And, thanks so much for this, maybe help alot of persons learning D3D.