# Interface: TickerValue (/jsdoc/pixi-vn/index/interfaces/TickerValue)



Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:67

A Ticker class that runs an update loop that other objects listen to.
Used for managing animation frames and timing in a PixiJS application.

It provides a way to add listeners that will be called on each frame,
allowing for smooth animations and updates.

Time Units [#time-units]

* `deltaTime`: Dimensionless scalar (typically \~1.0 at 60 FPS) for frame-independent animations
* `deltaMS`: Milliseconds elapsed (capped and speed-scaled) for time-based calculations
* `elapsedMS`: Raw milliseconds elapsed (uncapped, unscaled) for measurements
* `lastTime`: Timestamp in milliseconds since epoch (performance.now() format)

Animation frames are requested
only when necessary, e.g., when the ticker is started and the emitter has listeners.

Example [#example]

```ts
// Basic ticker usage with different time units
const ticker = new Ticker();
ticker.add((ticker) => {
    // Frame-independent animation using dimensionless deltaTime
    sprite.rotation += 0.1 * ticker.deltaTime;

    // Time-based animation using deltaMS (milliseconds)
    sprite.x += (100 / 1000) * ticker.deltaMS; // 100 pixels per second
});
ticker.start();

// Control update priority
ticker.add(
    (ticker) => {
        // High priority updates run first
        physics.update(ticker.deltaTime);
    },
    undefined,
    UPDATE_PRIORITY.HIGH
);

// One-time updates
ticker.addOnce(() => {
    console.log('Runs on next frame only');
});
```

See [#see]

* TickerPlugin For use with Application
* [UPDATE\_PRIORITY](/jsdoc/pixi-vn/index/variables/UPDATE_PRIORITY) For priority constants
* TickerCallback For listener function type

Standard [#standard]

Properties [#properties]

autoStart [#autostart]

\> **autoStart**: `boolean`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:118

Whether or not this ticker should invoke the method [start](#start)
automatically when a listener is added.

Example [#example-1]

```ts
// Default behavior (manual start)
const ticker = new Ticker();
ticker.autoStart = false;
ticker.add(() => {
    // Won't run until ticker.start() is called
});

// Auto-start behavior
const autoTicker = new Ticker();
autoTicker.autoStart = true;
autoTicker.add(() => {
    // Runs immediately when added
});
```

Default [#default]

```ts
false
```

See [#see-1]

* [Ticker#start](#start) For manually starting the ticker
* [Ticker#stop](#stop) For manually stopping the ticker

***

deltaMS [#deltams]

\> **deltaMS**: `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:160

Scalar time elapsed in milliseconds from last frame to this frame.
Provides precise timing for animations and updates.

This value is capped by setting [minFPS](#minfps)
and is scaled with [speed](#speed).

If the platform supports DOMHighResTimeStamp,
this value will have a precision of 1 µs.

Defaults to target frame time

\> \[!NOTE] The cap may be exceeded by scaling.

Example [#example-2]

```ts
// Animation timing
ticker.add((ticker) => {
    // Use millisecond timing for precise animations
    const progress = (ticker.deltaMS / animationDuration);
    sprite.alpha = Math.min(1, progress);
});
```

Default [#default-1]

```ts
16.66
```

***

deltaTime [#deltatime]

\> **deltaTime**: `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:135

Scalar representing the delta time factor.
This is a dimensionless value representing the fraction of a frame at the target framerate.
At 60 FPS, this value is typically around 1.0.

This is NOT in milliseconds - it's a scalar multiplier for frame-independent animations.
For actual milliseconds, use [Ticker#deltaMS](#deltams).

Example [#example-3]

```ts
// Frame-independent animation using deltaTime scalar
ticker.add((ticker) => {
    // Rotate sprite by 0.1 radians per frame, scaled by deltaTime
    sprite.rotation += 0.1 * ticker.deltaTime;
});
```

***

elapsedMS [#elapsedms]

\> **elapsedMS**: `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:173

Time elapsed in milliseconds from the last frame to this frame.
This value is not capped or scaled and provides raw timing information.

Unlike [Ticker#deltaMS](#deltams), this value is unmodified by speed scaling or FPS capping.

Example [#example-4]

```ts
ticker.add((ticker) => {
    console.log(`Raw frame time: ${ticker.elapsedMS}ms`);
});
```

***

lastTime [#lasttime]

\> **lastTime**: `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:188

The last time update was invoked, in milliseconds since epoch.
Similar to performance.now() timestamp format.

Used internally for calculating time deltas between frames.

Example [#example-5]

```ts
ticker.add((ticker) => {
    const currentTime = performance.now();
    const timeSinceLastFrame = currentTime - ticker.lastTime;
    console.log(`Time since last frame: ${timeSinceLastFrame}ms`);
});
```

***

speed [#speed]

\> **speed**: `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:208

Factor of current [deltaTime](#deltatime).
Used to scale time for slow motion or fast-forward effects.

Example [#example-6]

```ts
// Basic speed adjustment
ticker.speed = 0.5; // Half speed (slow motion)
ticker.speed = 2.0; // Double speed (fast forward)

// Temporary speed changes
function slowMotion() {
    const normalSpeed = ticker.speed;
    ticker.speed = 0.2;
    setTimeout(() => {
        ticker.speed = normalSpeed;
    }, 1000);
}
```

***

started [#started]

\> **started**: `boolean`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:229

Whether or not this ticker has been started.

`true` if [start](#start) has been called.
`false` if [Stop](#stop) has been called.

While `false`, this value may change to `true` in the
event of [autoStart](#autostart) being `true`
and a listener is added.

Example [#example-7]

```ts
// Check ticker state
const ticker = new Ticker();
console.log(ticker.started); // false

// Start and verify
ticker.start();
console.log(ticker.started); // true
```

Accessors [#accessors]

count [#count]

Get Signature [#get-signature]

\> **get** **count**(): `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:397

The number of listeners on this ticker, calculated by walking through linked list.

Example [#example-8]

```ts
// Check number of active listeners
const ticker = new Ticker();
console.log(ticker.count); // 0

// Add some listeners
ticker.add(() => {});
ticker.add(() => {});
console.log(ticker.count); // 2

// Check after cleanup
ticker.destroy();
console.log(ticker.count); // 0
```

See [#see-2]

* [Ticker#add](#add) For adding listeners
* [Ticker#remove](#remove) For removing listeners

Returns [#returns]

`number`

***

FPS [#fps]

Get Signature [#get-signature-1]

\> **get** **FPS**(): `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:479

The frames per second at which this ticker is running.
The default is approximately 60 in most modern browsers.
\> \[!NOTE] This does not factor in the value of
\> [speed](#speed), which is specific
\> to scaling [deltaTime](#deltatime).

Example [#example-9]

```ts
// Basic FPS monitoring
ticker.add(() => {
    console.log(`Current FPS: ${Math.round(ticker.FPS)}`);
});
```

Returns [#returns-1]

`number`

***

maxFPS [#maxfps]

Get Signature [#get-signature-2]

\> **get** **maxFPS**(): `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:535

Manages the minimum amount of milliseconds required to
elapse between invoking [update](#update).

This will effect the measured value of [FPS](#fps).

If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can.
Otherwise it will be at least `minFPS`.

If `maxFPS` is set below the current `minFPS`, `minFPS` is automatically lowered to match.
This keeps the two limits consistent.

Example [#example-10]

```ts
// Cap the frame rate
const ticker = new Ticker();
ticker.maxFPS = 60; // Never go above 60 FPS

// Use with minFPS for frame rate clamping
ticker.minFPS = 30;
ticker.maxFPS = 60;

// maxFPS below minFPS pushes minFPS down
ticker.maxFPS = 20; // minFPS is now also 20
```

Default [#default-2]

```ts
0
```

Returns [#returns-2]

`number`

Set Signature [#set-signature]

\> **set** **maxFPS**(`fps`): `void`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:536

Parameters [#parameters]

fps [#fps-1]

`number`

Returns [#returns-3]

`void`

***

minFPS [#minfps]

Get Signature [#get-signature-3]

\> **get** **minFPS**(): `number`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:507

Manages the maximum amount of milliseconds allowed to
elapse between invoking [update](#update).

This value is used to cap [deltaTime](#deltatime),
but does not effect the measured value of [FPS](#fps).

When setting this property it is clamped to a value between
`0` and `Ticker.targetFPMS * 1000` (typically 60).

If `maxFPS` is currently set (non-zero) and `minFPS` is set above it,
`maxFPS` is automatically raised to match. This keeps the two limits consistent.

Example [#example-11]

```ts
// Set minimum acceptable frame rate
const ticker = new Ticker();
ticker.minFPS = 30; // Never go below 30 FPS

// Use with maxFPS for frame rate clamping
ticker.minFPS = 30;
ticker.maxFPS = 60;

// minFPS above maxFPS pushes maxFPS up
ticker.minFPS = 50; // maxFPS is raised to 50
```

Default [#default-3]

```ts
10
```

Returns [#returns-4]

`number`

Set Signature [#set-signature-1]

\> **set** **minFPS**(`fps`): `void`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:508

Parameters [#parameters-1]

fps [#fps-2]

`number`

Returns [#returns-5]

`void`

Methods [#methods]

add() [#add]

\> **add**\<`T`>(`fn`, `context?`, `priority?`): `this`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:296

Register a handler for tick events.

Type Parameters [#type-parameters]

T [#t]

`T` = `any`

Parameters [#parameters-2]

fn [#fn]

`TickerCallback`\<`T`>

The listener function to add. Receives the Ticker instance as parameter

context? [#context]

`T`

The context for the listener

priority? [#priority]

`number`

The priority of the listener

Returns [#returns-6]

`this`

Example [#example-12]

```ts
// Access time properties through the ticker parameter
ticker.add((ticker) => {
    // Use deltaTime (dimensionless scalar) for frame-independent animations
    sprite.rotation += 0.1 * ticker.deltaTime;

    // Use deltaMS (milliseconds) for time-based calculations
    const progress = ticker.deltaMS / animationDuration;

    // Use elapsedMS for raw timing measurements
    console.log(`Raw frame time: ${ticker.elapsedMS}ms`);
});
```

***

addOnce() [#addonce]

\> **addOnce**\<`T`>(`fn`, `context?`, `priority?`): `this`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:332

Add a handler for the tick event which is only executed once on the next frame.

Type Parameters [#type-parameters-1]

T [#t-1]

`T` = `any`

Parameters [#parameters-3]

fn [#fn-1]

`TickerCallback`\<`T`>

The listener function to be added for one update

context? [#context-1]

`T`

The listener context

priority? [#priority-1]

`number`

The priority for emitting (default: UPDATE\_PRIORITY.NORMAL)

Returns [#returns-7]

`this`

This instance of a ticker

Example [#example-13]

```ts
// Basic one-time update
ticker.addOnce(() => {
    console.log('Runs next frame only');
});

// With specific context
const game = {
    init(ticker) {
        this.loadResources();
        console.log('Game initialized');
    }
};
ticker.addOnce(game.init, game);

// With priority
ticker.addOnce(
    () => {
        // High priority one-time setup
        physics.init();
    },
    undefined,
    UPDATE_PRIORITY.HIGH
);
```

See [#see-3]

* [Ticker#add](#add) For continuous updates
* [Ticker#remove](#remove) For removing handlers

***

destroy() [#destroy]

\> **destroy**(): `void`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:439

Destroy the ticker and don't use after this. Calling this method removes all references to internal events.

Returns [#returns-8]

`void`

Example [#example-14]

```ts
// Clean up with active listeners
const ticker = new Ticker();
ticker.add(() => {});
ticker.destroy(); // Removes all listeners
```

See [#see-4]

* [Ticker#stop](#stop) For stopping without destroying
* [Ticker#remove](#remove) For removing specific listeners

***

remove() [#remove]

\> **remove**\<`T`>(`fn`, `context?`): `this`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:375

Removes any handlers matching the function and context parameters.
If no handlers are left after removing, then it cancels the animation frame.

Type Parameters [#type-parameters-2]

T [#t-2]

`T` = `any`

Parameters [#parameters-4]

fn [#fn-2]

`TickerCallback`\<`T`>

The listener function to be removed

context? [#context-2]

`T`

The listener context to be removed

Returns [#returns-9]

`this`

This instance of a ticker

Example [#example-15]

```ts
// Basic removal
const onTick = () => {
    sprite.rotation += 0.1;
};
ticker.add(onTick);
ticker.remove(onTick);

// Remove with context
const game = {
    update(ticker) {
        this.physics.update(ticker.deltaTime);
    }
};
ticker.add(game.update, game);
ticker.remove(game.update, game);

// Remove all matching handlers
// (if same function was added multiple times)
ticker.add(onTick);
ticker.add(onTick);
ticker.remove(onTick); // Removes all instances
```

See [#see-5]

* [Ticker#add](#add) For adding handlers
* [Ticker#addOnce](#addonce) For one-time handlers

***

start() [#start]

\> **start**(): `void`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:413

Starts the ticker. If the ticker has listeners a new animation frame is requested at this point.

Returns [#returns-10]

`void`

Example [#example-16]

```ts
// Basic manual start
const ticker = new Ticker();
ticker.add(() => {
    // Animation code here
});
ticker.start();
```

See [#see-6]

* [Ticker#stop](#stop) For stopping the ticker
* [Ticker#autoStart](#autostart) For automatic starting
* [Ticker#started](#started) For checking ticker state

***

stop() [#stop]

\> **stop**(): `void`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:426

Stops the ticker. If the ticker has requested an animation frame it is canceled at this point.

Returns [#returns-11]

`void`

Example [#example-17]

```ts
// Basic stop
const ticker = new Ticker();
ticker.stop();
```

See [#see-7]

* [Ticker#start](#start) For starting the ticker
* [Ticker#started](#started) For checking ticker state
* [Ticker#destroy](#destroy) For cleaning up the ticker

***

update() [#update]

\> **update**(`currentTime?`): `void`

Defined in: node\_modules/pixi.js/lib/ticker/Ticker.d.ts:463

Triggers an update.

An update entails setting the
current [elapsedMS](#elapsedms),
the current [deltaTime](#deltatime),
invoking all listeners with current deltaTime,
and then finally setting [lastTime](#lasttime)
with the value of currentTime that was provided.

This method will be called automatically by animation
frame callbacks if the ticker instance has been started
and listeners are added.

Parameters [#parameters-5]

currentTime? [#currenttime]

`number`

The current time of execution (defaults to performance.now())

Returns [#returns-12]

`void`

Example [#example-18]

```ts
// Basic manual update
const ticker = new Ticker();
ticker.update(performance.now());
```

See [#see-8]

* [Ticker#deltaTime](#deltatime) For frame delta value
* [Ticker#elapsedMS](#elapsedms) For raw elapsed time
