These teachpacks provide a variety of functions for manipulating and animating graphical images. To use them, you'll need to
This should be done once on your home computer, and you'll never have to do it again (unless I come up with an improved version). You shouldn't need to do this at all on a classroom computer.
Welcome to DrScheme, version 371 [3m].If the two teachpacks are listed in the other order, that doesn't matter.
Language: Beginning Student custom.
Teachpacks: 371-tiles.ss and 371-sb-world.ss
When you start DrScheme, you can tell it you want to use these added functions, and it'll remember that for the next time you start DrScheme on the same computer... unless somebody else using the same computer tells it not to use this teachpack, in which case you'll need to go through these steps again.
Go to the "Language" menu in DrScheme and choose "Add
Teachpack", and you should see both 371-tiles.ss
and
371-sb-world.ss
on the right-hand side. Click one of
these, then "OK". Repeat with the other teachpack.
Click the "Run" button. You should see a message saying
"Teachpack: 371-tiles.ss and 371-sb-world.ss" in the
interactions window. The next time you start DrScheme,
it should remember this unless you choose "Language->Clear Teachpack"
to remove the teachpack.
You can copy-and-paste images from a Web browser into DrScheme and use
them just like any other value: you can store them in a variable, etc.
The 371-tiles.ss
teachpack includes several useful functions
for manipulating images:
image-above: image image ... -> imageCombines two or more images into one, putting the first above the second (above the third, ...).
image-above-align-right: image image ... -> imageJust like
image-above
, but lines up the right-hand edges of
all the images.image-above-align-left: image image ... -> imageJust like
image-above
, but lines up the left-hand edges of
all the images.image-beside: image image ... -> imageCombines two or more images into one, putting the first to the left of the second (to the left of the third, ...).
image-beside-align-top: image image ... -> imageJust like
image-beside
, but lines up the top edges of
all the images.image-beside-align-bottom: image image ... -> imageJust like
image-beside
, but lines up the bottom edges of
all the images.reflect-vert : image -> imageflips an image top-to-bottom.
reflect-horiz : image -> imageflips an image left-to-right.
reflect-main-diag : image -> imageflips an image top-right to bottom-left.
reflect-other-diag : image -> imageflips an image top-left to bottom-right.
rotate-cw : image -> imagerotates an image 90 degrees clockwise.
rotate-ccw : image -> imagerotates an image 90 degrees counter-clockwise.
rotate-180 : image -> imagerotates an image 180 degrees.
The 371-tiles.ss
teachpack also includes the
image.ss
teachpack (which comes standard with DrScheme, so
you don't need to worry about installing it).
This provides a variety of other functions useful
for building and manipulating images in DrScheme. To learn about them,
start DrScheme, choose "Help -> Help Desk", and search for
"image.ss".
The 371-sb-world.ss
teachpack provides several functions
related to animation:
run-animation : number(width) number(height) world number(tick interval) handler ... -> trueThis is the most important function in the
371-sb-world.ss
teachpack. You give it the width and height of your desired animation
window, the initial world, how many seconds between "ticks", and
possibly some "handlers", and it will run an animation for you. For
details, see Chapter 7 of my textbook.run-saveable-animation: ...
run-animation
, except that it records the
sequence of events and allows you to save it as an animated GIF picture.
nw:rectangle : number(width) number(height) string("outline" or "solid" string(color-name) -> sceneJust like
rectangle
, but puts the "pinhole" in the top
left corner.