czyzby/gdx-lml

[LML] AnimatedImage and non-continuous rendering

metaphore opened this issue · 2 comments

It appears like AnimatedImage is not compatible with non-continuous rendering mode, and should call Gdx.graphics.requestRendering() inside of Actor#act().

I feel like non-continuous rendering case was just dropped during development and never tested. So maybe there is more code that doesn't not support it in the repo.

Gdx.graphics.requestRendering() will be called after each frame update.

Unfortunately this won't work, since updateFrame() triggers by counter from act(float) and thus requires act(float) to be called continuously every frame.

I'm afraid the easiest way to solve this is to call Gdx.graphics.requestRendering() inside of act(float). There is also another way to update frames - use Timer, but this will involve a bit more changes and also few more checks should be considered due to Timer may trigger callbacks after related actor removed from the stage...