Hello, and thanks in advance.
Sorry for my english, im not a english speaker, hope you understand me :)
I make a custom atlasSpriteManager superclass that i use for all my "monsters" of my future game, why directly an atlasspritemanager instead of a normal node with an added spritemanager? cause i notice a boost in speed. Ok since here no problem.
The problem began when i started to create ASM with more than 1 atlas sprite sheet, one of them uses 3 PNGs files with all the animations, the animation runned depends on the state of my "monster", one state for each PNG file, so when i change the state i change the file using:
[self setTexture:[[Texture sharedTextureMgr] addImage:@"monsterXstateX.png"]];
of course, all my image files are preloaded on before the game starts.
But when i first change the texture of the ASM, the game freezes 1 second, i checked all and finally noticed that the freeze its because the texture change in runtime. But the best part its that that freeze only happens the first time the change happens, i mean, if i have 3 monsters of the same type in the screen, the freeze only happens when i hit the first one, but the 2nd, 3rd, and all the rest of them, dont freeze, just the first time in all the application. Its like it needs to preload anyway.
Anyone knows how can i preload that change before it happens when the game its started?
Using the [[Texture sharedTextureMgr] addImage:@"monsterXstateX.png"] as all my other images, dosent work.
I know that i can use 2 ASM each one for each file, but then i need to change ALL the other monsters than dont use more than 1 file, and the game performance will be lot lower, cause i need another extra node that keeps the ASMs and kills some of the performance. Im searching a good way to continue using only a ASM and the game dont freeze the first time i change the file.