home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chestnut's Multimedia Mania
/
MM_MANIA.ISO
/
multi
/
mmw31
/
edit.doc
< prev
next >
Wrap
Text File
|
1992-05-15
|
19KB
|
365 lines
***************** EDITING THE PICTURE FILE ******************
One of the excellent fringe benefits of ASCII-VECTOR-GRAPHICS
is that you can edit the picture file directly with any word
processor that has a standard ASCII mode (and most do) or
text editor. Borland's SIDEKICK is a good one because you can
pop it up from within The Multimedia Workshop, edit files,
and view the actual picture almost simultaneously.
As you know by now, when you create a picture, it is stored
as little bits of text in a plain text file. When MSHOW
reads this text picture file, the lines of text are
translated into parts of the picture.
Generally, the code goes like this: An object is represented
by a capital letter. For instance, an R is for Rectangle, a C
is for Circle and so on. Each object letter is the leftmost
character on a line, and is followed by a series of integers.
(Integers are numbers with no decimal point, for those of you
who are not strong in math.) These integers represent the
location of the object and its size.
The first number is the horizontal location of the object on
the screen in pixels. Pixels are the little dots of light
that make up everything in a computer picture. If the number
is zero, the object is crammed up against the left edge of
the monitor. In most video modes, 639 is the far right edge,
because there are 640 pixels across the screen, and the first
one is 0. In Hercules the right edge is 719 and in CGA-LO
4-color it is 319.
The second number is the vertical location with 0 being the
very top. In most modes 199 is the bottom of the screen, but
in Hercules it is 347, in EGA-HIGH it is 349, and in VGA it
is 479.
Many objects will also have other numbers following.
Following this paragraph are the specific codes used in The
Multimedia Workshop picture files. These are all the codes
of which all pictures are composed. There are no others.
T - Followed immediately by either a digit. This is line
thickness. If you see a T3, all lines, circles, freehand,
rectangles or ellipses are drawn in the thick solid line
style from this point until another T is encountered.
T1 - thin solid line
T3 - thick solid line
T4 - thin dotted line
T5 - thick dotted line
T6 - thin dashed line
T7 - thick dashed line
S - Followed by a space and an integer representing the
frequency in Hertz (cycles per second), then another space,
and another integer, representing the length of time in
milliseconds for which this sound will play. If the frequency
following S is 0, the sound is silent, as in a musical rest.
U - With nothing following. This is Wait For User, and
freezes the system until the user presses any key. (Remember,
Wait For User, Delay and Sound effects will not play true to
form from within The Multimedia Workshop if "BLOW OFF
DELAYS" has been selected from the DOOR option, but they will
be effective when run from MSHOW.EXE.
P - Followed by two integers is for Pixel, and changes the
pixel at the designated location (by the first two integers)
to the current color.
L - Followed by four integers. This is LINE and displays a
line starting at the location specified by the first two
numbers and ending at the location specified by the last two
numbers. Like all objects this line will be in the current
thickness and color.
Z - Followed by six integers. This specifies a ZOOM action.
The first four integers represent the original area to be
changed, and the last two are the new lower right corner of
the area in its new dimensions. The upper left corner
remains in the same location.
KC - Followed by six integers. Borrowed from Wordstar
and BORLAND conventions, this is for COPY. The first four
integers specify the area to be copied, and the last two
mark the location of the upper left corner of the new object.
KV - Followed by six integers. Again from Wordstar and
BORLAND, this is for MOVE. Again six integers used in the
same manner as KC.
KY - Followed by four integers. An ERASE in "Wordstarese"
These four numbers mark the rectangular region to be deleted.
R - Followed by four integers. This creates a rectangle.
The first two numbers mark the upper left corner and the
last two mark the lower right corner.
O - Followed immediately by a digit (no space between them).
This changes the current color. Any object drawn will be in
this color until the color is changed again. In monochrome
graphics modes, 0 is black or the background color, and any
other number between 1 and 15 results in foreground or white.
In the 16-color modes:
0 = BLACK
1 = MIDNIGHT BLUE
2 = TREE GREEN
3 = DARK CYAN
4 = CRIMSON
5 = PURPLE
6 = BROWN
7 = LIGHT GRAY
8 = DARK GRAY
9 = AVERAGE BLUE
10 = BRIGHT GREEN
11 = SKY BLUE
12 = BRIGHT RED
13 = MAGENTA
14 = YELLOW
15 = WHITE
(assuming there have been no 'n's in the file)
In 256-color mode, the above list shows the first 16 colors,
beyond this, you are on your own with colors!
n - Followed immediately by 2 or 4 integers. This indicates
a color palette change and only works in UNIVERSAL, EGA-HI or
the VGA video modes. The first number is the color number to
change. For instance, if the first number is 3, then the
color affected will the the third one on the color menu. In
16-color modes, the next number indicates then new value
(range 0-63) for the color. In the 256-color modes the
second number (0-63) indicates the amount of red, the next
number is for green and the last is for blue. These are
negative colors, oddly enough: Green + red = yellow. Notice
that the n is not capitalized.
B - Followed immediately by a digit (no space between them).
This has no effect unless the graphics mode is CGA-HIGH or
CGA-LOW, in which case it immediately changes the background
color. You can choose any of the first 8 (0-7) colors from
the above listing for background color.
C - Followed by three integers. A circle. The first two
integers mark the centerpoint location, and the last is the
radius of the circle. As with most objects, the circle will
be drawn in the current color and line thickness.
E - Followed by six integers. An ellipse. The first two
integers mark the centerpoint, the next two are the starting
and ending angles of the ellipse. A full ellipse starts at 0
degrees and ends at 360. 0 degrees is the 3 o'clock position,
High Noon is 90 degrees, 9 o'clock is 180, and 6 o'clock is
270. Therefore a partial ellipse, drawn from 45 to 90 degrees
would range from approximately 1:30 to noon of a clock dial.
The last two digits in an ELLIPSE are the horizontal followed
by the vertical axes in pixels.
F - Followed by three integers. This fills a bordered area
with the currently selected color in the pattern specified by
the third number. The color must be the same as the border.
If there is even a one-pixel gap in the border, the color
will leak out and fill the whole picture.
text/ - Followed immediately by five integers. The first two
integers mark the position of the upper left corner of the
text block. The third number selects the typeface or font.
The last two integers represent the magnification of the
typeface. Of these last two, the first is for the width and
the second is for height of the font. The 'default' size of
most fonts is 4 wide and 4 high. A number smaller than 4
renders a narrower font and a larger number is wider. And, of
course, if the last number is larger, the font will be
taller, but if it is a number smaller than 4, the font will
be small.
The possible sizes range from 1 to 9. If you try to use
a width or height outside of this range, any number of
horrible things may happen to your presentation!
The first two typefaces, BITMAP and TRIP, are built into
the program, but the others are kept on the disk in external
files. These files end with .CHR. So, if you want to use
the SCRIPT font, for instance, you must supply the SCRI.CHR
file along with your picture files on every disk copy you
make.
The first typeface, BITMAP, is handled differently by the
program. Vertical and horizontal dimensioning is handled
together, you cannot specifically control the width or
height, but only the overall size.
Text is drawn in the currently selected color. The text
begins on the line following "text/" and the five numbers
and continues until a line is encountered which starts with
~. The ~ must be in the first column of the first line
following a block of text, otherwise MSHOW will assume the
following lines are to be displayed as text and will most
likely crash. So, as soon as MSHOW encounters a line that
starts with "text/" the lines following are considered text
and displayed verbatim until a line starting with ~ is found.
TEXT BLOCKS MUST BE FOLLOWED BY A LINE THAT STARTS WITH ~.
You can edit the text just as you would any ASCII text
document, keeping in mind that the size of the block cannot
exceed the room available in the picture.
title/ - Followed by five integers. The first two integers
mark the center around which the title will be displayed.
The third number selects the typeface. And, as with text/,
the last two numbers control the size of the font. The line
following "title/" and the five numbers is the title which
will be displayed verbatim.
D - Followed immediately by one integer. DELAY, causes the
program to freeze for the amount of time in milliseconds
indicated by the integer. The largest value allowed is
approximately 65000 milliseconds. If a longer delay is
required, several delays can be used together. For example, a
two-and-a-half minute delay would look like this:
D60000
D60000
D30000
And that's all the codes required to make multimedia
presentations!
These are fully at your disposal for editing with your text
editor or word processor. For instance, if you have made a
picture with a rectangle in it:
R113 24 196 68
but you wish the rectangle were a little more to the left,
you could simply change it:
R103 24 186 68
Then rerun The Multimedia Workshop or MSHOW and check your
change. In this illustration, your rectangle would have moved
10 pixels to the left.
Lets say your rectangle was yellow, but you wish it were
white. You could precede the line like this:
015
R103 24 186 68
No doubt you can see the incredible power in ASCII editing of
pictures! You can fine tune your graphics, sound effects,
animation timings, even correct typographical errors in text
within pictures!
There are some conventions that must be observed. Make sure
to use a single space between integers. Make sure to use the
exact same spellings and capitalizations. Make sure to
preserve blank lines where they exist in the picture file.
For instance, after a series of sounds, there must be at
least one blank line. Make sure to test your pictures after
you have made changes. And most of all, feel free to
experiment considerably. With practice, you'll understand
this well and be able to generate very fine work, very
quickly!
Since all the picture command lines start in the very
left-most column, you can temporarily remove an element from
a picture by simply typing a space or an * in front of the
line. This causes it to move to the second column. If The
Multimedia Workshop or MSHOW.EXE finds a ' ' or an '*' in the
first column of a line, they ignore the whole rest of the
line, except within text blocks.
This is good for troubleshooting a picture. For instance,
let's say you have created a complicated picture, and in your
picture is an annoying line which runs diagonally through the
wrong place as annoyingly as a pipe wrench in a typewriter.
Try to find the line. When you think you have it, put a * in
front of it, and check the picture. One line in your picture
will not be displayed. If you put the * in the right place,
the diagonal line will be gone, otherwise some other line
will be missing. Once you have found the right line to
delete, you can simply leave the * there or you can actually
delete the line.
If you use a text editor which runs TSR (Terminate Stay
Resident) such as Borland's Sidekick, you can do your editing
while The Multimedia Workshop remains loaded and see your
changes almost instantly. The best way to do this seems to
be to select SEE from the control panel first, then do your
editing, then return to SEE, press [Enter] and then [Enter]
again to redraw the picture. This is best because some TSR's
do funny things to the picture, especially if in VGA mode, or
they steal the mouse cursor and won't give it back! Note: If
your RAM space is limited, you'll sometimes have just enough
space for a small TSR and The Multimedia Workshop. Kick the
others out of your AUTOEXEC.BAT file. If still a problem, you
can almost always switch between MSHOW.EXE and a TSR without
RAM problems.
VIDEO MODES
You'll notice that the first line in picture files is always
"mode" followed by a digit. This is how MSHOW.EXE or The
Multimedia Workshop know which mode to use. The modes are:
1 CGA-HIGH 2-color
2 CGA-LO 4-color
3 UNIVERSAL MODE 640 x 200 16-color (EGA-LO)
4 EGA-HIGH
5 HERCULES MONOCHROME
6 VGA-HIGH
GUESS WHAT? You can fudge these modes. For instance, Let's
pretend you have a HERCULES graphics system, but you want to
create a presentation in UNIVERSAL mode so that the widest
possible audience can see your stuff. The Multimedia
Workshop knows that all you have is HERCULES, and so
automatically puts a "mode5" at the start of every picture,
so it will run at the best possible resolution in your
system, and not confuse you with 16-color menus you can't
use.
But if you use a mode5 (Hercules) presentation in most other
systems, MSHOW.EXE will first display a warning that it is
the wrong graphics mode, then translate the pictures.
Furthermore, Hercules allows 720 pixel-wide pictures, but the
other graphics modes don't, so the right-hand side of your
presentations will be cut off for CGA and VGA users.
So here's what you do: You start by changing the first line
in each picture from "mode5" to "mode3." Mode 3 is UNIVERSAL
MODE. It will still play on your HERCULES system, but will
now also work without the warning on all other standard
graphic systems. Then you make your pictures to fit within
640 horizontal pixels and 200 vertical pixels. In other words
draw your pictures in the upper left portion of your screen
not exceeding coordinates 639 by 199.
This is important. When you play a picture in a mode for
which it was not designed, if the picture is larger than the
graphics mode attempting to display it, the program may
crash. So, UNIVERSAL MODE pictures cannot exceed 639 x 199.
NOTE: Do not fudge graphics modes if you have included .PCX
files, because they are usually not transportable from one
type of graphics card to another (or one emulation to
another). In other words, you cannot end up with a Hercules
.PCX file working on a .CGA system.
And last, to add colors, for those who can display them, you
can use the picture file COLORS to see a chart and then
sprinkle your picture files with "O"'s followed by numbers
for color changes. Getting the colors right is tricky, so
you might want to at least view your presentation on a
borrowed computer which has color, to make sure it looks ok.
A little inside tip for professional-looking colorizing:
Stick to two or three colors, perhaps text in sky blue,
graphics in white, and arrows in red.
_____________________________________________________________
end of chapter