11-30-2012, 10:50 PM
I've created a menu screen which has a volume slider to increase and decrease the background music volume here is the script:
The menu is supposed to allow the user to decrease or increase the background music - the problem is it only takes affect when the background music stops and starts again - not if it is currently playing, which is why I need to try and incorporate a stop and start value into this.
Code:
#--------------------------------------------------------------------------
def update_se_regulation
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@se_regulation = false
@command_window.active = true
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@se_regulation = false
@command_window.active = true
return
end
if Input.repeat?(Input::RIGHT) and $game_system.se_volume < 100
$game_system.se_play($data_system.cursor_se)
$game_system.se_volume += 1
@option_window.refresh
end
if Input.repeat?(Input::LEFT) and $game_system.se_volume > 0
$game_system.se_play($data_system.cursor_se)
$game_system.se_volume -= 1
@option_window.refresh
end
end
#--------------------------------------------------------------------------
The menu is supposed to allow the user to decrease or increase the background music - the problem is it only takes affect when the background music stops and starts again - not if it is currently playing, which is why I need to try and incorporate a stop and start value into this.