Splash screen and GUI "music"
by Stefano Santo Sabato · in Torque 3D Public · 11/13/2009 (1:57 am) · 7 replies
Hi,
I'd like to have some iformations or a tutorial on how to put music into the splash screen or into a GUI.
Thank you very much
I'd like to have some iformations or a tutorial on how to put music into the splash screen or into a GUI.
Thank you very much
#2
11/15/2009 (6:35 pm)
I used the official docs to find out how to put audio into my game (not for the GUI, but the docs are for all audio). Hope that helps.
#3
A simple way is to use the onWake() method.
This will start the music when the GUI comes up. To end the music when the control is removed, use onSleep.
11/20/2009 (1:43 am)
A simple way is to use the onWake() method.
function MyControl::onWake( %this )
{
%this.audio = sfxPlayOnce( MyAwesomeSound );
}This will start the music when the GUI comes up. To end the music when the control is removed, use onSleep.
function MyControl::onSleep( %this )
{
if( isObject( %this.audio ) )
%this.audio.stop(); // Place fadeOut on SFXDescription for nice fade.
}
#4
When I try to put your snippet in my startup GUI it does not work.
console sais to me that there is something wrong in what I'm writing
11/23/2009 (12:42 pm)
thank you for your answer.When I try to put your snippet in my startup GUI it does not work.
console sais to me that there is something wrong in what I'm writing
#5
Looks like you have a syntax error there. If you post the snippet from the console.log, we can help you further.
11/23/2009 (4:20 pm)
Looks like you have a syntax error there. If you post the snippet from the console.log, we can help you further.
#6
It was a simple sintax problem :-(
Now audio works.
But I need to stop it before launcing the mission.
Is there a simple way to do this ??
thanks
11/24/2009 (6:15 am)
thank you.It was a simple sintax problem :-(
Now audio works.
But I need to stop it before launcing the mission.
Is there a simple way to do this ??
thanks
#7
As described above, the easiest way is to use onSleep to stop the sound when the GUI is removed from the canvas.
11/24/2009 (4:19 pm)
As described above, the easiest way is to use onSleep to stop the sound when the GUI is removed from the canvas.
Torque Owner Stefano Santo Sabato
MediaSoft s.r.l.