Skip to content

feat: add pause, unpause, show, hide events & hook it into broadphase#1041

Open
dragoncoder047 wants to merge 14 commits intokaplayjs:masterfrom
dragoncoder047:pauseunpauseevents
Open

feat: add pause, unpause, show, hide events & hook it into broadphase#1041
dragoncoder047 wants to merge 14 commits intokaplayjs:masterfrom
dragoncoder047:pauseunpauseevents

Conversation

@dragoncoder047
Copy link
Copy Markdown
Contributor

Please describe what issue(s) this PR fixes.

closes #844 mostly.

  • Adds onPause, onUnpause, onHide, onUnhide
  • renames onResize for good measure too
  • hooks the broadphase to add and remove objects when they're paused or unpaused, rather than just always skipping them (the performance impact should be negligible since it's just strange to be spam unpausing and repausing objects every frame)

Summary

  • Changeloged

@imaginarny
Copy link
Copy Markdown
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: onPause and onUnpause events

2 participants