Hmm, I tried to get a goto in there but I failed. the str$() command didn't help me too much. Not sure if it's worthwhile to use a goto statement in a function. You'll probebly be better off just adding a few lines of code like.
If mousex()>10 and mousey()>0 then goto location.
Then you can just use your nifty function to create the buttons and easily code the goto.
Anyways, not sure if that's what you wanted to here but I made a button function for you.
sync on : sync rate 60 `Setup our refresh rate
set text size 22 `Set the text size
do
`This tests our regular button.
Button("BUTTON TEST",10,20,10,150,20,30)
sync
loop
`Text represents what you'll see
`positionx represents where the text will fall on the x axis.
`positiony represents where the text will fall on the y axis.
`x1 represents what mousex must be greater than.
`x2 represetns what mousex must be less than.
`y1 represetns what the mouse y must be greater than.
`y2 represetns what the mouse y must be less than.
function Button(text$,positionx,positiony,x1,x2,y1,y2)
ink rgb(255,255,255),1
text positionx,positiony,""+text$
if mousex()>x1 and mousex()<x2 and mousey()>y1 and mousey()<y2
ink rgb(255,0,0),1
text positionx,positiony,""+text$
endif
endfunction
A book? I hate book. Book is stupid.
(Formerly known as Yellow)