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
[.net] Adding transparency to sprites and making them iso
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement