theres a few things you have to consider when doing this
imagine each image is 100 x 10 as an example
lets take a look at what we have so far
the top left corner is the first co ordinates
x1,y1
x2,y2
the bottom right hand corner is the other 2 co ordinates we need to know.
we can detect the mouse within this space since we know the area but if its no hard up on the top left corner of the screen it wont work because there is an offset of where the co ordinates start.
this in itself is not enough to detect if the mouse if over this area composed of 4 co ordinates unless we factor in the co ordinates of the offset position.
Lets say for simplicity the image is 100 x 100 offset from the top left hand corner of the screen
and lets manually add up each new x y co ordinate with the offset as well
so
x1 = 100
y1 = 100
x2 = 100 +100 = 200
y2 = 100 +10 = 110
so now we know it would be this result keeping in mind the area of the button and the offset position.
x1 = 100
y1 = 100
x2 = 200
y2 = 110
to write this in code we have to say
if the mouse position is greater then the first two and less then the last two and the mouse is clicked.
to write this into code we would use an if statement something similar to this
If mousex()>x1 and mousex()<x2 and mousey()>y1 and mousey()<y2 and mouseclick()=1
rem perform your button click action here
endif
naturally Ive assumed that the variables x1 x2 y1 y2 have been declared with the values prior to this. Also to make life easier you can visualise the hotspot area with the box command in testing by using the same variables to create a coloured box to see if the hot spot is working correctly before using your button media.