SpeedManager
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
| Parameter | Type |
|---|---|
profiles | Map<string, SpeedProfile> |
initialSpeed | string |
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
| Parameter | Type |
|---|---|
name | string |
profile | SpeedProfile |
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
| Parameter | Type |
|---|---|
name | string |
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
| Parameter | Type |
|---|---|
name | string |
Returns
{
current: SpeedProfile;
previous: SpeedProfile;
}
| Name | Type | Defined in |
|---|---|---|
current | SpeedProfile | speed/SpeedManager.ts:48 |
previous | SpeedProfile | speed/SpeedManager.ts:48 |