this is very basic but if anyone could point me in the right direction of linking the objects like in the "3d tool" and the "pencil" too it would be very helpful, any comments on how the code is constructed would be handy
lol i guess it goes without saying but please be harsh but fair. It will be good to hear any comments from people but please be constructive i am still new to the language although i have had DBP for a while (as you might of been able to tell from my forum profile)
thanks all, Dan
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
[IMG] http://www.sharksoftdbspot.com/Ban.gif[/IMG]