Here it is:
_mainmenu:
sync on
do
if text_button(250,220,"New Game")= 1 then cls : goto _newgame
if text_button(250,240,"Credits")= 1 then cls : goto _credits
if text_button(250,260,"Exit The Game")= 1 then end
sync
loop
function text_button(x,y,text$)
tx = text width(text$)
ty = text height(text$)
pressed = 0
if mousex() < x+(tx/2) and mousex() > x-(tx/2)
if mousey() < y+(ty/2) and mousey() > y-(ty/2)
pressed = 1
endif
endif
if pressed = 1
ink rgb(200,0,0),0
else
ink rgb(255,0,0),0
endif
if pressed = 0 then hold = 0
center text x,y-(text size()/2),text$
if mouseclick() = 0 then pressed = 0
endfunction pressed
_credits:
Clouds float the exact same way bricks don't
- Douglas Adams