Turing 4.1 introduces a number of new features. This page shows some of
these features.
Sprite
The Turing Sprite module allows users to create animation without
having to worry about erasing and drawing the objects on the screen. A
sprite is created from a picture, and then commands by the program
to move the sprite to the desired location. The program then
automatically erases the sprite at the old location (restoring the
background) and redraws it at the new location (placing it underneath
"higher" sprites, if necessary).
Here is an example of a program that used sprites. Each triangle is
a sprite, and the height of each sprite appears on the sprite. Sprites
with a height of -1 or -2 actually behind the background, which
in this case is a set if green and blue bars. Note how sprites with a
higher depth always appear above a sprite with a lower depth.
Here is a second example of a sprite being used to animate a figure
moving across the screen. In this case, the figure is taken from a
multi-frame GIF file and the sprite module is used to make it appear to
move.
Turing supports a veriety of special effects. These are obtained by
drawing a picture (obtained using the
Pic.New,
Pic.FileNew, or the new
Pic.FileNewFrames functions).
When the picture is drawn, the programmer can specify the transition
that should be used to display the new picture. These transitions can
includes wipes, slides, a growing image, fade-ins, and so on.
Here is an example of a program that demonstrates many of these
transitions.
The different transitions are fully documented
here.
GIF Image support
The Pic.FileNew command can now
read GIF files (now that the patent has expired in Canada). GIF files
can specify a "transparent color", and this is supported by Turing.
When a GIF with a transparent color is loaded by Turing, the
"transparent color" is added to the color palette (if not already
present). If the picture is displayed using the picMerge mode,
the "transparent color" will not be displayed. Note that the
"transparent color" is a real color. If you use the picCopy
mode, this color is displayed.
Here is an example of a program displaying a GIF with a transparent
color. In this case, the transparent color is dark blue.
Multi-frame GIF Image support
Turing also supports multi-frame GIF images. A GIF program can contain
multiple images (this is how animated GIFs work). The
Pic.FileNewFrames procedure
can read a multi-frame GIF into an array of integers. These can then
be displayed one at a time, or all in one call using the
Pic.DrawFrames procedure.
Here is an example of a program that displays a rotating globe found
in a multi-frame GIF file using these procedures.
Faster animation
Turing has been improved to speed up animation when the picMerge
mode is used. Speed improvements from 50% to 500% have been reported.
Other graphic routines
Turing now includes the Pic.Blend
function to blend two pictures together and the
Pic.Blur function to take an existing
picture and make it blurry.