docs: add pausing guide#103
Conversation
| obj.paused = true; | ||
| ``` | ||
|
|
||
| When an object is paused, its `GameObjRaw.onUpdate()` event no longer runs, and no event listeners attached to it are triggered. It will only continue to be drawn (`GameObjRaw.hidden` can control that). The same applies to its children. Because of this, you can't attach any unpause logic to the object itself, as it would be impossible for it to react afterward. |
There was a problem hiding this comment.
Because of this, you can't attach any unpause logic to the object itself, as it would be impossible for it to react afterward.
This might have to be updated after kaplayjs/kaplay#1041 is merged
There was a problem hiding this comment.
Ok so, basically once it merges, v4000 guide will be updated that its possible to have children to have a separate/retained paused state, right? The quoted part is also the outcome/side effect of that? Is there any other difference?
There was a problem hiding this comment.
No, it doesn't change anything about the properties, just that you get events fr paused/unpaused/hidden/shown and so can add state management logic and react to the being paused/unpaused.
There was a problem hiding this comment.
I looked at the playtest so I was addressing this comment // this will unpause only the parent a because b is already paused which sounded like children will retain its paused state. Will just discuss again once that merges.
There was a problem hiding this comment.
I looked at the playtest so I was addressing this comment
// this will unpause only the parent a because b is already pausedwhich sounded like children will retain its paused state. Will just discuss again once that merges.
That comment is still true today, the only thing new is the events that react to pause state changes.
|
Added some more details. We also talked with @mflerackers to update Pause Menu kaplayground example as well so it doesn't look broken. I spotted a lot of bugs doing so, so will file them and will try to work around them if possible. |
|
Added recent findings that go in hand with pauseMenu example that I will update in a bit as well. In which order of objects matters when pausing or when unpasing has to be deferred. |
Adds Pausing guide - how to pause game or game objects and related stuff with KAPLAYGROUND Pause Menu example linked.