_menu_main:
x = 0
load image "media/images/main_menu_bkgrd.tga",1
do
cls
paste image 1,x,x
if button(screen width()/2,screen height()/2-100,"New Game")then gosub _menu_new_game
if button(screen width()/2,screen height()/2-50,"Load Game")then gosub _menu_load_game
if button(screen width()/2,screen height()/2,"Options")then gosub _menu_options
if button(screen width()/2,screen height()/2+50,"Extras")then gosub _menu_extras
if button(screen width()/2,screen height()/2+100,"Quit")then end
loop
_menu_new_game:
_menu_load_game:
_menu_options:
load sound "media/music/soundtests/soundvolume.wav",1
do
cls
paste image 1,x,x
ink rgb(0,0,0),0
text screen width()/2,screen height()/2-75,"Volume: "+str$(SndVolume)
if mouseclick()=1 and slider1(screen width()/2,screen height()/2-50,SndVolume)>1 then SndVolume=slider1(screen width()/2,screen height()/2-50,SndVolume):noclick=1
slider1(screen width()/2,screen height()/2-50,SndVolume)
set sound volume 1,SndVolume
ink rgb(0,0,0),0
text screen width()/2,screen height()/2-25,"Brightness: "+str$(Bright)
if mouseclick()=1 and slider(screen width()/2,screen height()/2,Bright)>1 then Bright=slider(screen width()/2,screen height()/2,Bright):noclick=1
slider(screen width()/2,screen height()/2,Bright)
loop
_menu_extras:
function Button(x1,y1,WORDS$)
Pressed=0
x2=Text Width(WORDS$)
y2=Text Height(WORDS$)
if mousex()>x1-.5*x2 and mousex()<x1+.5*x2
if mousey() > y1 and mousey() < y1 + text height(WORDS$)
Pressed = 1
endif
endif
if pressed=1 then ink rgb(000,150,255),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=Mouseclick()
else
pressed = 0
endif
center text x1,y1,WORDS$
endfunction pressed
function slider1(x,y,t)
mx=mousex()
my=mousey()
ink rgb(55,55,55),0
if mx>x-30 and mx<x+130 and my>y-10 and my<y+10 then ink rgb(0,0,0),0:loop sound 1
line x,y-2,x+101,y-2
line x,y+2,x,y-2
line x,y+2,x+100,y+2
line x+100,y+2,x+100,y-2
line x+t-2,y+5,x+t+2,y+5
line x+t+2,y-5,x+t+2,y+5
line x+t-2,y-5,x+t+2,y-5
line x+t-2,y-5,x+t-2,y+5
value=0
if mx>x-30 and mx<x+130 and my>y-10 and my<y+10 and mouseclick()=1
value=mx-x
endif
if value>100 then value=100
if value<1 then value=1
endfunction value
function slider(x,y,t)
mx=mousex()
my=mousey()
ink rgb(55,55,55),0
if mx>x-30 and mx<x+130 and my>y-10 and my<y+10 then ink rgb(0,0,0),0:play sound 1
line x,y-2,x+101,y-2
line x,y+2,x,y-2
line x,y+2,x+100,y+2
line x+100,y+2,x+100,y-2
line x+t-2,y+5,x+t+2,y+5
line x+t+2,y-5,x+t+2,y+5
line x+t-2,y-5,x+t+2,y-5
line x+t-2,y-5,x+t-2,y+5
value=0
if mx>x-30 and mx<x+130 and my>y-10 and my<y+10 and mouseclick()=1
value=mx-x
endif
if value>100 then value=100
if value<1 then value=1
endfunction value
It plays the sound a million times, sounding like a Machine Gun kind of. I want it to play the music only when the mouse is over the slider.
Thanks in advance,
Jim
Your signature has been erased by a mod because it's larger than 600x120....