Namespace: ticker

ticker

Tickers provide periodic callbacks based on the system clock. Your game update logic will generally be run in response to a tick once per frame. You can have multiple tickers in use at one time.

import { Ticker } from 'pixi.js';

const callback = (ticker: Ticker) => {
   // do something on the next animation frame
};

// create a ticker
const ticker = new Ticker();

// register the callback and start the ticker
ticker.add(callback);
ticker.start();

You can always use the shared ticker that Pixi renders with by default.

Ticker.shared.add(callback);

Classes

Ticker

Enums

UPDATE_PRIORITYnumber

Represents the update priorities used by internal Pixi classes when registered with the Ticker object. Higher priority items are updated first and lower priority items, such as render, should go later.

Properties:
Name Default Description
HIGH 25

High priority updating, used by AnimatedSprite

INTERACTION 50

Highest priority used for interaction events in EventSystem

LOW -25

Low priority used for Application rendering.

NORMAL 0

Default priority for ticker events, see Ticker#add.

UTILITY -50

Lowest priority used for BasePrepare utility.

Type Definitions

TickerCallback

A callback which can be added to a ticker.

ticker.add(() => {
   // do something every frame
});