pixi-reels

SpeedManager

pixi-reels


pixi-reels / index / SpeedManager

Class: SpeedManager

Defined in: speed/SpeedManager.ts:18

The tempo of your reels, as named presets.

A SpeedProfile is a bundle of timings. how long the wind-up takes, how fast the reel scrolls at full speed, how deep the landing bounce is, which GSAP easing drives each transition. SpeedManager holds those profiles by name and tracks which one is active.

Built-in profiles: normal (default), turbo, superTurbo. Add your own via reelSet.speed.addProfile('cinematic', {...}). Switch at runtime with reelSet.setSpeed('turbo').

Speed changes take effect on the next spin. mid-spin switching is deliberately not supported to keep animation state simple.

Constructors#

Constructor#

new SpeedManager(profiles: Map<string, SpeedProfile>, initialSpeed: string): SpeedManager;

Defined in: speed/SpeedManager.ts:23

Parameters#

ParameterType
profilesMap<string, SpeedProfile>
initialSpeedstring

Returns#

SpeedManager

Accessors#

active#

Get Signature#

get active(): Readonly<SpeedProfile>;

Defined in: speed/SpeedManager.ts:38

The currently active speed profile.

Returns

Readonly<SpeedProfile>


activeName#

Get Signature#

get activeName(): string;

Defined in: speed/SpeedManager.ts:43

Name of the currently active speed profile.

Returns

string


profileNames#

Get Signature#

get profileNames(): string[];

Defined in: speed/SpeedManager.ts:72

All registered profile names.

Returns

string[]

Methods#

addProfile()#

addProfile(name: string, profile: SpeedProfile): void;

Defined in: speed/SpeedManager.ts:62

Add or replace a speed profile.

Parameters#

ParameterType
namestring
profileSpeedProfile

Returns#

void


getProfile()#

getProfile(name: string): SpeedProfile | undefined;

Defined in: speed/SpeedManager.ts:67

Get a profile by name, or undefined if not found.

Parameters#

ParameterType
namestring

Returns#

SpeedProfile | undefined


set()#

set(name: string): {
  current: SpeedProfile;
  previous: SpeedProfile;
};

Defined in: speed/SpeedManager.ts:48

Switch to a different named speed profile.

Parameters#

ParameterType
namestring

Returns#

{
  current: SpeedProfile;
  previous: SpeedProfile;
}
NameTypeDefined in
currentSpeedProfilespeed/SpeedManager.ts:48
previousSpeedProfilespeed/SpeedManager.ts:48