开发者

XNA How To Make Transparent Texture

开发者 https://www.devze.com 2023-03-05 03:02 出处:网络
I read and try that pure Magenta Color 255, 0, 255 in an i开发者_C百科mage is automatically transparent, but unfortunately failed, is there anything should I setup first?
  1. I read and try that pure Magenta Color 255, 0, 255 in an i开发者_C百科mage is automatically transparent, but unfortunately failed, is there anything should I setup first?

  2. Also I read and try include alpha in a PNG Image, the strange is when I used it on a project it's work, but not on the other, what is likely wrong with the code?

Please kindly reply, thank you


For Magenta to be transparent, look at the properties of your image file. Right click in solution explorer, properties.

There is an option there to specify the transparent color to be used (magenta by default).

Then, there is the rendering to consider. How are you drawing your texture? With SpriteBatch, it is automatic, but you may have sorting issues. Check the order in which you draw your textures and the SpriteSortMode.

0

精彩评论

暂无评论...
验证码 换一张
取 消