Hello Guest

Author Topic: Object layers in TMX files?  (Read 3213 times)

cjddmut

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Object layers in TMX files?
« on: May 26, 2013, 10:09:41 am »
I have a game that I'm recreating with Unity and 2D Toolkit. When I originally created this game I made all the levels using Tiled. I was very excited to see that 2D Toolkit played well with tmx files, this would save me quite a bit of time! However, I can't seem to find if 2D Toolkit supports object layers from the tmx file? My levels used a few objects that were defined in Tiled and I was hoping to avoid redefining all of them in Unity.

Any tips?

Thanks!
C.J.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Object layers in TMX files?
« Reply #1 on: May 26, 2013, 11:12:09 am »
It supports object layers. Just import as normal and then you can show/hide layers.
There isn't a code interface to do it in code, but its still possible - you can get the layer game object by doing:
tileMap.Layer
  • .gameObject, and then you can active/deactivate this to show and hide a layer at runtime.