Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am fairly new to XNA and I have questions in regards to textures.

Most of my of textures have a background color along with the overall image (white, black, or whatever). This is quite ugly as the users main character, ship, or bullets, ect, have this black or white background with it. Is there any function, tool, or anything that will enable me to crop the actual part of the image i want to use as the texture?

I am by no means good with and photo editors or anything graphic related.

I came up short with google, as most results led me no where.

All help is appreciated. Thank you.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

XNA Texture2D Content Pipeline compilation uses original alpha channel to remove backgrounds. you can set alpha chanels in your images using image procesing tools like Paint.NET, gimp or photoshop.

There is other way just to set specyfic color (example white) to be transpatent. In "Content" project where your textures are:

  1. Right click texture you want to remove background
  2. Select properties
  3. From Properties select Content Processor -> ColorKeyColor and set it to color you want to be transparent (example 255;255;255;255 for white)
share|improve this answer
    
You are awesome. I dont have enough rep to do much, but thank you 10fold. =D –  TheNoob Jan 24 '13 at 23:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.