• Advertisement
Sign in to follow this  

XNA Content Processor Transparency

This topic is 1567 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All

 

I am having a strange issue with a custom content processor for processing map levels.

 

I have the following code which imports a PNG image. When I use the serialized data in the spriteBatch.Draw(..) call, the renderer does not see magenta as transparent and the magenta color is left on the screen:

var extRef = new ExternalReference<Texture2DContent>(path);
var texture = context.BuildAsset<Texture2DContent, Texture2DContent>(extRef, null, data, null, asset);

If I modify the code to use a TextureContent type along with the required importer and processor types, along with some casting on the game-code-side the transparency is fine and there is no magenta shown:

var extRef = new ExternalReference<TextureContent>(path);
var texture = context.BuildAsset<TextureContent, TextureContent>(extRef, "TextureProcessor", data, "TextureImporter", asset);

Could someone please shed some light on what is going on here?

 

Thanks,

Mark.

 

 

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement