Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: kyofast on April 18, 2020, 11:09:08 AM
-
Good afternoon.
I would like to know if there is any way to put custom music on the screen saver, if so what would be the code?
Thanks.
-
try:
function 'functionName' (){
if(screensaver == true){
local 'name' = fe.add_sound("'path_to_audio'")
'name'.playing = true
}
}
*notes:
I've never had a screensaver on before, so I have no idea what the screensaver check actually is (the provided if() code will not work)
replace 'funcionName' with any name you want (remove the apostrophes)
replace 'name' with any other name you want (remove the apostrophes)
replace 'path_to_audio' with your audio clip (remove apostrophes, but keep the quotation marks)(note that the provided path is relative to your layout.nut file)
hope this helps, also check the following sites:
http://www.squirrel-lang.org/squirreldoc/index.html
https://github.com/mickelson/attract/blob/master/Layouts.md#add_sound
-
thank you very much, i will try it
Cheers