You could take a look here (found using the search button by the way
):
https://forum.thegamecreators.com/thread/112936
Alternatively, try this simple demo:
Rem Project: menu buttons
Rem Created: Tuesday, April 05, 2016
Rem Simple demo of how to create some menu buttons to click on
Rem This method uses the pick object command to decide which of four buttons has been clicked
Rem In this demo the buttons will simply change the colour of the 3D backdrop.
` set up the display
set display mode desktop width(), desktop height(), 32
sync on : sync rate 60 : sync
` take control of the camera
autocam off
position camera 0, 0, -200
point camera 0, 0, 0
` define some variables for the buttons
button1 = 1
button2 = 2
button3 = 3
button4 = 4
` make some simple images for the buttons (you could load your own images instead of course :) )
create bitmap 1, 200, 30 ` all print statements will go this bitmap till later in the code
cls rgb(0,60,0) ` clear the bitmap to dark green
ink rgb(255,255,0), 0 ` set the ink colour to bright yellow for the first button
set cursor 10, 5
print "Yellow"
get image button1, 0, 0, 200, 30, 1
cls rgb(0,60,0) ` clear the bitmap to dark green
ink rgb(255,0,0), 0 ` set the ink colour to bright red for the second button
set cursor 30, 5
print "Red"
get image button2, 0, 0, 200, 30, 1
cls rgb(0,60,0) ` clear the bitmap to dark green
ink rgb(0,255,255), 0 ` set the ink colour to bright cyan for the third button
set cursor 30, 5
print "Cyan"
get image button3, 0, 0, 200, 30, 1
cls rgb(0,60,0) ` clear the bitmap to dark green
ink rgb(0,255,0), 0 ` set the ink colour to bright green for the fourth button
set cursor 10, 5
print "Green"
get image button4, 0, 0, 200, 30, 1
` return output to the screen, i.e. bitmap 0
set current bitmap 0
` make some objects for the buttons, apply our button images to them, and position them sensibly
for button = 1 to 4
make object plain button, 200, 30
texture object button, button
position object button, 0, button*40 - 80, 0
next button
` initialise the button variable - it will be zero if a button is not clicked
button = 0
repeat
if mouseclick() = 1
button = pick object(mouseX(), mouseY(), 1, 4)
select button
case 1
color backdrop rgb(255,255,0) ` this is the action for button 1
endcase
case 2
color backdrop rgb(255,0,0) ` ditto for button 2
endcase
case 3
color backdrop rgb(0,255,255) ` ditto for button 3
endcase
case 4
color backdrop rgb(0,255,0) ` ditto for button 4
endcase
endselect
endif
sync
until spacekey()
end