Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Zooming animation rule

    First animation rule for a zooming animation track (called the track) (this is the default zooming animation rule):
        let Xx be a number;
        let Yy be a number;
        let targ be the animation-target of the track;
        let cyclic-frame be current-frame of the track - (cycles completed of the track * cycle-length of the track);
        if the asymmetrical scaling option is active and the targ is a g-element:
            let Xx be the easing applied to the cyclic-frame and the cycle-length of the track and the start-x of the track and the delta-x of the track;
            if the secondary easing of the track is not the null easing rule:
                let Yy be the secondary easing applied to the cyclic-frame and the cycle-length of the track and the start-y of the track and the delta-y of the track;
            otherwise:
                let Yy be the easing applied to the cyclic-frame and the cycle-length of the track and the start-y of the track and the delta-y of the track;
        otherwise:
            let Xx be the easing of the track applied to the cyclic-frame and the cycle-length of the track and the start-x of the track and the delta-x of the track;
        let X be (Xx // 10000.0000);[the easing equations give us a number; we need to translate it into a real number to use as a scaling factor]
        if the targ is a g-element and the asymmetrical scaling option is active:
            let Y be (Yy // 10000.0000);
            now the x-scaling factor of the targ is X;
            now the y-scaling factor of the targ is Y;
        otherwise if the targ is a g-element:
            now the scaling factor of the targ is X;
        otherwise if the targ is a g-window:
            now the arbitrary scaling factor of the targ is X;
        if the targ is a g-canvas:
            repeat with win running through graphics g-windows:
                if the targ is the associated canvas of win:
                    now the arbitrary scaling factor of win is X;
        #if utilizing animation debugging;
        say "[>console][CA]Processed frame [b][current-frame][/b][if track is cycling] (frame [cyclic-frame] of cycle [cycles completed of the track + 1])[end if] of [i][track][/i] as a zooming track targeting [the targ], using the [easing of the track] (t: [cyclic-frame], d: [cycle-length of the track], b: [start-x of the track], c: [delta-x of the track])[if the secondary easing of the track is not the null easing rule] and the [secondary easing of the track] (t: [cyclic-frame], d: [cycle-length of the track], b: [start-y of the track], c: [delta-y of the track])[end if]. [if the asymmetrical scaling option is not active or the targ is a g-canvas]Scaling factor: [scaling factor of the targ][otherwise]X-scaling factor: [x-scaling factor of the targ]; y-scaling factor: [y-scaling factor of the targ][end if].[<]";
        #end if.