vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Sat May 18, 2013 6:14 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Sound add-on for animated buttons
PostPosted: Tue Oct 14, 2008 5:38 am 
Bytewise Operator

Joined: Thu Jul 24, 2008 12:44 pm
Posts: 132
Hi again,

I have a nice add on for animated buttons. What it does is, when you move your mouse over the button or click the button, it plays a sound.

Ok first, add the .wav sound that you want to be played when you move your mouse over the button to the 'sfx' folder. Then open up "sfx.ini" and change "NumSfx=8" to "numSfx=9".

Now open up Gameclient.vbp and go to the code of "frmConnect". Find:

Code:
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)


And add this in that sub:

Code:
sndPlaySound (App.Path & "\sfx\button.wav"), 0


Change "button.wav" to the name of your soundfile.

Now, go to the "sound .bas" module and add this under Option Explicit:

Code:
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


Now you hear a sound when you move your mouse over the button! Yay!

EDIT: Oh yes, this is how to play a sound when you click on the button:

Ok first, add the .wav sound that you want to be played when you click on the button to the 'sfx' folder. Then open up "sfx.ini" and change "NumSfx=9" to "numSfx=10".

Now open up Gameclient.vbp and go to the code of "frmConnect". Find:

Code:
Private Sub Image2_Click()


And add this in that sub:

Code:
sndPlaySound (App.Path & "\sfx\button2.wav"), 0


Change "button2.wav" to the name of your soundfile.


Top
 Profile  
 
 Post subject: Re: Sound add-on for animated buttons
PostPosted: Tue Oct 14, 2008 6:01 am 
Bit Baby

Joined: Tue Sep 02, 2008 12:33 pm
Posts: 382
Location: United Kingdom
Dont wanna make it sound like im stalking you Tharsten :P but good work again. Make sure they are added to the wiki and keep them tutorials coming!


Top
 Profile  
 
 Post subject: Re: Sound add-on for animated buttons
PostPosted: Tue Oct 14, 2008 6:47 am 
Bytewise Operator

Joined: Thu Jul 24, 2008 12:44 pm
Posts: 132
lol, thank you. I will add both tutorials to the wiki, and yes maybe I'll make more tutorials


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group