There are a few ways depending on how your buttons are being displayed.
If you are pasting the image into place then you can simply check the coordinates of the image to see if the mouse button is being pressed while within those coordinates
if mouseclick() > 0
if mousex() >= ButtonX and mousex() <= ButtonX+ButtonWidth
if mousey() >= ButtonY and mousey() <= ButtonY+ButtonHeight
` We got here because the button was pressed
endif
endif
endif
If you are using a sprite then there is also another way
function Pick_Sprite_Setup()
get image 9999,0,0,1,1
sprite 9999, 0, 0, 9999
hide sprite 9999
endfunction
function Pick_Sprite(Target)
local Hit as integer
sprite 9999,mousex(),Mousey(),9999
Hit = sprite collision(9999,Target)
endfunction Hit
Call Pick_Sprite_Setup at the top of your code, and then you can call the Pick_Sprite function with the sprite number of your exit button when the mouse button is pressed.. If you get a non-zero number back then the mouse is positioned over the exit button sprite.
*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++
http://www.matrix1.demon.co.uk