Skip to content

anim-format (runtime format) / smoothPair

Function: smoothPair() ​

ts
function smoothPair<R>(
   runs, 
   frame, 
   next
): 
  | {
  from: R | null;
  to: R | null;
}
  | null;

The runs to draw between frame and the frame the playhead goes to next (next = frame ± 1): {from, to} when the earlier of the two frames is the last frame of a run marked t and the later one starts the next run (or has none: a layer look back to plain); null = no tween in between (hold the real frame).

Type Parameters ​

Type Parameter
R extends object

Parameters ​

ParameterType
runsR[]
framenumber
nextnumber

Returns ​

| { from: R | null; to: R | null; } | null

HereSplash — 2D animation for the web