follow my heart...
分类:
2006-09-12 12:25:39
SLEEP按F5键开始编译执行.
LOCATE 10,10
PRINT "I'm the center of the universe!"
SLEEP
3、Screen13
在代码之前加入screen13,看到会多么简单的进入图形模式
SCREEN 13
PRINT "Hello World!"
SLEEP
你可以像QB下面一样简单的使用这些命令
SCREEN 13
LINE (1,1)-(100,100),1,bf
PRINT "Hello World!"
CIRCLE (10,10),10,2
PSET (30,15),3
SLEEP
Freebasic同样具有qb所不具备的特性,qb的屏幕不会大于14,而FREEBASIC却可以。
SCREEN 15
LINE (1,1)-(100,100),1,bf
PRINT "Hello World!"
CIRCLE (10,10),10,2
PSET (30,15),3
用screen打开图形模式后,你可以用alt+enter在窗口呼全屏之间进行切换.
另一个很好的特征是在freebasic下,你可以任何的视频模式下面进行页面翻转.
DIM page
DIM notpage
DIM a,b
screen 12, , 2 'This sets the screen for 2 pages
notpage = 1 'This sets the backpage
DO
IF page = 0 THEN page = 1 ELSE page = 0 'These two lines flip the page and the
IF notpage = 1 THEN notpage = 0 ELSE notpage = 1 'backpage
SCREENSET page, notpage 'This flips the page
CLS 'First we clear the screen
b = b + 1
IF b > 100 THEN b = 0
FOR a = 1 TO 128
PSET (b,a),a 'Then we draw a line. It moves without flickering.
NEXT a
一段简单的代码,获取鼠标的信息
DIM x,y,buttons
CONST escapeKey = 1
SCREEN 12
WHILE NOT MULTIKEY(escapeKey) 'this checks the escape key every frame
GETMOUSE x, y, , buttons 'This gets the mouse state
PRINT x,y,buttons
WEND
LOOP
SLEEP