first problem this snippet should give you a idear on how to solve it.
line_index = 0
do
if mouseclick() = 0 then mouse_hold = 0
IF mouseclick() = 1 and mouse_hold = 0
mouse_hold = 1
select case line_index
case 0
L_X1 = mouseX()
L_Y1 = mouseY()
line_index = line_index + 1
case 1
ink rgb( rnd(255) , rnd(255) , rnd(255) ) , 0
line L_X1 , L_Y1 , mouseX() , mouseY()
L_X1 = 0
L_Y1 = 0
line_index = 0
endselect
endif
sync
loop
Second problem is a lot harder. DBP does not have a fill circle command. you might want to google flood filler. There is a few dll's that add commands that dbp should have.
the point command returns the colour value from the screen. This snippet should help . button function that i use all the time.
function fun_Draw_button( X , Y , Width , Height , Text$ )
Ink rgb( 220 , 0 , 0 ) , 0
box X , Y , X + Width , Y + Height
ink rgb( 0 , 0 , 0 ) , 0
box X + 2 , Y + 2 , X + Width - 2 , Y + Height - 2
YesORNo = 0
if mousex() >= X
if mousex() <= X + width
if mousey() >= Y
if mousey() <= Y + HEIGHT
YesORNo = 1
endif
endif
endif
endif
if YesORNo = 0
ink rgb(255,0,0),0
else
ink rgb(255,255,255),0
endif
Temp_text_X = X + (Width / 2)
Temp_Text_Y = Y + ((Height - 15) / 2)
center text Temp_text_X , Temp_Text_Y , Text$
endfunction YesORNo