Hi!
I recently started using 2D Toolkit, and before anything else, I must say it's awesome! Thanks a lot!
Currently I'm working on a
card game, and I came across few issues.
The game is intended for retina iPad has
400 cards. So lots of 2048x2048 atlases will be used for them, and I'm almost certain current devices can't handle that easily and that's just our cards! Since
we will have 40 cards in scene which can be of any combination, many atlases may be loaded in ram and vram only for 1 or 2 cards so huge amount of memory will be wasted that just isn't acceptable.
We initially thought we have to use planes for them and load card texture with Resources.Load(). But then we saw tk2dSpriteCollectionData.CreateFromTexture and tk2dBaseSprite.CreateFromTexture< T >. So here are my questions.
1. Is there any way to use
2D Toolkit's atlas generation in runtime? And will it have same performance as collections created in editor?
I think we could salvage the code used in editor atlas generator but that would be a last resort. It's kind of over the edge even as a last resort.
(If yes, I also like to know can I make it async or do it partially in coroutines so I can have a loading screen?)
2. If no,
does a sprite have any overhead? I mean which one has better performance?
A sprite created by tk2dBaseSprite.CreateFromTexture< T > or simple plane?
(Since we are going to have 40 cards and each one has a
separate texture.)
3. If sprite is still better, is using tk2dBaseSprite.CreateFromTexture< T > code to create a method that
replaces current sprite component with a new one instead of creating a new GameObject ok? Or it may cause problems?