{ (define LIBNAME "Animated Images") (include "head.tinc") }

The teachpack provides two kinds of functions. The first four allow students to simulate a small world of animated drawings and games:

  • {(idx big-bang)} : Number Number Number World -> true
    (big-bang width height n w) creates and shows a width x height canvas, starts the clock, makes it tick every n seconds, and makes w the first world
  • {(idx on-tick-event)} : (World -> World) -> true
    (on-tick-event tock) means that DrScheme must call tock on the current world every time the clock ticks; it uses the result as the next world
  • {(idx on-key-event)} : (World KeyEvent -> World) -> true
    (on-key-event change) means that DrScheme must call change on the current world and a (representation of the) keyevent for every keystroke the programmer (user of the computer) makes; it uses the result as the next world
    
       ;; A KeyEvent is one of: 
       ;; -- Char (char?)
       ;; -- Symbol (symbol?)
    
       When the Keyevent is a char, the programmer (user of the computer) has hit an
       alphanumeric key. Symbols such as 'left, 'right,
       'up, 'down, 'release denote arrow keys
       or the events of releasing a key on the keypad. 
    
  • {(idx on-redraw)} : (World -> Image) -> true
    (on-tick-event world->image) means that DrScheme calls world->image whenever the canvas must be redrawn; the result is displayed in the teachpack's canvas
  • {(idx end-of-time)} : String u Symbol -> World
    When DrScheme evaluates (end-of-time), it stops the clock and displays the given string or symbol; no further tick events, key events, or redraw events take place until the world is created again.
  • The rest are functions for creating scenes:

  • {(idx nw:rectangle)} : Number Number Mode Color -> Image
    (nw:rectangle width height mode color) creates a width x height rectangle, solid or outlined, with its anchor in the NW corner
  • {(idx empty-scene)} : Number Number -> Scene
    (empty-scene width height) creates a width x height "scene" (frame with origin in NW)
  • {(idx place-image)} : Image Number Number Scence -> Scene
    (place-image image x y scene) places image at (x,y) into scene; (x,y) are comp. graph. coordinates
  • {(idx run-movie)} : (Listof Image) -> true
    (run-movie loi) shows the list of images in loi, time-delayed
  • Finally, the teachpack provides all the functions that image.ss provides.

    {(include "foot.tinc")}