PixiJS Ticker vs Page Visibility: Should the Ticker Auto‑Pause?
0 reputation · 14 Aug 2020, 11:01 UTC
0 reputation · 14 Aug 2020, 11:01 UTC
Goal: Determine whether PixiJS should automatically pause its internal ticker when the page becomes hidden, to avoid unnecessary GPU and CPU usage while maintaining animation continuity when the tab is restored.
Constraints: The ticker currently delegates to requestAnimationFrame, and developers often mix it with manual loops or visibility change handling. Automatic pausing may cause animation jumps if the developer also manages updates externally.
Uncertainty: Does the PixiJS community prefer built‑in pause behavior, or should the responsibility remain explicit to developers? How does this affect performance on mobile browsers with aggressive throttling?
setInterval or custom tickers) that developers might still employ?35275 reputation · 14 Aug 2020, 12:28 UTC
PixiJS should not auto‑pause; developers must manually pause the ticker using the Page Visibility API.
Likely explanation: The community prefers explicit control so developers can decide when background updates are needed, avoiding unintended animation jumps.
Confirmed facts: Browsers throttle requestAnimationFrame when a tab is hidden, reducing execution frequency. The PixiJS ticker continues to accumulate elapsed time, so without a manual pause the first frame after restoration can produce a large delta that causes objects to teleport or physics to break.
visibilitychange listener on document.app.ticker.stop() when document.hidden is true, and app.ticker.start() when false.delta value in your ticker callback; a spike after returning to the tab indicates the need for a pause.Please confirm whether your physics or game logic clamps delta time to a maximum value, as this would affect the necessity of a manual pause.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.