LogoPixi’VN
pixi-jsClasses

Class: TickerPlugin

Defined in: node_modules/pixi.js/lib/app/TickerPlugin.d.ts:132

Middleware for Application's Ticker functionality. This plugin manages the animation loop and update cycle of your PixiJS application.

Adds the following features to Application:

  • ticker: Access to the application's ticker
  • start: Start the animation loop
  • stop: Stop the animation loop

Example

import { Application, TickerPlugin, extensions } from 'pixi.js';

// Create application
const app = new Application();

// Example 1: Basic ticker usage (default autoStart)
await app.init({ autoStart: true });      // Starts ticker automatically

// Example 2: Manual ticker control
await app.init({ autoStart: false });     // Don't start automatically
app.start();                              // Start manually
app.stop();                               // Stop manually

// Example 3: Add custom update logic
app.ticker.add((ticker) => {
    // Run every frame, delta is the time since last update
    sprite.rotation += 0.1 * ticker.deltaTime;
});

// Example 4: Control update priority
import { UPDATE_PRIORITY } from 'pixi.js';

app.ticker.add(
    (ticker) => {
        // Run before normal priority updates
    },
    null,
    UPDATE_PRIORITY.HIGH
);

// Example 5: One-time update
app.ticker.addOnce(() => {
    console.log('Runs next frame only');
});

See

Standard

Constructors

Constructor

> new TickerPlugin(): TickerPlugin

Returns

TickerPlugin

Properties

start

> static start: () => void

Defined in: node_modules/pixi.js/lib/app/TickerPlugin.d.ts:136

Internal

Returns

void


stop

> static stop: () => void

Defined in: node_modules/pixi.js/lib/app/TickerPlugin.d.ts:138

Internal

Returns

void


ticker

> static ticker: Ticker

Defined in: node_modules/pixi.js/lib/app/TickerPlugin.d.ts:142

Internal