Your First XNA Game: Load DDS with Alpha Channel
Hello, just looking at the "Your First XNA Game" tutorial. It mentions using the DirectX Texture Tool to create a .dds file with an alpha channel rather than a .png.
Texture2D.FromFile(graphics.GraphicsDevice, "sometexture.dds");
doesn't seem to cut it for the alpha part. I tried putting the following before it:
TextureCreationParameters txParams = Texture2D.GetCreationParameters(graphics.GraphicsDevice, "sometexture.dds");
txParams.Format = SurfaceFormat.Rgba32;
to force it to use a8r8g8b8 but still nada.
Any suggestions?
Thanks
[615 byte] By [
sdochert] at [2007-12-23]
Hey George,
Looks like the "Your First XNA Game" sample's call to SpriteBatch.Begin doesn't pass in SpriteBlendMode.AlphaBlend. Looking at this post, I realize it probably should, since it's not too far out to expect that people will want to draw masked sprites with this code.
The tutorial will be updated in the documentation to draw alpha blended sprites.
Thanks for your feedback!
I think its in the DirectX SDK download - that's where the other tools talked about in the tutorials, instructions, help, forums, etc. are at. I'm in the process of downloading the DX SDK now also.