Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sound effects

Author
Message
Magnolia
15
Years of Service
User Offline
Joined: 19th Jan 2009
Location: New Jersey
Posted: 27th Jan 2009 18:51
Hi,

I have a welcome screen where I have a number of buttons (new game, load game etc), but I'd really like to make it so that when the mouse goes over one of these buttons a clicking noise is made. I have the clicking noise ready, just don't know how to put it to the buttons

Can anyone give me any ideas?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Jan 2009 23:25 Edited at: 27th Jan 2009 23:31
since there are a lotta ways to make a menu (sprites, screen region detection, 3d objects, etc, i'll offer a general guideline:

assuming you have a way of detecting when the mouse is hovering over a menu option (we'll call it CurrentHover) or not (ie, DeadSpace), store that value as a variable... ie, LastHover



that's pretty broad but should give you the idea. without your menu code, we can't be more specific. hope this helps

edit: grrr. i gotta run or i'd add to this to make it more clear... hopefully someone picks up where i left off (or offers a better explanation). good luck!

Virtual Nomad @ California, USA
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 28th Jan 2009 01:32
if your menu is just using boxes you could try getting the mouse x and y and if that location is with in the box loacation play the sound.

NOTE: you will need something to check if the sound is already playing and if it is dont play

Login to post a reply

Server time is: 2024-11-24 14:30:39
Your offset time is: 2024-11-24 14:30:39