Heres a snippet:
Function button(x,y,xsize,ysize,image,imageover,imageclick, clicktype, spriten)
If mousex()>=(x) and mousex()<=(xsize+x) and mousey()>=(y) and mousey()<=(ysize+y)
im = imageover
If mouseclick() = clicktype Then im = imageclick: clicked = 1
Else
im = image
Endif
Sprite spriten, x, y, im
Size sprite spriten,xsize, ysize
Endfunction clicked
You use it like this:
If button(10,10,100,100,1,2,3,1,1) Then ...
Parameters are, respectively,
button position x
button position y
button size x
button size y
button image
image on mouse over
image on mouse click
click type for "true" return
sprite number - must be different from any other sprite number
All programmers are playwrights and all computers are lousy actors." -Anon.
<--- Uh... Um... Oh I forgot