I’m having an odd behavior I don’t understand. I’m on macOS 15.7.4 using Defold 1.12.2.
I’m trying to use downloaded images as sprite textures, and it seems to work quite well, except that when I animate moving the game object the image sometimes flips horizontally or vertically spontaneously. It may do this once, or flicker between flipped and unflipped versions. Once in a while, the image disappears altogether. I can’t see a pattern to it.
The big picture is that I download a JPG or PNG over HTTP, use image.load_buffer to read it, create a dynamic texture and atlas using resource.create_texture and resource.create_atlas, and then go.set the sprite’s image property to the created atlas. The texture and atlas are created in the script for the game object where they are used, and they are released with resource.release in that game object’s final function. I can post this code if it would help, but it’s not in a public repo.
I’m creating several of these game objects from a factory, using different images. I animate each object using this code:
go.animate(id, "position.y", go.PLAYBACK_ONCE_FORWARD, pos.y+dy,
go.EASING_LINEAR, seconds, 0,
function() go.delete(id, true) end)
That is, I’m just moving it down the screen over a few seconds and then deleting it. The effect doesn’t seem to depend on the specific image, different images are affected or unaffected every time I test. The only animation taking place is the line quoted above run for each object. Does anyone have any idea what may be happening or suggestions for how I can troubleshoot?
Here’s a short video of the effect. The images are Steam capsules from a bunch of games. The obvious worst behavior is for Arcade Paradise in the column right of middle, but there are several misbehaviors in the 5-second clip. Help appreciated.