Jump to content
  • Advertisement
Sign in to follow this  
nickwinters

[.net] Adding transparency to sprites and making them iso

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

I'm attempting to create an iso tile game with MDX. I am able to load sprites and display them on the screen. The next step is to load textures for the sprites that have some transparent sections, or sections that are a color not used in the rest of the texture (say bright pink), and make those pixels transparent somehow. The other thing I'm trying to do is rotate a sprite. To draw the sprite, I use the code: srite is a Sprite t is a Texture r is a Rectangle Center and position are Vector3f.
sprite.Draw(t, r, Center, position, Color.White);
In order to rotate, I've read I need to change Center. I've played with the values, and have been unable to get it to rotate. What values would rotate it? Thank you for your help. -Nick

Share this post


Link to post
Share on other sites
Advertisement
For transparency, just store your images in a .png with transparency and use RGBA color mode. If you want the 'traditional' iso view, you will probably have to draw them rotated. The tiles are more diamond shaped than square (unless looking from straight above) and although you could strech them, that would mess with your proportions.

Share this post


Link to post
Share on other sites
As far as I know D3DSprites can only be drawn square. If you want to make a texture isometric you need to use vertices and set the vertices yourself. This will be a lot faster and more flexible than using MDX sprites. The MDX sprites are really only intended for doing particle systems/billboarding. You could set up a flat(2d) grid of vertices and move the camera to an isometric view.

Incidently, I am working on a wrapper for easily doing 2D graphics with MDX that will have built-in functions for doing isometric tiles (and anything else you could want in 2D). I'll probably have the first version ready in a couple of weeks. You can PM me if you are interested.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!