i found my copy of darkbasic pro and installed it and once again trying to grasp the basics here is a simple piece of code, a simple menu rollover.
do
xpos=mousex()
ypos=mousey()
box 100,100,150,200
for boxsizex=100 to 150
for boxsizey=100 to 200
if ypos=boxsizey and xpos=boxsizex
cls
box 100,100,150,200,rgb(200,29,45),rgb(200,29,45),rgb(100,22,75),rgb(200,23,125)
if mouseclick()=1 then print "hello"
endif
next boxsizex
next boxsizey
loop
as you can see very crude but it does work, so i tried to take it a lil further:
boxleft=100
boxtop=100
boxright=200
boxbottom=200
do
xpos=mousex()
ypos=mousey()
box boxleft,boxtop,boxright,boxbottom
for boxsizex=boxleft to boxright
for boxsizey=boxtop to boxbottom
if ypos = boxsizey and xpos = boxsizex
cls
box boxleft,boxtop,boxright,boxbottom,rgb(200,29,45),rgb(200,29,45),rgb(100,22,75),rgb(200,23,125)
if mouseclick()=1 then print "hello"
endif
next boxsizex
next boxsizey
loop
now its a bit tidier and it still works, now here is my problem, im trying to convert it to a function, here is what i have:
boxleft=0
boxtop=0
boxright=0
boxbottom=0
do
xpos=mousex()
ypos=mousey()
rollover(100,100,200,200)
loop
function rollover(boxleft,boxtop,boxright,boxbottom)
box boxleft,boxtop,boxright,boxbottom
for boxsizex=boxleft to boxright
for boxsizey=boxtop to boxbottom
if ypos = boxsizey and xpos = boxsizex
cls
box boxleft,boxtop,boxright,boxbottom,rgb(200,29,45),rgb(200,29,45),rgb(100,22,75),rgb(200,23,125)
if mouseclick()=1 then print "hello"
endif
next boxsizex
next boxsizey
endfunction
as you can see the code, no longer works, if anyone can help thanks to them in advance, Dan Smith
[IMG] http://www.sharksoftdbspot.com/Ban.gif[/IMG]