I have one question regarding accessing a sprite tile…
When setting a frame the animation is still running. How can I stop (pause) a sprite animation on one specific tile?
UPDATE: I guess accessing one tile is not possible, so my question is now :)… How can I make sure the sprite animation is not played, but still can be accessed with :setFrame() ?
UPDATE2: Looking into dusk_core/run/anim.lua I found from line 142 on the following code:
if d.watchTile then d.watchTile:setFrame(((d.currentFrame + 1) % d.frameCount) + 1) d.watchTile:play() anim.sync(d, d.watchTile.frame) end
I think this code is preventing accessing :setFrame() and :pause() correctly, because whenever I try to use it the frames still are jumping or the animation still is running. I tried to pause() the animation to jump between different frames, but I’m not able to pause the sprite animation from the beginning. The animations is running for some frames before pausing OR not pausing at all.
Is anyone else accessing the sprite animation and give me some tips on how to handle frame changing and pausing animations correctly?
(Sure I could change the code in anim.lua, but then it would influence all sprite animations and with an update I have to keep track of my own code changes.)
AND ONE MORE THING: I noticed when playing with the anim.lua when removing the “d.watchTile:play()” and then setting a sprite anim frame with “:setFrame(1)” things seem to work BUT when moving the map forth and back all the tiles which were outside the visible screen borders are using a different sprite frame when being back on screen or moving on the screen for the first time. So culling tiles and setting frames seem to be a problem. Any idea on how to use culling but also the correct set frames on all tiles (visible and off screen)?