Glimmr Canvas Animation

version 1/111030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Drawing phrases for different element types
                        
    To update (fade-reel - a list of figure names) to (next-fade - a number) for (win - a g-window):
        draw (entry next-fade of the fade-reel) in (win) at 0 by 0 with dimensions (width of win) by (height of win).
        
    To update (fade-reel - a list of figure names) to (next-fade - a number) for (anim-target - a g-canvas) in (win - a g-window):
        draw (entry next-fade of the fade-reel) in (win) at x-offset of win by y-offset of win with dimensions (scaled width of anim-target) by (scaled height of anim-target).
                        
    To update (fade-reel - a list of figure names) to (next-fade - a number) for (anim-target - a sprite) in (win - a g-window):
        draw (entry next-fade of the fade-reel) in (win) at (win-x of anim-target) by (win-y of anim-target) with dimensions (sprite-x of anim-target) by (sprite-y of anim-target).
        
    To update (fade-reel - a list of figure names) to (next-fade - a number) for (anim-target - a primitive) in (win - a g-window):
        if the anim-target provides the property stroke:
            let xx be (min win-x of anim-target or end-x of anim-target) - stroke of anim-target;
            let yy be (min win-y of anim-target or end-y of anim-target) - stroke of anim-target;
            draw (entry next-fade of the fade-reel) in (win) at (xx) by (yy) with dimensions ((max win-x of anim-target or end-x of anim-target) + stroke of anim-target - xx) by ((max win-y of anim-target or end-y of anim-target) + stroke of anim-target - yy);
        otherwise if the anim-target provides the property end-x:[primitive without a stroke]
            draw (entry next-fade of the fade-reel) in (win) at (win-x of anim-target) by (win-y of anim-target) with dimensions (end-x of anim-target) by (end-y of anim-target).
            
    To update (fade-reel - a list of figure names) to (next-fade - a number) for (anim-target - a bitmap-rendered string) in (win - a g-window):
        draw (entry next-fade of the fade-reel) in (win) at (win-x of anim-target - dot-size of anim-target) by (win-y of anim-target - dot-size of anim-target) with dimensions ((length of the anim-target * dot-size of anim-target) + dot-size of anim-target) by ((dot-size of anim-target * font-height of the associated font of anim-target) + dot-size of anim-target).
        
    To update (fade-reel - a list of figure names) to (next-fade - a number) for (anim-target - an image-rendered string) in (win - a g-window):
        let margin be background-margin of the associated font of the anim-target real times the calculated scaling factor of the anim-target as an integer;
        let vertical-size be font-height of the associated font of the anim-target real times the calculated scaling factor of the anim-target as an integer;
        draw (entry next-fade of the fade-reel) in (win) at (win-x of anim-target - margin) by (win-y of anim-target - margin) with dimensions (length of the anim-target + margin + margin) by (vertical-size + margin + margin).
        
    To update (fade-reel - a list of figure names) to (next-fade - a number) for (anim-target - a bitmap) in (win - a g-window):
        draw (entry next-fade of the fade-reel) in (win) at (win-x of anim-target) by (win-y of anim-target) with dimensions (dot-size of anim-target * number of entries in entry 1 of bitmap-array of anim-target) by (dot-size of anim-target * number of entries in bitmap-array of anim-target).

    To update (fade-reel - a list of figure names) to (next-fade - a number) for (anim-target - an image-map) in (win - a g-window):
        draw (entry next-fade of the fade-reel) in (win) at (win-x of anim-target) by (win-y of anim-target) with dimensions (scaled tile-width of anim-target * number of entries of entry 1 of the figure-array of the anim-target) by (scaled tile-height of anim-target * number of entries in the figure-array of the anim-target).