Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I started working on a tile engine recently and have been trying to get this depth sorting for the tiles right. I am using XNA and the SpriteSortMode.Deferred to get the tiles to sort correctly in the X direction along with a for loop to loop through all tiles that should be drawn, but the Deferred mode does not work in the Y direction. Anyone have any advice or a solution?

Just an image for reference:

share|improve this question
up vote 2 down vote accepted

You could try drawing with Z order. Make each row have a different Z. That will require you to change the sortmode to front-back / vise-versa.

Another option is to draw columns first (| | | | |).

share|improve this answer
It's funny because I came up with the exact same answer right before I went to check this. I fixed it with the column solution. Thanks! – x3zinja12 Jan 22 '13 at 2:24

Your Answer


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.