Results 1 to 4 of 4
  1. #1
    Strikex's Avatar
    Join Date
    Dec 2010
    Gender
    male
    Posts
    1,311
    Reputation
    9
    Thanks
    350
    My Mood
    Relaxed

    How I Leave I establish of the Transparent Menu?

    Type of the Chocolate, I use the base of the Alessandro. certinho is everything. but it wanted leaves it better. with deep transparent.

  2. The Following User Says Thank You to Strikex For This Useful Post:

    Turbulence (02-27-2011)

  3. #2
    whit's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Posts
    7,170
    Reputation
    490
    Thanks
    2,252
    [Highlight=c++]
    #define TBlack D3DCOLOR_ARGB ( 180, 0, 0, 0 )

    void cMenu::BG( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
    {
    const DWORD D3D_FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE;

    struct Vertex
    {
    float x,y,z,ht;
    DWORD color;
    }

    V[4] =
    {
    {(float)x,(float)(y+h), 0.0f, 0.0f, color},
    {(float)x,(float)y, 0.0f, 0.0f, color},
    {(float)(x+w),(float)(y+h), 0.0f, 0.0f, color},
    {(float)(x+w),(float)y, 0.0f, 0.0f, color}
    };

    pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
    pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
    pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
    pDevice->SetRenderState( D3DRS_FOGENABLE, false );

    pDevice->SetFVF(D3D_FVF);
    pDevice->SetTexture(0, NULL);
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,V,sizeof(Ve rtex));
    }

    BG( 20, 200, 150, 400, TBlack, pDevice);
    [/Highlight]


  4. The Following User Says Thank You to whit For This Useful Post:

    Strikex (02-10-2011)

  5. #3
    _Fk127_'s Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    724
    Reputation
    16
    Thanks
    208
    My Mood
    Bitchy
    Quote Originally Posted by whit View Post
    [Highlight=c++]
    #define TBlack D3DCOLOR_ARGB ( 180, 0, 0, 0 )

    void cMenu::BG( int x, int y, int w, int h, D3DCOLOR color, IDirect3DDevice9* pDevice )
    {
    const DWORD D3D_FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE;

    struct Vertex
    {
    float x,y,z,ht;
    DWORD color;
    }

    V[4] =
    {
    {(float)x,(float)(y+h), 0.0f, 0.0f, color},
    {(float)x,(float)y, 0.0f, 0.0f, color},
    {(float)(x+w),(float)(y+h), 0.0f, 0.0f, color},
    {(float)(x+w),(float)y, 0.0f, 0.0f, color}
    };

    pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
    pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
    pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
    pDevice->SetRenderState( D3DRS_FOGENABLE, false );

    pDevice->SetFVF(D3D_FVF);
    pDevice->SetTexture(0, NULL);
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,V,sizeof(Ve rtex));
    }

    BG( 20, 200, 150, 400, TBlack, pDevice);
    [/Highlight]

    At least someone understood what this meant...



    Put this image in your signature if you support HTML5 development!

  6. The Following User Says Thank You to _Fk127_ For This Useful Post:

    Turbulence (02-27-2011)

  7. #4
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    Code:
    void cDraw::FillRGB( int x, int y, int w, int h, D3DCOLOR yourcolor, IDirect3DDevice9* pDevice ,bool transparent)
    {
    	if(transparent == true)
    	{
    		const DWORD D3D_FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE;
    		struct Vertex 
    		{
    			float x,y,z,ht;
    			DWORD yourcolor;
    		}
    		
    		V[4] = 
    		{
    			{(float)x,(float)(y+h), 0.0f, 0.0f, yourcolor},
    			{(float)x,(float)y, 0.0f, 0.0f, yourcolor},
    			{(float)(x+w),(float)(y+h), 0.0f, 0.0f, yourcolor},
    			{(float)(x+w),(float)y, 0.0f, 0.0f, yourcolor}
    		};
    		pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
    		pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
    		pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
    		pDevice->SetRenderState( D3DRS_FOGENABLE, false );
    	 
    		pDevice->SetFVF(D3D_FVF);
    		pDevice->SetTexture(0, NULL);
    		pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,V,sizeof(Vertex));
    	}
    	if(transparent == false)
    	{
    		if( w < 0 )w = 1;
    		if( h < 0 )h = 1;
    		if( x < 0 )x = 1;
    		if( y < 0 )y = 1;
    
    		D3DRECT rec = { x, y, x + w, y + h };
    		pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, yourcolor, 0, 0 );
    	}
    }
    
    //example:
    FillRGB( 200, 35, 200, 60, 0x3DFF0000, pDevice ,true)
    The Internet SHOULD Be Illegal

    When you say
    "Java is a great programming language because it works on all platforms"
    it is just like
    "anal sex is great because it works on all genders"

    Are YOU a Troll?

  8. The Following 2 Users Say Thank You to kotentopf For This Useful Post:

    Strikex (02-12-2011),Turbulence (02-27-2011)