2D Toolkit Forum
2D Toolkit => Support => Topic started by: mfcas on July 22, 2013, 08:32:26 am
-
I have a screen always filled with 16x16 sprites (for fullscreen full HD it will be 8100 sprites). I need to change the sprites' spriteID very often.
For now I create an array of sprites, but it takes very long to instantiate a big number of sprites, and also having such a big number of GameObjects on the screen slows things considerably.
What's the best way to make this run fast?
Can I use a tilemap and change tile's sprite id without rebuilding the whole mesh?
-
You could use the tilemap. The tilemap system updates based on partitions - default is 32x32 tiles, but user definable to be smaller or bigger. When a tile changes, a partition is marked as dirty and when you call Build, only dirty partitions are rebuilt. Could work quite well in your case.
-
Can we expect tiles rotation by 90, 180, 270 degrees anytime soon?
-
You can vote for it on the trello, but I can't commit to any timescales.
It is high up in the tilemap requests right now, though.
-
Voted, and removed my vote from autotile just to make it stand out more. Even 90 degrees rotation would get me a long way because I can manage the rest with flipping.
The performance is so much better when using a tilemap! I have to switch back to the sprites though, but only until the rotation gets in.
Thanks for the help!