feat: add pause, unpause, show, hide events & hook it into broadphase#1041
feat: add pause, unpause, show, hide events & hook it into broadphase#1041dragoncoder047 wants to merge 15 commits into
Conversation
|
Isn't the resize observer observing canvas? So if you have own canvas with dimensions set on page, it wouldn't trigger onTabResize even if window is resized until the canvas itself gets resized as well - which would be then misleading. Shouldn't it be kept as onResize then? By default canvas is set to window viewport dimensions and is mostly used like that, but it's not the only way, if true. |
|
|
||
| ### Added | ||
|
|
||
| - The `onHide` and `onShow` global handlers (which have been deprecated for a |
There was a problem hiding this comment.
Still should be marked as a breaking change, so add (!) in front
- - The `onHide` and `onShow` global handlers...
+ - **(!)** The `onHide` and `onShow` global handlers...|
And would also remove the broadphase hooking since it's possible of ending up hurting the perf, or at least it's uncertain. I confirmed it with MF as well. Offscreen with sidescrollers might be a good example when paused/unpaused is triggered on and off a lot. Adding/removing for some broadphase algos can be in particular more expensive (inserting in all overlapping grid square or correct branch in quadtree). With skipping we at least know what we are at now, no uncertainty after. So unless we do proper testing of it behaving in more situations across broadphase algos, I would rather remove for now. You can always revisit later, to not block the events feature itself. What do you think? |
Please describe what issue(s) this PR fixes.
closes #844 mostly.
Summary