Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


XNA Content Processor Transparency


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 mwkenna   Members   -  Reputation: 143

Like
0Likes
Like

Posted 05 October 2013 - 02:09 PM

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.

 

 



Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS