gl-tiled icon indicating copy to clipboard operation
gl-tiled copied to clipboard

Support for only drawing one layer at a time?

Open githubaccount256 opened this issue 3 years ago • 2 comments

As with many other games, my player and other monster sprites are in the middle of the map layers. That is, the game rendering logic is something like this:

renderMap() {
  drawMapLayer(0);
  drawMapLayer(1);
  drawMapLayer(2);

  drawSprites();

  drawMapLayer(3);
  drawMapLayer(4);
  drawMapLayer(5);
}

Is it possible to do something like this with your library? So that I can have parts of the map drawn over the player and other monsters.

githubaccount256 avatar Mar 30 '21 18:03 githubaccount256

It'd be more expensive than drawing all the layers at once, but shouldn't be too hard to break up the tilemap draw function. PRs welcome.

englercj avatar Apr 07 '21 16:04 englercj

Sure, I think I can figure it out. I just need to get the power-of-two issue fixed first, and then I can make a PR for this.

githubaccount256 avatar Apr 07 '21 16:04 githubaccount256