* Graph(number subFunction, ...)
Graph performs a number of operations with the screen and background picture. It contains a number of sub functions, listed below.
The values are as follows:
16 EGA -1 CGA (doesn't matter if the driver is a mono CGA or four color CGA)
Example(var colors)
= colors Graph(grGET_COLORS)
(if( == colors 16)
Print("You are running in EGA mode")
)(else
(if( == colors -1)
Print("You are running in CGA mode")
)
)
If you specify visColor, then the line is drawn on the visual screen with that color. If visColor is -1, no line is drawn. Use -1 if you, for example, want to draw a line on the control screen, but not the visual or priority screens.
If you specify priColor, then the line is drawn on the priority screen with that color. If priColor is -1, no line is drawn.
If you specify ctlColor, then the line is drawn on the control screen with that color. If ctlColor is -1, no line is drawn.
Example/* Draw a line from (30,20) to (200,100) on the visual screen in yellow, the priority screen in red, and the control screen in blue. */
Graph(grDRAW_LINE 20 30 100 200 clYELLOW clRED clBLUE)/* Draw a line from (60,40) to (160,130) on the visual screen in white, and the control screen in brown. */
Graph(grDRAW_LINE 40 60 130 160 clWHITE -1 clBROWN)/* Draw a line from (10,20) to (40,50) on the visual screen in red. */
Graph(grDRAW_LINE 20 10 50 40 clRED)
Example/* this saves the center of the screen, draws a line, then restores the area leaving only the line's edges */
(var handle)
= handle Graph(grSAVE_BOX 50 80 150 240)
Graph(grDRAW_LINE 10 10 180 310 clYELLOW)
Graph(grRESTORE_BOX handle)
Example/* this saves the center of the screen, draws a line, then restores the area leaving only the line's edges */
(var handle)
= handle Graph(grSAVE_BOX 50 80 150 240)
Graph(grDRAW_LINE 10 10 180 310 clYELLOW)
Graph(grRESTORE_BOX handle)
The screens parameter can be any of the following...
VISUAL The visual screen PRIORITY The priority screen CONTROL The control screen VISUAL_PRIORITY The visual and priority screens VISUAL_CONTROL The visual and control screens PRIORITY_CONTROL The priority and control screens ALL_SCREENS All three screens.
If you specify visColor, then the box is drawn on the visual screen with that color. If visColor is -1, no box is drawn. Use -1 if you, for example, want to draw a box on the control screen, but not the visual or priority screens.
If you specify priColor, then the box is drawn on the priority screen with that color. If priColor is -1, no box is drawn.
If you specify ctlColor, then the box is drawn on the control screen with that color. If ctlColor is -1, no box is drawn.
Example/* Draws a box with the bounds of (30,20) and (200,100) on the visual screen in yellow, the priority screen in red, and the control screen in blue. */
Graph(grDRAW_BOX 20 30 100 200 ALL_SCREENS clYELLOW clRED clBLUE)// Doesn't draw anything though the colors are specified, no screens are
Graph(grDRAW_BOX 20 30 100 200 0 clYELLOW clRED clBLUE)/* Draws a box with the bounds of (60,40) and (160,130) on the visual screen in white, and the control screen in brown. */
Graph(grDRAW_BOX 40 60 130 160 VISUAL_CONTROL clWHITE -1 clBROWN)
ExampleGraph(grFILL_BOX_BACKGROUND 40 40 99 119)
ExampleGraph(grFILL_BOX_FOREGROUND 40 40 99 119)
Example/* Shows the priority screen for two seconds */
Graph(grUPDATE_BOX 0 0 199 319 PRIORITY)
Wait(120)/* Shows the control screen for two seconds */
Graph(grUPDATE_BOX 0 0 199 319 CONTROL)
Wait(120)/* Shows the visual screen*/
Graph(grUPDATE_BOX 0 0 199 319 VISUAL)
ExampleGraph(grREDRAW_BOX 0 0 199 319)
ExampleGraph(grADJUST_PRIORITY 20 150)