pixi-reels

SwapSymbolsOptions

pixi-reels


pixi-reels / index / SwapSymbolsOptions

Interface: SwapSymbolsOptions

Defined in: core/ReelSet.ts:122

Options for ReelSet.swapSymbols. Every field is optional; the defaults play every cell out together, swap, and play every cell in together.

Properties#

PropertyTypeDescriptionDefined in
holdMs?numberPause between the swap and the IN beat, in ms. Default 0. This is the beat a reveal usually wants: the board is empty, the sound lands, then the new symbol arrives.core/ReelSet.ts:135
inDelay?| number | ((swap: SymbolSwap, index: number) => number)Same for the IN beat. Default 0.core/ReelSet.ts:129
onSwapped?() => void | Promise<void>Called after the identities are swapped and before anything animates in, with the board sitting empty. Its returned promise is awaited, so it can hold the beat on a real animation rather than a guessed number of ms. Runs after holdMs, so the two compose.core/ReelSet.ts:142
outDelay?| number | ((swap: SymbolSwap, index: number) => number)Per-cell start delay for the OUT beat, in seconds. Default 0. Pass (swap, i) => i * 0.04 to peel the cells away one at a time.core/ReelSet.ts:127
signal?AbortSignalAbort signal. Aborting fast-forwards every in-flight beat to its end pose and still performs the swap, so the board is never left half-changed. The promise resolves normally: abort means “skip the animation”, not “fail”.core/ReelSet.ts:168
skipIn?booleanSkip the IN beat. The swapped cells are left HIDDEN (alpha: 0) - the midpoint of a swap is a dark board - so the caller owns the reveal. For art that plays its own Spine in track.core/ReelSet.ts:162
skipOut?booleanSkip the OUT beat. For cells already hidden by something else - a Spine track the game drove itself, a previous swapSymbols that left them out.core/ReelSet.ts:156
zIndex?number | nullzIndex applied to each swapping view while it animates, so an entrance that overshoots its cell is not clipped behind a neighbour. Default 1000. Applied and restored per beat, and the restored value is whatever the cell had before that beat - so the new symbol keeps the zIndex its own registration gave it. (destroySymbols does not restore, because its cells are consumed.) Pass null to skip the bump.core/ReelSet.ts:151