Hi!
I'm a new user to 2D Toolkit and I have some strange issues with tk2dSprite.CreateFromTexture.
namely code:
tk2dRuntime.SpriteCollectionSize sz2 = tk2dRuntime.SpriteCollectionSize.ForTk2dCamera();
GameObject spr2 = tk2dSprite.CreateFromTexture(atlas, sz2, new Rect(0, 0, 300,300), new Vector2(0, 0));
spr2.transform.position = new Vector3(-200, -200, 0);
Is working FINE in Unity editor preview (the one when I press play button), but doesn't work when running PC standalone build. Not working meaning it doesn't show up on the screen.
I have one sprite in the scene added at design time and some gui elements to eliminate other problems and they both show up in both runtime environments. For some reason, this dynamically created sprite simply doesn't exist in PC runtime.
I'm sure there is something basically wrong I'm doing, but I'm confused because so far everything in Unity has been behaving consistently across different build targets.
Help please!
While at it, I need this for runtime topview map generation from tilesets. My idea was to group a block of tiles on the map and create a bigger texture (say 1024x1024) and then create sprite from this texture. Thus my map would be generated from smaller tiles, but would actually be rendered as several 1024x1024 sprites.
I tried making one tk2dSprite per tile, but ran into performance issues.
Any additional advice on this problem would be much appreciated!
Thanks!