Page 1 of 1
SCREEN pages
Posted: Tue Dec 28, 2004 7:59 pm
by DragonEye Software
Could someone shed some light on the PAGE functions used in SCREEN Statement?
QB HELP States:
SCREEN mode% [, [colorswitch%] [, [activepage%] [, visiblepage%]] ]
What exactly are the PAGE functions used for?
Posted: Tue Dec 28, 2004 11:32 pm
by Dr_Davenstein
You can use them to draw on a page in memory, and then display all the graphics at once using PCOPY. Here's a cheap example to show you how it works...
Code: Select all
DEFINT A-Z
SCREEN 7, , 0, 1
DO
CLS ' clear the backbuffer, Page 0.
' Draw some stuff on the backbuffer
FOR R = 1 TO 100
Col = INT(RND * 15) + 1
CIRCLE (INT(RND * 320), INT(RND * 200)), 16, Col
PAINT STEP(0, 0), 0, Col
PAINT STEP(0, 0), Col, Col
NEXT
WAIT &H3DA, 8'Wait for vertical retrace
WAIT &H3DA, 8, 8'
PCOPY 0, 1'Copies the Active Page 0 to the Visual Page 1, which is the screen.
LOOP UNTIL INKEY$ = CHR$(27) 'ESC to exit
Posted: Wed Dec 29, 2004 2:07 pm
by DragonEye Software
Alrighty then, thanks, ill give it a shot.