The Ringmaster,
Hope this code helps you. This code is good for 4 buttons and all the combos of those buttons while clicking. I am just going to put the code right here in the msg, I don't know how to do those snippets, maybe some one could tell me.
REM Project: Clickable Buttons
REM Created: 7/17/2005 7:04:33 PM
REM
REM ***** Main Source File *****
REM
set display mode 640,480,32
cls
sync on
rem load backgraound
load bitmap "Background.bmp",1
rem load buttons
load bitmap "a.bmp",2
get image 2,0,0,120,50
load bitmap "b.bmp",3
get image 3,0,0,120,50
ButtonX = 320
ButtonY = 240
ButtonXSize = (120/2)
ButtonYSize = (50/2)
MouseState = 0
sprite 2,ButtonX,ButtonY,2
offset sprite 2,ButtonXSize,ButtonYSize
do
copy bitmap 1,0,0,640,480,0,0,0,640,480
set current bitmap 0
MouseState = MouseClick()
if OverButton(ButtonX,ButtonY,ButtonXSize,ButtonYSize,MouseX(),MouseY())
sprite 2,ButtonX,ButtonY,3
select MouseState
case 0
center text 320,10,"No Click"
endcase
case 1
center text 320,10,"Left Click"
endcase
case 2
center text 320,10,"Right Click"
endcase
case 3
center text 320,10,"Right and Left CLick"
endcase
case 4
center text 320,10,"Third Button Pressed"
endcase
case 5
center text 320,10,"Right Click and Left Click"
endcase
case 6
center text 320,10,"Right Click and Third Button"
endcase
case 7
center text 320,10,"Left Click and Right Click and Third Button"
endcase
case 8
center text 320,10,"Fourth Button Pressed"
endcase
case 9
center text 320,10,"Left Click and Fourth Button"
endcase
case 10
center text 320,10,"Right Click and Fourth Button"
endcase
case 11
center text 320,10,"Left CLick and Right Click and Fourth Button"
endcase
case 12
center text 320,10,"Third Button and Fourth Button"
endcase
case 13
center text 320,10,"Left CLick and Third Button and Fourth Button"
endcase
case 14
center text 320,10,"Right Click and Third Button and Fourth Button"
endcase
case 15
center text 320,10,"ALL BUTTONS!!!!!!!!!!!!!!!"
endcase
endselect
else
sprite 2,ButtonX,ButtonY,2
endif
sync
loop
function OverButton(BX,BY,BW,BH,MX,MY)
ButtonState = 0
dx = abs(BX - MX)
dy = abs(BY - MY)
if (dx < BW)
if (dy < BH)
ButtonState = 1
endif
endif
endfunction ButtonState
If I am crazy, and the world is crazy, then I am normal.