|
! デジアナ時計755 (Ver.7.5.5 以降で動きます。)
!-------------------
ASK bitmap SIZE i,j
SET TEXT font "MS ゴシック",MIN(i,j)*18/500
SET TEXT JUSTIFY "center","half"
SET WINDOW -250,250,-250,250
LET ds=3 !20W at1, 21W at3, 24W at6 !秒針の刻み数/秒、大きい程、消費電力増大
LET sc=2 !時計の大きさ
LOCATE VALUE NOWAIT ,AT .4: Bt !文字盤明るさ、初期値(Ver.7.5.5 以降)
DRAW disk WITH SCALE(82*sc) !枠
DO
LET t=INT(TIME*ds)/ds
IF t0<>t THEN
LET t0=t
LOCATE VALUE NOWAIT ,RANGE .2 TO .6: Bt !文字盤明るさ、調整(Ver.7.5.5 以降)
SET COLOR MIX(1) Bt,Bt,Bt
SET DRAW mode hidden
DRAW disk WITH SCALE(75*sc) !文字盤台(clear 兼)
SET COLOR MIX(1) 1,1,1
DRAW logo WITH SCALE(sc/2) !ロゴ Mark
DRAW A_Clock WITH SCALE(sc) !時計
SET DRAW mode explicit
END IF
WAIT DELAY 0 !省電力効果
MOUSE POLL mx,my,mlb,mrb
LOOP UNTIL mrb>=1 !右クリックで停止
!------
PICTURE A_Clock
FOR i=1 TO 12
LET a=-PI/6*(i-3)
PLOT letters,AT 58*COS(a)+.8, 58*SIN(a) :STR$(i) !数字(Ver.7.4.0 以降)
NEXT i
!--- 00:00 からt秒 の針回転 Gear
DRAW hand WITH SCALE(2.5, 0.73)*ROTATE(-t*PI/21600) !時針
DRAW hand WITH ROTATE(-t*PI/1800) !分針
DRAW hand WITH SCALE(0, 1.1)*ROTATE(-t*PI/30) !秒針
DRAW hand WITH SCALE(0.8,0.2)*SHIFT(0,-20)*ROTATE(-t*PI/30) !秒針バランス・ウェイト
!---
FOR i=0 TO 59
LET a=PI/30*i
DRAW disk WITH SCALE(1-.5*SGN(MOD(i,5)))*SHIFT(72*COS(a),72*SIN(a)) !時分目盛り
NEXT i
END PICTURE
PICTURE hand
PLOT AREA: -1,-15; 1,-15; 1,62; -1,62 !3針共用、0時位置の針
END PICTURE
PICTURE logo
PLOT letters,AT 5,20:"DecimalBasic"
PLOT letters,AT 3,-50,USING"%%:%%:%%":IP(t/3600),MOD(IP(t/60),60),MOD(IP(t),60)
END PICTURE
END
!デジタル時刻 不要な場合、最後の1行↑(PLOT letters …) を削除。
|
|