Tuesday, February 12, 2013

Shared Program (3)

    This shared program is from Sergio Menegon. It is a Paint Brush program, where you can select the color and the size of the brush and you have the ability to clear the painting. works for iPad in Landscape orientation.

4 REM ---------------------------
5 REM INIZIALIZZAZIONI E PRIMO DISEGNO MENU
6 REM ---------------------------
10 C=1:D=5:LM=50:AM=40:TP=50
20 SCREEN 1:CLS
30 GOSUB 30000
10000 REM -----------------------------
10001 REM ATTESA TAP: OUT IN XT E YT
10002 REM ----------------------------
10010 LX=1030:LY=1032
10020 POKE 1024,0
10030 IF PEEK(1024)=0 GOTO 10030
10040 XT=PEEK(LX)+256*PEEK(1031)
10050 YT=PEEK(1032)+256*PEEK(1033)
11000 REM ------------------------
11010 REM VERIFICA TAP SU MENU
11020 REM ------------------------
11025 REM TAP FUORI MENU SUP MANDA A DISEGNO
11030 IF YT>TP+2*AM+D THEN GOTO 15000
11050 REM TAP SU MENU: DETERMINO RIGA E COL
11060 CO=INT(XT/LM)+1
11065 IF CO>17 THEN GOTO 21000
11070 RI=INT((YT-TP)/AM)+1
11100 REM SETTO NUOVI VALORI E RICORDO VECCHI
11280 IF RI=1 THEN C=CO-1
11290 IF RI=2 THEN D=CO
11300 GOSUB 30000
14900 GOTO 10000
15000 REM ----------------------------
15010 REM PLOT NEL PUNTO TAPPATO
15020 REM ----------------------------
15040 CIRCLE XT,YT,D,C,1
15050 GOTO 10000
21000 REM -----------------------
21010 REM CANCELLA DISEGNO
21020 REM -----------------------
21030 CLS
21040 GOTO 20
30000 REM -----------------------
30005 REM DISEGNA MENU
30010 REM -----------------------
30015 RECT 0,0,19*LM,TP+2*AM,0
30020 FOR CL=0 TO 16
30030 RECT CL*LM,TP,(CL+1)*LM,TP+AM,CL
30035 FRAME CL*LM,TP,(CL+1)*LM,TP+AM,16
30040 FRAME CL*LM,AM+TP,(CL+1)*LM,TP+2*AM,16
30100 NEXT
30110 FOR P=0 TO 16
30120 CIRCLE INT(LM/2)+LM*P,TP+AM+INT(AM/2),P+1,16,1
30130 NEXT
30140 FRAME 17*LM+5,TP,19*LM,TP+2*AM,16
30150 GPRINT "cls",18*LM,TP+AM,16
30160 CIRCLE INT(LM/2)+LM*C,TP+INT(AM/2),AM/4,16,0
30170 CIRCLE INT(LM/2)+LM*(D-1),TP+AM+INT(AM/2),D+3,16,0
31000 RETURN


No comments:

Post a Comment