pixi-reels

AnticipationOptions

pixi-reels


pixi-reels / index / AnticipationOptions

Interface: AnticipationOptions

Defined in: config/types.ts:265

Full anticipation configuration. The object form of setAnticipation’s second argument.

Properties#

PropertyTypeDescriptionDefined in
cells?AnticipationCellsEnd the tease after the reel has travelled this many symbol pitches, instead of after a fixed time. See AnticipationCells. duration is a time budget, so how far the reel actually moves during a tease depends on the speed curve: two reels teasing at different speeds pass a different number of symbols. Anchor to travel when the tease is cut to symbols going past the window; anchor to time when it is cut to an audio bed. The anchor applies to the final leg of a curve: earlier legs play in full, and the last one holds until the target is met instead of for its scripted hold. (Measuring from the start of the tease instead would let a fast opening segment burn the whole budget and silently delete the legs after it.) The reel must actually be moving: a final leg at speed 0 can never reach the target, so duration runs as the backstop and a notice is emitted.config/types.ts:316
curve?AnticipationCurveShape the tease as an explicit sequence of speed legs instead of the fixed decelerate-then-hold. See AnticipationCurve. This is what makes a surge-then-crawl tease expressible, and what replaces the ease-on-a-speed feel with a ramped one. Mutually exclusive with slowdown, which is sugar for a two-leg curve; passing both throws rather than silently picking one.config/types.ts:296
duration?numberExplicit tease hold in ms, overriding the active speed profile’s anticipationDelay. Pass a positive value to keep the tease playing in Turbo / SuperTurbo (whose profiles set anticipationDelay: 0, which would otherwise skip anticipation entirely). When slowdown.holdFrom/holdTo are also set, this is the base they scale. With a curve, this is the gate that decides whether the tease runs at all (it must be > 0 in Turbo); the curve’s own segment durations set the length. With cells it is additionally the backstop on the FINAL leg - the longest the tease will wait for the travel target once the curve has played - so the tease can run for as long as the curve plus this value.config/types.ts:286
protect?AnticipationProtectGuarantee the tease becomes visible before a skip press can end it. See AnticipationProtect. Default false.config/types.ts:272
slowdown?AnticipationSlowdown-config/types.ts:267
stagger?AnticipationStagger-config/types.ts:266