Order of sprite renderings...

Posted By: Mahonroy

Order of sprite renderings... - 01/27/08 19:45

Hello, been working on a 2d sidescroller (mario type game), and ran into a little issue. Everything in the world is made out of sprites that are 16x16 pixels (ground, the player, props, etc.). What I wanted to do was things that are behind the player such as a bush or a fence post for example, I moved it back 1 quant, so the player will be rendered ontop of it.

Well anyways this doesn't work out so well, half of the bush for example the player will be infront of, and the other half the player will be drawn behind it. Does anyone know why this is and how I can get around this? Even when I move them as far as 5 quants back, sometimes the player still gets drawn behind the sprite!

Oh also, all of the sprites are oriented so its not like they are rotating by themselves with respect to the camera movement.
Posted By: Ready

Re: Order of sprite renderings... - 01/27/08 21:28

TGA images?
Posted By: Scorpion

Re: Order of sprite renderings... - 01/27/08 22:29

did you set the right euler? because by default sprites rotate to the camera...
and if you use tga images, it may render the images in the wrong order. You can avoid this by using the z-sort shader from the gs-wiki.
© 2024 lite-C Forums