i have been playing around with 2d (just beacause i am learning generaly)
i came up with this:
gosub _globalvariables
do
gosub _variables
gosub _menu
gosub _change
gosub _pencil
gosub _circle
gosub _box
gosub _3dbox
gosub _rubber
loop
_globalvariables:
global tool=1
global xpos=0
global ypos=0
return
_variables:
radius# =1
xpos=mousex()
ypos=mousey()
return
_menu:
rollover(10,10,50,30,1,"Pencil")
rollover(60,10,100,30,2,"Circle")
rollover(110,10,150,30,3,"Box")
rollover(160,10,200,30,4,"3D Tool")
rollover(210,10,250,30,5,"Rubber")
return
_change:
if shiftkey()=1
input "Tool Selection: ( (1)- Pencil (2)- Circle (3)-Box (4)-3D Box (5)Eraser ) ",tool
endif
return
_pencil:
if tool=1
if mouseclick()=1 then dot xpos,ypos
endif
return
_circle:
if tool=2 then
if mouseclick()=1 then circle xpos,ypos,10
return
_box:
if tool=3
if mouseclick()=1 then box xpos,ypos,xpos+10,ypos+10
endif
return
_3dbox:
if tool=4
if mouseclick()=1 then box xpos,ypos,xpos+10,ypos+10,rgb(232,21,10),rgb(023,120,230),rgb(50,07,80),rgb(60,05,04)
endif
return
_rubber:
if tool=5
if mouseclick()=1 then box xpos,ypos,xpos+10,ypos+10,rgb(0,0,0),rgb(0,0,0),rgb(0,0,0),rgb(0,0,0)
endif
return
function rollover(boxleft,boxtop,boxright,boxbottom,buttonnumber,value$)
box boxleft-1,boxtop-1,boxright+1,boxbottom+1,
box boxleft,boxtop,boxright,boxbottom,RGB(21,19,51),RGB(21,19,51),RGB(116,10,173),C
set text font "arial"
set text size 12
text boxleft+3,boxtop+3,value$
if xpos>boxleft and xpos<boxright and ypos>boxtop and ypos<boxbottom
menu:
box boxleft,boxtop,boxright,boxbottom,RGB(21,19,51),RGB(21,19,51),RGB(116,10,173),RGB(192,192,192)
text boxleft+3,boxtop+3,value$
if mouseclick()=1
if buttonnumber=1
tool=1
endif
if buttonnumber=2
tool=2
wait 100
goto menu
endif
if buttonnumber=3
tool=3
wait 100
goto menu
endif
if buttonnumber=4
tool=4
wait 100
goto menu
endif
if buttonnumber=5
tool=5
wait 100
goto menu
endif
endif
endif
endfunction
function export(exp_dir$,file$,exp_num,exp_value$)
set dir exp_dir$
delete file file$
open to write exp_num,file$
write string exp_num,exp_value$
close file exp_num
endfunction
function export_read(exp_num,file$,read_variable$)
open to read exp_num,file$
read string exp_num,read_variable$
print read_variable$
close file exp_num
endfunction