2D Toolkit Forum

2D Toolkit => Support => Topic started by: zzeettoo on November 28, 2013, 09:53:28 pm

Title: Create tilemap/tiles with tags or layers
Post by: zzeettoo on November 28, 2013, 09:53:28 pm
Hi there, i've been looking for an option to create a tilemap(within unity, no tiled editor or soemthing). And to set a specififc layer or tag for the gameobjects which will be created.
So i can obviously do this myself, but i would have to do this after every change and commit to my tilemap data as the default has no tag oder layer.

Moreover i wonder if this would be possible as a kind of property for a single tile.
So lets say i have some even floor tiles and some slope tiles. I would like to have all slopes a 'slope' layer or tag.
Is this possible or is there a workaround so i can still draw my tilemap within unity without having to create my slopes seperately?
Title: Re: Create tilemap/tiles with tags or layers
Post by: unikronsoftware on November 29, 2013, 10:58:20 pm
It is possible, but not for individual tiles unless you use the prefab option. But that would be counterintuitive as you'll be throwing away all the optimisations tk2d performs when merging tile maps. Alternatively you can write a script that takes all tiles of a particular type and puts it into another layer...
Title: Re: Create tilemap/tiles with tags or layers
Post by: zzeettoo on December 06, 2013, 07:03:25 pm
Okay, seems legit ;)
But it should be no problem to simply change the layer or the tag of all tiles or lets say all chunks right?
So if i want all my tile chunks to be created with the tag or the layer 'floor', how would i do this in order to not do it by hand everytime i commited a change to my tiledata?
Title: Re: Create tilemap/tiles with tags or layers
Post by: unikronsoftware on December 07, 2013, 03:18:13 pm
You can set up the layer in the tile map > settings > layers > "Layer".
Title: Re: Create tilemap/tiles with tags or layers
Post by: zzeettoo on December 07, 2013, 08:56:43 pm
thanks! that was what i was looking for ;)