actually, i made a function for a "text button" that is quite flexible and easy to use (but slow).
the function is:
link_text(text$,x,y,debug)
-
text$ is the text to be displayed.
-
x and
y are for the text position
-
debug is for my debugging purposes, always put a zero here.
the function returns a one if the mouse has clicked the text.
all you need to do is this:
BUTTON1=link_text("button 1",100,100,0)
if BUTTON1=1 then do_that()
the function is:
function link_text(text$,x,y,debug):
pressed=0
set text size 16
set text font "fixedsys"
ink rgb(100,100,100),0
text x,y,text$
if in_box2d(x,y,x+text width(text$),y+text height(text$))=1:
if mouseclick()=1 then pressed=1
ink rgb(255,255,255),0
text x,y,text$
endif
if debug=1:
set cursor 0,0
if pressed=1 then ink rgb(255,255,255),0:print "button ","'",text$,"'"," is"," pressed"
if pressed=0 then ink rgb(255,255,255),0:print "button ","'",text$,"'"," is"," NOT pressed"
print "mouse x position is:",mousex()
print "mouse y position is:",mousey()
endif
ink rgb(255,255,255),0
endfunction pressed
EDIT: it also needs this function in your code:
function in_box2d(x1,y1,x2,y2):
mx=MouseX()
my=MouseY()
if (mx >= x1) and (mx <= x2) and (my >= y1) and (my <= y2) then result = 1 else result = 0
endFunction result

forever loading...