Closed sushi1986 closed 9 years ago
Hi @sushi1986,
If you were to change JSTileMap to use SKTextureAtlas instead of SKTexture then you would want to replace the TMXTilesetInfo atlasTexture with your SKTextureAtlas. This is loaded in the setSourceImage: method.
@sushi1986 I hope you got this taken care of. Feel free to leave a comment here about your resolution. If you have any additional questions please create a new issue.
Hi there,
I am using your tile map implementation and there are little problems. If I try to move the map with "position.x += 0.1", there will be little glitches when Sprite Kit loads new sprites. Every time a column or row of tiles disappears and a new one should appear there are little black lines between the tiles. I could observe this behavior on different iPhones with different maps (Including your examples).
After reading issue #14 and JRams post
"I did some extensive performance testing and Spritekit's native batch rendering is much much faster than using a tilemap. I tested the exact same maps and assets on both (using tilemap vs using raw png's and adding actions to those).
This doesn't really make much sense to me since I thought breaking big images into tiles should result in better performance. I guess Spritekit does a better job optimizing and batch rendering than I thought."
I tried to include a SKTextureMap and this solves my problem. There were no glitches anymore. I replaced the function "textureForGid:(int)gid" with: " -(SKTexture*)textureForGid:(int)gid {
} "
But I don't know exactly where to init the texture atlases. I thought I should do it in "-(void)setSourceImage:(NSString *)sourceImage" but there sourceImage contains the full path to the image.
Can you help me to find a good position for initializing the needed SKTextureAtlas? Perhaps you could provide an alternative implementation of your map here on github.
Thanks,
sushi1986