!<その6> SUB program_stop ! 終了 BEEP SET DRAW MODE HIDDEN DRAW button01(1,ground,"終了",bth,ground) WITH SCALE(bw,bh)*SHIFT(sx,sy) DRAW rect(ground) WITH SCALE(m,0.5)*SHIFT(1,0) IF m>=6 THEN SET TEXT HEIGHT 0.5 ELSE SET TEXT HEIGHT 0.3 SET TEXT COLOR 0 PLOT TEXT ,AT m/2+1,0.3 :"プログラムを終了しました" SET DRAW MODE EXPLICIT STOP END SUB PICTURE start ! 初期画面描画 SET DRAW MODE HIDDEN LET LW=2 ! 線の太さ IF m>16 OR n>14 THEN LET LW=1 DRAW rect(ground) WITH SCALE(m+2,n+2) DRAW rect(board) WITH SCALE(m,n)*SHIFT(1,1) SET LINE COLOR 1 SET LINE WIDTH LW FOR i=1 TO n+1 ! ヨコ線 PLOT LINES:1,i;m+1,i NEXT i FOR j=1 TO m+1 ! タテ線 PLOT LINES:j,1;j,n+1 NEXT j SET AREA COLOR 1 ! 丸点 DRAW DISK WITH SCALE(0.04)*SHIFT(3,3) DRAW DISK WITH SCALE(0.04)*SHIFT(m-1,3) DRAW DISK WITH SCALE(0.04)*SHIFT(3,n-1) DRAW DISK WITH SCALE(0.04)*SHIFT(m-1,n-1) SET TEXT JUSTIFY "CENTER","HALF" SET TEXT HEIGHT 0.25 FOR i=1 TO m ! alphabet表示 IF i<=26 THEN PLOT TEXT ,AT i+0.5,0.7:CHR$(96+i) ELSEIF i<=52 THEN PLOT TEXT ,AT i+0.5,0.7:CHR$(38+i) ELSE PLOT TEXT ,AT i+0.5,0.7:STR$(i) END IF NEXT i FOR j=1 TO n ! 数字表示 PLOT TEXT ,AT 0.7,j+0.5:STR$(j) NEXT j LET bw=0.8 ! ボタン幅 LET bh=0.5 ! ボタン高 LET bth=0.5*bh ! ボタン文字高さ LET ex=m+1.1 ! ボタンの左上点x LET ey=0.25 ! ボタンの左上点y DRAW button01(0,3,"EDIT",bth,ground) WITH SCALE(bw,bh)*SHIFT(ex,ey) LET px=m+1.1 LET py=n/2+1.25 DRAW button01(0,5,"PASS",bth,ground) WITH SCALE(bw,bh)*SHIFT(px,py) LET sx=0.1 LET sy=0.25 DRAW button01(0,8,"終了",bth,ground) WITH SCALE(bw,bh)*SHIFT(sx,sy) LET bgw=0.7 ! [back][go]ボタン幅 LET bgh=0.6 ! [back][go]ボタン高 LET by=n+1.2 LET imw=0.2+0.2 ! [最初に戻る]ボタン幅 LET ix=m-0.25-0.5 DRAW button01(0,8,"",1,ground) WITH SCALE(imw,bgh)*SHIFT(ix,by) LET bx=m+0.05-0.3 DRAW button01(0,8,"",1,ground) WITH SCALE(bgw,bgh)*SHIFT(bx,by) LET gx=m+0.85-0.3 DRAW button01(0,8,"",1,ground) WITH SCALE(bgw,bgh)*SHIFT(gx,by) LET mx=m+1.65-0.3 DRAW button01(0,8,"",1,ground) WITH SCALE(imw,bgh)*SHIFT(mx,by) SET AREA COLOR 1 ! ボタンの模様 DRAW rect(1) WITH SCALE(0.12,bgh-0.2)*SHIFT(ix+0.14,by+0.1) PLOT AREA:bx+0.1,by+bgh/2;bx+bgw-0.1,by+bgh-0.1;bx+bgw-0.1,by+0.1 PLOT AREA:gx+bgw-0.1,by+bgh/2;gx+0.1,by+bgh-0.1;gx+0.1,by+0.1 DRAW rect(1) WITH SCALE(0.12,bgh-0.2)*SHIFT(mx+0.14,by+0.1) SET DRAW MODE EXPLICIT ! 画面に描画 WAIT DELAY 0.3 !<その7>に続く
|