Hello Guest

Author Topic: Can a tilemap draw to a layer without erasing the previous content?  (Read 4261 times)

Quells122

  • Newbie
  • *
  • Posts: 18
    • View Profile
I like to keep my tileset graphics simple so that I can compose them together during tilemap creation. So instead of having, say, three tiles for grass, building, and building + grass, I keep them separately as a building and grass tile, and if I need building + grass, I lay one above the other on separate layers like in the picture below.

This gives me more freedom and flexibility. In the example picture below, all three layers are in the background and should behave as one unit. Is it possible then to render this into one just layer, instead of three, to save on draw calls? I know 2DTK's tilemap has a SetTile function. Is it possible to call it without erasing the previous contents, so that I can effectively combine tiles together?

Picture example of what I'm trying to achieve:

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can a tilemap draw to a layer without erasing the previous content?
« Reply #1 on: July 15, 2014, 04:42:17 pm »
You need to use multiple tilemap layers for this.

Quells122

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Can a tilemap draw to a layer without erasing the previous content?
« Reply #2 on: July 15, 2014, 09:53:10 pm »
I know that this can be achieved with multiple layers. I'm specifically asking if it's possible to achieve this with just one layer? I'd like to call td2kTileMap.SetTile without clearing away the previous graphic to achieve this effect.

Correct me if I'm wrong, but TD2K is drawing to a texture, so would it not be possible to draw to the texture but not erase what was already on the texture - as in just draw over the texture?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Can a tilemap draw to a layer without erasing the previous content?
« Reply #3 on: July 15, 2014, 11:13:44 pm »
tk2d is not drawing to a texture. Its creates geometry that draws the tiles.

Quells122

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Can a tilemap draw to a layer without erasing the previous content?
« Reply #4 on: July 16, 2014, 01:13:39 am »
I see. So it's not possible.

Multiple layers it is then. Thanks!