Jump to content
  • Advertisement
Sign in to follow this  
adam23

2D Sprite Question

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

Sprite Graphics Question I am working on a 2D DirectX RPG game. I download most of my sprites from: http://reinerstileset.4players.de/englisch.htm I must say he does a really good job on his sprites, but the problem I have is with transparency. For example I have a castle.bmp with a transparency of 108, 76, 47. This removes all of the pixels of that color, but it leaves a small line of slightly different pixels around the castle. The shade must change slightly as it approaches the building. I am using Textures in DirectX to display these images. Is there an easier way to fix that other than changing one pixel at a time? I have Adobe Photoshop CS2. Any advice would be greatly appreciated. I apologize if I posted this in the wrong place. __________________ Programming video games is my life.

Share this post


Link to post
Share on other sites
Advertisement
im currently having this problem too, as long as you dont resize it you wont get the edges blended with pixles that should be trasparent, if you need to resize it you could try masking or a format with a aplha channle like a tga, this way you can make the areas around the sprite the same color as the sprite itself but this transparent

Share this post


Link to post
Share on other sites

i load the first image and then make it transparent where the secnd on is black

Share this post


Link to post
Share on other sites
Your right it only does it if I resize it. Thank you for the tip, I will try that right now :)

Share this post


Link to post
Share on other sites
I don't think using a mask will work with DirectX will it?
I've done that using WIN32 before but never DirectX.

Share this post


Link to post
Share on other sites
well it happens becouse when you resize it the image blends with neiboring pixles so its not blocky but when you blend with the edges you get the transparent color blended with the image

Share this post


Link to post
Share on other sites
Quote:
Original post by adam23
I don't think using a mask will work with DirectX will it?
I've done that using WIN32 before but never DirectX.

there should be some way to make it work in directx, im using gl so unfortunatly i dont know but you could try asking in the directx forum about masking, or directx can load .tga

Share this post


Link to post
Share on other sites
I actually had the same problem with Reiner's graphics (amazing for being free) as well. The transperency color is slightly altered if you resize the image causing one or two lines of pixel color that show up. I use Paint Shop Pro and just decrease the color count. You can then resize the image and the trans. color stays the same. After you are finished just increase the color count back to the original. I have done this on virtually every image from his site that I have used and there is usually very little color disturbance in the actual image after changing the color counts.
Hope it helps.

Edit: This is only works when you resize the image before using in it your game. If DirectX alters the size of the image then this will probably not work. Sorry.

Share this post


Link to post
Share on other sites
Quote:
Original post by shadowcomplex
Edit: This is only works when you resize the image before using in it your game. If DirectX alters the size of the image then this will probably not work. Sorry.

this is where the x^2 textures become a pain

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!