Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Temporalizing animation tracks

    A "temporalizing" track does nothing at all except count off frames at a given rate. It is intended primarily to be used for delays between animations, and is frequently employed in conjunction with animation callbacks.

    To invoke a temporalizing preset animation, we can either specify a length or not:

        animate <track> as a temporalizing animation at <interval> with a duration of <length> frames, <cycling>

        animate <track> as a temporalizing animation at <interval>, <cycling>

    Note that temporalizing animations have no target object--since they don't produce any visual effect, they don't need one. When the "cycling" option is set, a temporalizing animation will continue to cycle until stopped by some outside event, e.g. a callback.

    Usage example:

    A sprite moves right, then pauses a bit, then moves back to the left. The temporalizing animation is begun at the same time as the rightward movement, but continues for 6 frames beyond it and then fires a callback to begin the leftward movement:
        The patrol track is an animation track.
        The pause track is an animation track. The animation-callback of the pause track is "[@ complete the patrol]".

        The Patroller is a sprite. The origin is {0, 100}.

        To begin the patrol:
            animate the patrol track as a motion animation targeting the Patroller and ending at {300, 100} at 8 fps with a duration of 24 frames;
            animate the pause track as a temporalizing animation at 8 fps with a duration of 30 frames.

        To complete the patrol:
            animate the patrol track as a motion animation targeting the Patroller and ending at {0, 100} at 8 fps with a duration of 24 frames.