Guest User

Untitled

a guest
Jun 20th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. ####################################################################
  2. # Audio in menu
  3. #
  4. # By: SojaBird
  5. # Discription: Play BGM in the menu
  6. #
  7. ####################################################################
  8. module Audio_Setup
  9.  
  10. BGM = "Town2" # The name of the bgm, leave empty ("") to shut off this function ["..."].
  11. Volume = 100 # The volume of the bgm [0-100].
  12. Pitch = 100 # The pitch of the bgm [50-150].
  13.  
  14. end
  15.  
  16.  
  17. #==============================================================================
  18. # ** Scene_Menu
  19. #------------------------------------------------------------------------------
  20. # This class performs the menu screen processing.
  21. #==============================================================================
  22.  
  23. class Scene_Menu < Scene_Base
  24. include Audio_Setup
  25. alias audio_start start
  26. alias audio_update_command_selection update_command_selection
  27. #--------------------------------------------------------------------------
  28. # * Start processing
  29. #--------------------------------------------------------------------------
  30. def start
  31. audio_start
  32. Audio.bgm_play("Audio/BGM/" + BGM, Volume, Pitch) if BGM != ""
  33. end
  34. #--------------------------------------------------------------------------
  35. # * Update Command Selection
  36. #--------------------------------------------------------------------------
  37. def update_command_selection
  38. if Input.trigger?(Input::B)
  39. Audio.bgm_stop
  40. $game_map.autoplay
  41. end
  42. audio_update_command_selection
  43. end
  44. end
Add Comment
Please, Sign In to add comment