You understood me perfectly. :)
You can take a screen grab of the scene right before switching it out by using Engine.screenshot(). It creates an HTMLImageElement which you can store directly into a Texture, then assign it to an actor or screen element in the pause scene.
Alternatively, with the solution you've suggested, instead of setting all velocities etc. to zero, you can also disable the physics globally. Just set
Physics.enabled = false. That will preserve the state of the velocities, if I'm not mistaken, because it effectively just stops updating the physics updates. As a bonus, you could keep having the world animate by doing this. But even then, you're going to have to make sure to disable all of your custom logic in the actors' update methods as well.
A third possible solution could be to overload your scene's update() method, make it run super.update() in the normal case and your own custom logic in the paused case. But that one only really makes sense if you're using a custom Scene class. I also have no clue if it breaks anything, though it shouldn't.
Mind that I haven't actually tested any of these yet. But there are plenty of methods to try. :)
Op vrijdag 24 april 2020 18:37:43 UTC+2 schreef Thomer Gil: