Sign in to follow this  

XNA Sprites question

This topic is 3782 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

Just a quick question on sprites in XNA. How do I create a sprite where a particular colour is transparent? In other libraries in the past it used to be a pinky colour (IIRC Allegro was one that used that colour). Anyway, I've created some simple Isometric blocks in Photoshop with a transparent background but when saved in BMP format they're saved with a white background. At the moment the sprites are being displayed in my program with that white background.

Share this post


Link to post
Share on other sites
Alternative method is to save them with a black background and to use additive blending when you render the sprites (spriteBatch.Begin(SpriteBlendMode.AdditiveBlend)) - black areas will then be completely transparent. But the preferred way is to use a PNG file anyway (because you have a finner control over which area should be transparent in your sprite).

Share this post


Link to post
Share on other sites

This topic is 3782 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this