Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Flicker animation preset

    Section - Flicker animation rule
    [The flicker animation rule can apply to g-elements or to canvases. Applying it to a window will result in its being applied to the canvas shown in that window.]

    First animation rule for a flicker animation track (called the track) (this is the default flicker animation rule):
        let g-toggled be false;
        if the track is animation-randomized and a random chance of 50 in 100 succeeds:
            toggle animation-target of the track for the track;
            let g-toggled be true;
        otherwise if current-frame of the track is odd:
            toggle animation-target of the track for the track;
            let g-toggled be true;
        #if utilizing animation debugging;
        say "[>console][CA]Processed frame [b][current-frame][/b][if track is cycling] (frame [current-frame of the track - (cycles completed of the track * cycle-length of the track)] of cycle [cycles completed of the track + 1])[end if] of [i][track][/i] as a flicker track targeting [the animation-target of the track] (display status [if g-toggled is true]toggled[otherwise]unchanged[end if]).[<]";
        #end if.
        
    To toggle (O - an object) for (track - an animation track):
        if O provides the property display status:
            if the display status of O is g-active:
                now the display status of O is g-inactive;
            otherwise:
                now the display status of O is g-active;
        if O is a g-window:
            toggle canvas for O of track;
        if O is a g-canvas:
            repeat with target running through graphics g-windows:
                if O is the associated canvas of target:
                    toggle canvas for target of track.

    To toggle canvas for (win - object) of (track - animation track):
        if the associated canvas of win is g-null-canvas:
            now the associated canvas of win is the target-canvas of the track;
        otherwise:
            now the associated canvas of win is g-null-canvas.