好的,希望有一个我只是没有看到的简单修复:我正在尝试在广告牌上实现透明度以进行爆炸,但是在 png 文件本身中没有定义透明的像素的地方,精灵保持稳定。我正在尝试通过乘以透明度来更改Color.White
透明度(float
介于 0 和 1 之间的值)
spriteBatch.Begin(0, BlendState.NonPremultiplied, null, DepthStencilState.DepthRead, RasterizerState.CullNone, basicEffect);
Vector3 viewSpaceTextPosition = Vector3.Transform(this.position, camera.View * invertY);
spriteBatch.Draw(Texture, new Vector2(viewSpaceTextPosition.X, viewSpaceTextPosition.Y), null, Color.White * this.Transparency /*Here's where I try to set the transparency of the image drawn*/, 0, new Vector2(Texture.Bounds.Center.X, Texture.Bounds.Center.Y), this.Scale, SpriteEffects.None, viewSpaceTextPosition.Z);
spriteBatch.End();
有没有明显的错误?还是 Windows Phone 7 的 XNA 无法以 3D 形式呈现透明物体?