Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Invocation phrase for fade preset
        
    To animate (track - an animation track) as a fade animation targeting (targ - an object) and using (fader - a fader overlay) from (fadefrom - a number) %/percent to (fadeto - a number) %/percent at (interv - a number) with a/-- duration of/-- (len - a number) frame/frames, cycling:
        if cycling:
            now the track is cycling;
        otherwise:
            now the track is not cycling;
        now the cycle-length of the track is len;
        now the animation-target of the track is targ;
        if targ is a g-element:
            activate targ;
        if targ is a g-element or targ is a g-window:
            now the associated canvas of the fader is the associated canvas of the targ;
        if targ is a g-canvas:
            now the associated canvas of the fader is the targ;
        now the target-fader of the track is fader;
        let coeff be 100 / (the number of entries in the fader-reel of the fader - 1);
        now the start-x of the track is (fadefrom / coeff) + 1;
        now the delta-x of the track is ( (fadeto - fadefrom) / coeff ) + 1;
        set up track as fade with duration len;
        now the current-frame of the track is 0;
        animate the track at interv[ ms per frame].