Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section: Frames, cycles, and duration

    Animation tracks keep an accounting of their own states. We will rarely need to access this information, but should we need to, we can refer to these properties of any given track:

        current-frame - a number that indicates how many frames, in total, an animation has passed through.

        animation-length - the duration (in frames) that the track will run before finishing.

        cycle-length - the number of frames in a single cycle of the animation. If the animation is not cycling, this will be the total duration specified for the animation.

        cycles completed - the number of cycles of the animation that have been completed.

    GCA does not store the frame of the current cycle, but it can be calculated as follows:

        let cyclic-frame be the current-frame of the track - (cycle-length of the track * cycles completed of the track)