pixijs-ticker

Guide PixiJS Ticker delta time usage and update scheduling for per-frame logic.

16|8|Updated May 20, 2020
One-click install
npx skills add https://github.com/encounterplus/web-client --skill pixijs-ticker-encounterplus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pixijs-ticker
Source: https://github.com/encounterplus/web-client/tree/main/.agents/skills/pixijs-ticker
Command: npx skills add https://github.com/encounterplus/web-client --skill pixijs-ticker-encounterplus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you implement reliable per-frame logic in PixiJS by using the Ticker’s timing and ordering correctly, avoiding common delta misunderstandings that cause animations to run too fast, too slow, or inconsistently.

Core Features & Use Cases

  • Correct time-step handling: Use deltaTime, deltaMS, and elapsedMS for the right kinds of calculations (frame-rate-independent multipliers vs real-time milliseconds vs raw profiling).
  • Deterministic callback ordering: Schedule updates with UPDATE_PRIORITY so physics, animation, and render-adjacent work happen in the intended sequence.
  • Frame-rate control and stability: Apply maxFPS and minFPS capping to prevent frame drops from producing huge simulation steps.
  • Object-bound per-frame hooks: Use sprite.onRender for per-display-object logic during scene traversal.
  • Lifecycle and rendering control: Understand when to use app.ticker, how app.start()/stop() affect the render loop, and how to manually drive updates via ticker.update() and app.render().

Quick Start

Add an update callback using the Ticker instance parameter to rotate and move a sprite using ticker.deltaTime and ticker.deltaMS, while capping the ticker with app.ticker.maxFPS and enabling a per-object onRender hook for render-adjacent effects.

Frequently Asked Questions about pixijs-ticker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do my PixiJS animations run too fast or inconsistently across different browser frame rates?

PixiJS animations run inconsistently when per-frame logic ignores time deltas. Use the Ticker callback's `deltaTime` for frame-rate-independent multipliers and `deltaMS` for real-time millisecond calculations to ensure stable animation timing.

How do I schedule physics and render updates in a specific order using the PixiJS Ticker?

Schedule deterministic update ordering in the PixiJS Ticker by assigning `UPDATE_PRIORITY` to callbacks. This ensures physics stepping, UI animation, and render-adjacent work execute in the intended sequence during the game loop.

What is the difference between deltaTime, deltaMS, and elapsedMS in PixiJS Ticker?

In PixiJS Ticker, `deltaTime` provides a frame-rate-independent multiplier, `deltaMS` offers real-time milliseconds for physics stepping, and `elapsedMS` gives raw profiling time since the last update for precise render-loop control.

How do I cap frame rates to prevent large simulation steps during lag in PixiJS?

Cap frame rates in PixiJS by configuring `app.ticker.maxFPS` and `minFPS`. This prevents frame drops from producing huge simulation steps, maintaining frame-rate control and physics stability during heavy game loops.

Can I manually drive the render loop instead of using app.ticker in PixiJS?

You can manually drive the PixiJS render loop by using `app.ticker.update()` and `app.render()`. This lifecycle control bypasses automatic updates, allowing custom update scheduling and manual rendering alongside `app.start()` and `stop()`.

How do I attach per-frame logic to a specific sprite during scene traversal in PixiJS?

Attach per-frame logic to a specific sprite in PixiJS by using the `sprite.onRender` hook. This object-bound callback executes render-adjacent effects during scene traversal without adding a global Ticker callback.