Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I draw a square,and draw texture in the square,how to set the color I wantn't draw in the texture?

please excuse my english,

if necessary ,could you show a short code?

thanks

Posted
I draw a square,and draw texture in the square,how to set the color I wantn't draw in the texture?

please excuse my english,

if necessary ,could you show a short code?

thanks

 

Do you work With DirecX3D ?

How do you draw the Square?

Where do you want to have the AlphaBlend - Transperency?

 

LDV

Posted

Dev.RenderState.AlphaSourceBlend = Blend.SourceAlpha

Dev.RenderState.AlphaDestinationBlend = Blend.InvSourceAlpha

DEv.RenderState.AlphaBlendEnable = True

in your render sub,

 

and then when loading your texture,

 

text = new texture(yourbitmap, width,height...,transparent color [see Intellisense])

 

sorry i dont remember of the top of my head

does that help,

pent?

 

edit:

does that help?

pent,

 

:p

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Posted
Do you work With DirecX3D ?

How do you draw the Square?

Where do you want to have the AlphaBlend - Transperency?

 

LDV

 

yes,exactly I don't draw the squre,just set four point for (D3SFVF_XYZRHW\DIFFUSE|TEX1) to load a texture

I draw the texture use (DrawPrimitive) ,I don't know how to set transperency

Posted (edited)
Dev.RenderState.AlphaSourceBlend = Blend.SourceAlpha

Dev.RenderState.AlphaDestinationBlend = Blend.InvSourceAlpha

DEv.RenderState.AlphaBlendEnable = True

in your render sub,

 

and then when loading your texture,

 

text = new texture(yourbitmap, width,height...,transparent color [see Intellisense])

 

 

thanks ,I will try,

but can this "text = new texture(yourbitmap, width,height...,transparent color [see Intellisense])"

work?

what's the "texture",a class?

use vc...

Edited by hxx

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...