Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, I was wondering if there are a way to pause the rendering or/and copperlicht engine, then resume it. |
||||
|
Hm, currently, there is no way to do this. But you could probably add something like this by overwriting the timer function. It currently looks like this:
If you overwrite it by returning the same time always if the game is paused, it could work. Maybe. :) |
||||
|
Thanks, yep it works like a charm. |
||||
|
I'm using this code:
Basically, if my Inventory/Stat window is open, I want to pause Copperlicht engine. This is for an RPG game, so realtime pausing to use items, equipment, etc. is kind of the expected norm. You know, you get in a fight, your HP is low, so you pause the game, go into your inventory and drink a potion to restore your HP type of thing. However, my code, which does stop the engine, has some side effects. For example, when it pauses, all my animated meshes move several points higher in height. When the game is unpaused, they fall from this height according to gravity. I also notice when I unpause that Copperlicht redisplays the "Loading..." text as if the scene is being reloaded from scratch. Furthermore, the more I pause and unpause the game, the worse the performance is. One pause and unpause is enough to cause the game to lurch, stutter like crazy. My window is destroyed each time it is closed, so I do not believe the issue is with the window. Rather, since Copperlicht seems to completely reinitialize itself each pause (the models reseting height plus the Loading... text is what gives me that impression) I would assume the issue is more with pausing. Any insight or alternative pausing methods that you can think of? Thanks Niko ;) |
||||
|
I think the reason is that it notices that there is a huge gap between the times the function delivers before and after the pause. So if you just continue to deliver a continuous value, the effect would be reduced. |
||||
|
Can anyone tell me how to stop a copperlicht engine. I have this var engine = startCopperLichtFromFile .... and I was looking forward to seeing an API like engine.Stop(); But it turns out that there is none. I have this html page with various scenes in a dropdown and I want to switch between scenes. Suggestions? A less standard way would be to simply refresh the page. |
||||
|
There is the possibility to add multiple scenes into one file, and switch scenes whenever you want. This is probably what you need? Alternatively, another idea would be - if you prefer multiple files - to embed your 3D website in your website using an iframe HTML tag, and switch the url of that iframe in order to show the scene you need. |
|