Having a good brain storm so made this little bit of code to make, making menus a bit easier. graphic are not good, but you'll see how simple the detection is.
the code
first bit just make some colored boxes for background and the menu buttons, then it puts them on screen.
The pick object is a DBP command the second is a sprite function that does the same.
Rem ***** Main Source File *****
sync on
sync rate 60
rem fix camera
autocam off
position camera 0,0,-10
rem set font size and get screen size
set text size 32
sw=screen width()
sh=screen height()
rem make background picture
box 0,0,sw,sh,rgb(0,128,39),rgb(0,192,36),rgb(0,255,0),rgb(128,255,0)
box 5,5, sw-5,sh-5,rgb(0,255,0),rgb(128,255,0),rgb(0,128,39),rgb(0,192,36)
get image 1,0,0,sw,sh,1
rem make 4 menu buttons
for j= 1 to 4
cls 0
box 0,0, text width("Menu "+str$(j))+5,text height("M")+5,rgb(0,128,39),rgb(0,192,36),rgb(0,255,0),rgb(128,255,0)
box 5,5, text width("Menu "+str$(j))-5,text height("M")-5,rgb(0,255,0),rgb(128,255,0),rgb(0,128,39),rgb(0,192,36)
text 2.5,2.5,"Menu "+str$(j)
get image j+1,0,0, text width("Menu "+str$(j))+5,text height("M")+5
make object plain j,15,5
texture object j,j+1
next j
texture backdrop 1
do
position object 1,0,15,30
position object 2,0,5,30
position object 3,0,-5,30
position object 4,0,-15,30
sprite 1,120,120,2
sprite 2,120,230,3
sprite 3,120,340,4
sprite 4,120,450,5
objectmenupicked=pick object(mousex(),mousey(),1,4)
spritemenupicked= picksprite(mousex(),mousey(),1,4)
text 10,10,"You are over Menu ="+str$(objectmenupicked)
text 10,22,"You are over Sprite= "+str$(spritemenupicked)
sync
loop
function picksprite(x,y,s,e)
for sp= s to e
if x=>sprite x(sp) and x=<sprite x(sp)+sprite width(sp) and y=>sprite y(sp) and y=<sprite y(sp)+sprite height(sp)
p=sp
exit
endif
next x
endfunction p
Dark Physics makes any hot drink go cold.