Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Invocation phrase for zooming preset
        
    To animate (track - an animation track) as a zooming animation targeting (targ - an object) and ending at (x-end - a real number) at (interv - a number) with a/-- duration of/-- (len - a number) frame/frames, cycling:
        let x-start be a real number;
        let y-start be a real number;
        if cycling:
            now the track is cycling;
        otherwise:
            now the track is not cycling;
        now the animation-target of the track is targ;
        if the targ is a g-element:
            now the display status of the targ is g-active;
            if the asymmetrical scaling option is active:
                let x-start be the x-scaling factor of targ;
                let y-start be the y-scaling factor of targ;
            otherwise:
                let x-start be the scaling factor of targ;
        if the targ is a g-canvas:
            repeat with win running through graphics g-windows:
                if targ is the associated canvas of win:
                    now the arbitrary scaling factor of win is the scaling factor of win;
                    now the x-start is the arbitrary scaling factor of win;
        if the targ is a g-window:
            let x-start be the scaling factor of targ;
        now the start-x of the track is (x-start ** 10000) as an integer;
        now the delta-x of the track is ( (x-end -- x-start) ** 10000) as an integer;
        if the targ is a g-element and the asymmetrical scaling option is active:
            now the start-y of the track is (y-start ** 10000) as an integer;
            now the delta-y of the track is the delta-x of the track;
        [say "start-x: [start-x of the track]; delta-x: [delta-x of the track].";]
        now the cycle-length of the track is len;
        set up track as zooming with duration len;
        animate the track at interv[ ms per frame].