pixi-reels

AnticipationSegment

pixi-reels


pixi-reels / index / AnticipationSegment

Interface: AnticipationSegment

Defined in: config/types.ts:169

One leg of an AnticipationCurve: reach a speed, optionally sit there.

Speeds are multiples of the active profile’s spinSpeed, so 0.15 is a crawl, 1 is normal, and 1.8 is a surge - the tease is not obliged to slow down.

Properties#

PropertyTypeDescriptionDefined in
durationnumberMilliseconds to get there from whatever the reel is doing now.config/types.ts:173
ease?stringGSAP ease for the transition. Default 'power2.inOut'. The default deliberately differs from the legacy power2.out. An ease-out applied to a SPEED value means the deceleration is at its maximum on the first frame and decays from there - acceleration steps from nothing to its peak instantly, which is why the old tease reads as a setting change rather than as the reel slowing down. An inOut ease ramps the acceleration in and out, which is the S-shape a pedal produces.config/types.ts:184
hold?numberMilliseconds to hold this speed once reached. Default 0.config/types.ts:186
speednumberTarget speed as a multiple of spinSpeed. Must be >= 0.config/types.ts:171