TimpaniでRPGを作ろう!

―フェードイン、フェードアウト―


トップページに戻る




S口さんが、BGMをフェードイン/フェードアウトする方法を寄せてくださいました。ご本人の了承を得て、ここで公開します。

S口さん、本当にありがとうございました。

フェードインのスクリプト


on FadeIn Speed
set the audioLevel of window ["BGMのファイル名"] to 0
send "Play" to window ["BGMのファイル名"]
put ([もともとの音量]/Speed) into VolumeAdd
repeat Speed
get the audioLevel of window ["BGMのファイル名"]
put it into Volume
Add VolumeAdd to Volume
set the audioLevel of window ["BGMのファイル名"] to round of Volume
wait 3
end repeat
end FadeIn




on FadeOut Speed
global BGMDATA
put the audioLevel of window ["BGMのファイル名"] into Volume
put -1*(Volume/Speed) into VolumeAdd
repeat Speed
Add VolumeAdd to Volume
set the audioLevel of window ["BGMのファイル名"] to round of Volume
wait 3
end repeat
send "GoTop" to window ["BGMのファイル名"]
set the audioLevel of window "Theme1" to [もともとの音量] --次の演奏の為に元に戻す
end FadeOut




トップページに戻る










最終更新:2006年4月12日