Download GWBASIC User's Manual

Transcript
GW-BASIC User's Guide
WINDOW Statement
Purpose:
To draw lines, graphics, and objects in space not bounded by the physical limits of the screen.
Syntax:
WINDOW[[SCREEN](x1,y1)-(x2,y2)]
Comments:
(x1,y1), (x2,y2) are the coordinates defined by the user. These coordinates, called the world
coordinates, may be any single-precision, floating-point number. They define the world
coordinate space that graphics statements map into the physical coordinate space, as defined by
the VIEW statement.
WINDOW is the rectangular region in the world coordinate space. It allows zoom and pan. It allows
the user to draw lines, graphics, and objects in space not bounded by the physical limits of the
screen. To do this the user specifies the world coordinate pairs (x1,y1) and (x2,y2.) GWBASIC then converts the world coordinate pairs into the appropriate physical coordinate pairs for
subsequent display within screen space.
Window inverts, with the screen attribute omitted, the y coordinate on subsequent graphics
statements. This places the (x1,y1) coordinate in the lower-left and the (x2,y2) coordinate in
the upper-right of the screen. This allows the screen to be viewed in true Cartesian coordinates.
The coordinates are not inverted when the SCREEN attribute is included. This places the (x1,y1)
coordinate in the upper-left and the (x2,y2) coordinate in the lower-right corner of the screen.
The WINDOW statement sorts the x and y argument pairs into ascending order. For example:
WINDOW (50, 50)-(10, 10)
becomes
WINDOW (10, 10)-(50, 50)
Or
WINDOW (-2, 2)-(2, -2)
becomes
WINDOW (-2, -2)-(2, 2)
All coordinate pairs of x and y are valid, except that x1 cannot equal x2 and y1 cannot equal y2.
WINDOW with no arguments disables previous window statements.
file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/WINDOW.html (1 of 2)28/03/2004 21.29.53