i downloaded this menu and changed it a bit.
sync on : sync rate 0
if level=0
gosub initbuttons
f$="Arial" : fs=14
blue as dword
white as dword
red as dword
green as dword
blue = rgb(0,0,255)
white = rgb(255,255,255)
red = rgb(255,0,0)
green = rgb(0,255,0)
if menu = 0
makebutton(160,50,"Start Game",f$,fs,blue,white,blue,white,120,0,1,0)
makebutton(160,150,"Quit",f$,fs,blue,white,blue,white,120,0,1,0)
endif
do
cls
butpressed=drawbuttons()
if butpressed = 1 and menu = 0
menu = 1
if menu = 1
makebutton(440,50,"Ranger",f$,fs,blue,white,blue,white,120,0,1,0)
makebutton(440,100,"Thief",f$,fs,blue,white,blue,white,120,0,1,0)
makebutton(440,150,"Scout",f$,fs,blue,white,blue,white,120,0,1,0)
endif
endif
sync
cls
butpressed=drawbuttons()
if butpressed > 0
ink rgb(255,255,255),0
text 0,0,"You are pressing button "+str$(butpressed)
endif
sync
cls
butpressed=drawbuttons()
if butpressed = 3 and menu = 1
class = 1
load object "map1.x",1
endif
cls
butpressed=drawbuttons()
if butpressed = 4 and menu = 1
class = 2
endif
cls
butpressed=drawbuttons()
if butpressed = 5 and menu = 1
class = 3
endif
if class = 1 then s = 8 : i = 9 : a = 10
if class = 2 then s = 4 : i = 6 : a = 14
if class = 3 then s = 6 : i = 8 : a = 23
if returnkey()=1 then print "a=";a
sync
sync
loop
function makebutton(x as integer, y as integer, s$ as string, f$ as string, fs as integer, sc as dword, sr as dword, bc as dword, br as dword, bw as integer, bh as integer, xj as integer, yj as integer)
inc bt
b(bt).x=x : b(bt).y=y
b(bt).s=s$
b(bt).f=f$ : b(bt).fs=fs
b(bt).sc=sc : b(bt).sr=sr
b(bt).bc=bc : b(bt).br=br
b(bt).bw=bw : b(bt).bh=bh
b(bt).xj=xj : b(bt).yj=yj
endfunction
function drawbuttons
v=0 : mx=mousex() : my=mousey() : mc=mouseclick()
for f=1 to bt
set text font b(f).f : set text size b(f).fs
s$=b(f).s : tw=text width(s$) : th=text height(s$)
w=b(f).bw : if w = 0 then w=tw+10
h=b(f).bh : if h = 0 then h=th+10
xj=b(f).xj : yj=b(f).yj : x=b(f).x : y=b(f).y
x1=x : x2=x+w : y1=y : y2=y+h
rollover=0
if mx >= x1 and mx <= x2 and my >= y1 and my <= y2
rollover=1
if mc = 1
v=f
endif
endif
if rollover=1 : ink b(f).sc,0 : else : ink b(f).sr,0 : endif
if xj=1 : l=x+5 : else : if xj=0 : l=((x1+x2)/2)-(tw/2) : else : l=x2-5-tw : endif : endif
if yj=1 : t=y+5 : else : if yj=0 : t=((y1+y2)/2)-(th/2) : else : t=y2-5-th : endif : endif
text l,t,s$
if rollover=1 : ink b(f).bc,0 : else : ink b(f).br,0 : endif
line x1,y1,x2,y1 : line x2,y1,x2,y2 : line x2,y2,x1,y2 : line x1,y2,x1,y1
next f
set text font defaultfont$ : set text size defaultsize
endfunction v
initbuttons:
type but
x as integer
y as integer
s as string
f as string
fs as integer
sc as dword
sr as dword
bc as dword
br as dword
bw as integer
bh as integer
xj as integer
yj as integer
endtype
dim b(50) as but
global bt,defaultfont$,defaultsize
bt=0 : defaultfont$ = text font$() : defaultsize = text size()
return
endif
but how do i get the buttons to hide or delete them