Commodore 128D User Manual page 313

Hide thumbs Also See for 128D:
Table of Contents

Advertisement

SSHAPE/GSHAPE
EXAMPLES:
SPRSAV 1,A$
Copies the image pattern from sprite 1 to the
string named A$.
SPRSAV B$,2
Copies the data from string variable B$ into sprite
2.
SPRSAV 2,3
Copies the data from sprite 2 to sprite 3.
—Save/retrieve shapes to/from string variables
SSHAPE and GSHAPE are used to save arid load rectangular areas
of multicolor or bit mapped screens to/from BASIC string variables.
The command to save an area of the screen into a string variable is:
SSHAPE string variable, X1, Y1 [,X2,Y2]
where:
string variable
String name to save data in
X1,Y1
.Corner coordinate (0,0 through 319,199)
(scaled)
X2,Y2
Corner coordinate opposite (X1.Y1)
(default is the PC)
Because BASIC limits strings to 255 characters, the size of the area
that can be saved is limited. The string size required can be calcu
lated using one of the following (unsealed) formulas:
L(mcm)= INT ((ABS(X1 -X2) + 1) / 4 + .99) * (ABS(Y1 - Y2)+ 1) + 4
L(h- r)= INT ((ABS(X1 -X2) + 1) / 8 + .99) * (ABS(Y1 - Y2)+ 1) + 4
The first equation pertains to multicolor bit map mode; the second
equation applies to standard bit map mode.
The command to retrieve (load) the data from a string variable and
display it on specified screen coordinates is:
GSHAPE string variable [,X,Y] [,mode]
305
BASIC 7.0 ENCYCLOPEDIA—Basic Commands and Statements

Advertisement

Table of Contents
loading

Table of Contents