Page 1 of 1

Most resource efficient way to z-order tilemap?

PostPosted: Sat Jul 08, 2017 9:04 pm
by MonDieu
What would be the best way (spending less cpu and gpu resources) of handling z-order of tilemap elements, like letting the player walking behind treess, buildings etc in a top down adventure game?

Is it possible to z-order a tilemap?

Re: Most resource efficient way to z-order tilemap?

PostPosted: Sat Jul 08, 2017 10:23 pm
by rovacado
@mondieu

I had started a similar thread here that you may find useful.

viewtopic.php?t=192957

If you don't need to dynamicly change the zordering though,I'd say just using layers smartly would do just fine.

Re: Most resource efficient way to z-order tilemap?

PostPosted: Sun Jul 09, 2017 5:39 am
by MonDieu
rovacado wrote:@mondieu

I had started a similar thread here that you may find useful.

viewtopic.php?t=192957

If you don't need to dynamicly change the zordering though,I'd say just using layers smartly would do just fine.


Thanks for the reply, the methods in that thread does not seem to be applicable to tilemap but I'll look into it anyway :)

Re: Most resource efficient way to z-order tilemap?

PostPosted: Sun Jul 09, 2017 6:14 am
by rovacado
You can zorder a tilemap just like any Sprite.

(Keep in mind as far as I know you can't zorder individual tiles on a tilemap object,however. And that's where using layers would come in. You could have for instance the bottom on the tree on one layer,then the player as another layer,and finally the top of the tree as a 3ed layer)

you may want to turn certain objects in your tilemap into a Sprite and set the bounding boxes appropriately so that you can zorder them properly