I tend to do it using arrays to store the width and height and the x and y positions of the button, like this...
(GET IMAGES AND PLACE THEM)
button_stats(1,1)=100
button_stats(1,2)=100
button_stats(1,3)=50
button_stats(1,4)=20
button_stats(2,1)=100
etc...
do
for x=1 to number of buttons
if mouseover(button_stats(x,1),button_stats(x,2),button_stats(x,3),button_stats(x,4))=1
button_press=x
endif
next x
if button_press=1 then do first button stuff
if button_press=2 then do second button stuff
if button_press=3 then do third button stuff
etc...
loop
function mouseover(x_pos,y_pos,width,height)
if mousex()>x_pos and mousex()<x_pos+width
if mousey()>y_pos and mousey()<y_pos+height
value=1
else
value=0
endif
endif
endfunction value
Yum! Yum! Yum! Yum!