pageing.bas

来自「大名鼎鼎的QBasic下的图形库」· BAS 代码 · 共 46 行

BAS
46
字号
'Future.Library Pageing and Mouse Support
'
DECLARE SUB DrawStuff ()

REM $INCLUDE: 'future.bi'

Set640x480  'Set 640x480 svga screen

CALL DrawStuff  'draws stuff on the first 3 pages

Future.MouseOn 'turn on svga mouse

DO
P% = (P% + 1) MOD 3

        FOR i& = 0 TO 480& * 60& 'delay 1 sec.
         WAIT &H3DA, 1
         WAIT &H3DA, 1, 1
         Future.UpdateMouse 'update the mouse all the time
        NEXT

ViewPage P%              'change page
LOOP UNTIL LEN(INKEY$)

Future.MouseOff   'turn off svga mouse
ResetScreen     'set the screen back in text mode

SUB DrawStuff
SetPage 0
FOR i% = 0 TO 500
Future.LINE 640 * RND, 480 * RND, 640 * RND, 480 * RND, RND * 255, -1
NEXT
Future.PRINT 0, 0, "Page: 0 of" + STR$(Pages%), 15, 0
SetPage 1
FOR i% = 0 TO 300
Future.CIRCLE 640 * RND, 480 * RND, RND * 640, RND * 255
NEXT
Future.PRINT 0, 0, "Page: 1 of" + STR$(Pages%), 15, 0
SetPage 2
FOR i% = 0 TO 300
Future.BOX 640 * RND, 480 * RND, 640 * RND, 480 * RND, RND * 255
NEXT
Future.PRINT 0, 0, "Page: 2 of" + STR$(Pages%), 15, 0
END SUB

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?