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?
SCREEN pages
Moderators:Administrator, Global Moderator
-
- Newbie
- Posts:2
- Joined:Tue Dec 28, 2004 7:52 pm
- Location:Somewhere between this website and the next dimension
- Contact:
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
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
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!
-
- Newbie
- Posts:2
- Joined:Tue Dec 28, 2004 7:52 pm
- Location:Somewhere between this website and the next dimension
- Contact: