2D Toolkit Forum
2D Toolkit => Support => Topic started by: Afro-Ninja on November 01, 2013, 08:23:04 pm
-
This feature has come in very handy for regular sprites, I was wondering if there is any way to implement it into the tilemap layers.
For example my tilemap has two layers, and right now I have them set with a zOffset of 0 and .0001. This works for the most part, but I feel like I am still able to detect a small amount of flickering between the layers as they are not quite on the same z index. Is there a way for them to share the same Z with a different render order?
-
I'll consider something like this after the next release, and Unity 4.3 is released.
If we did something for this, it'll likely be Unity 4.3 only.
-
Is there anything I can hunt for in the source code that may let me accomplish this? Or is the code that handles the relevant functions too disparate?
I know Unity 4.3 is introducing new 2d tools, including render layers, are they also adding functionality for rendering on the same Z?
-
Unity adds explicit layer controls in 4.3, pretty much like the layer setting in tk2d. In fact, the 4.3 compatible tk2d will simply use the unity parameter when running in 4.3
Right now, you'll need to modify the mesh bounds. You can hack this in tk2dTileMapMeshBuilder.cs, immediately after chunk.mesh.RecalculateBounds();
-
thanks, I think I have a basic working version in, making use of the AdjustedMeshBounds function from tk2dbasesprite, and basically passing in the tilemap layer id in place of the render layer.
does the build function only get called once upon the creation of the tilemap itself? just want to know if I need to clean up the code a bit if it's something that gets called often.
-
sorry dumb question, I can just use a print statement to see that it only runs once.
-
It will run again if you modify tiles and call Build()...