Skip to content

anim-format (runtime format) / resolveFrameRef

Function: resolveFrameRef() ​

ts
function resolveFrameRef(
   map, 
   at, 
   ref, 
   mode?
): number | null;

THE meaning of a frame reference, seen from global frame at:

  • scene (from a scene action) = look in that scene, else the one at is in;
  • section given: a number counts from its first frame, a label is one of its own, START / END are its ends;
  • a number past the end = the last frame (of the section / scene);
  • no section: a number is a frame of the scene, a label is looked up in the span at is in first, then (goto only) anywhere in the scene; START / END = the ends of the span at is in (of the whole scene when a scene action led elsewhere);
  • mode "playTo": the result must lie in the span at is in — playTo never plays into another section (null). Null = no such frame.

Parameters ​

ParameterTypeDefault value
mapFrameMapundefined
atnumberundefined
refFrameRefundefined
mode?"playTo" | "goto""goto"

Returns ​

number | null

HereSplash — 2D animation for the web