Skip to content

1681-engine / index / tagFrames

Function: tagFrames() ​

ts
function tagFrames(
   from, 
   to, 
   direction, 
   repeat
): number[];

Defined in: src/anim/asepriteTags.ts:25

The sheet frames a tag plays, in playing order, unrolled so the engine's Animator (which only ever plays a list forward) shows exactly what Aseprite's own player shows.

  • forever (repeat 0): forward and reverse are one pass, looped; a ping-pong is one round trip without its two ends doubled (a b c d c b, then a again), so a loop never stutters on the turn.
  • repeat n: n passes, played once. A ping-pong counts each pass in one direction as one, as Aseprite does, and two passes share their turning frame (repeat 2 of a b c is a b c b a).

Parameters ​

ParameterType
fromnumber
tonumber
directionAsepriteDirection
repeatnumber

Returns ​

number[]

Released under the MIT License.