Jump to content
Rpg²S Forum

*JukeBox


Narutofan95
 Share

Recommended Posts

Jukebox

Descrizione

Avete sempre voluto ascoltare una canzone durante il vostro gioco? Grazie al JukeBox, ciò è possibile, fino a quando non si fermerà la canzone o ci sarà uno Stop BGM. La canzone deve essere indicata nello script e essere inserita in BGM.

 

Autore

xLed

 

Allegati

Inserite questa immagine in Pictures

 

http://img398.imageshack.us/img398/6784/pictureow1.png

 

 

Istruzioni per l'uso

Usate il codice

$Scene = Scene_Jukebox.new

per richiamare lo script.

 

Script

 

#===============================Metal Forest inc
#-----------------------------------Presents-----------------------------------
# ** Scene_Jukebox
# ** Created by xLeD translated by Narutofan95
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Jukebox
 #--------------------------------------------------------------------------
 # * Object Initialization
 #	 menu_index : command cursor's initial position
 #--------------------------------------------------------------------------
 def initialize(menu_index = 0)
@menu_index = menu_index
 end
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
# Make song command window
s1 = "Canzone 1"
s2 = "Canzone 2"
s3 = "Canzone 3"
s4 = "Canzone 4"
s5 = "Canzone 5"
s6 = "Indietro"
@command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
@command_window.index = @menu_index
@command_window.x = 210
@command_window.y = 245
@command_window.opacity = 160
@spriteset = Spriteset_Map.new
fadein = true
# Makes the text window
@Textbox = Window_Jukeboxtext.new
@Textbox.x = 0
@Textbox.y = 0

@Textbox2 = Window_Jukeboxtext2.new
@Textbox2.x = 210
@Textbox2.y = 154

@Background = Sprite.new
@Background.bitmap = RPG::Cache.picture("Picture")
@Background.opacity = 255
# Execute transition
Graphics.transition
# Main loop
loop do
  # Update game screen
  Graphics.update
  # Update input information
  Input.update
  # Frame update
  update
  # Abort loop if screen is changed
  if $scene != self
	break
  end
end
# Prepares for transition
Graphics.freeze
# Disposes the windows
@command_window.dispose
@spriteset.dispose
@Textbox.dispose
@Textbox2.dispose
@Background.dispose
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
  update_command
  return
end
 #--------------------------------------------------------------------------
 # * Frame Update (when command window is active)
 #--------------------------------------------------------------------------
 def update_command
# If B button was pressed
if Input.trigger?(Input::B)
  # Play cancel SE
  $game_system.se_play($data_system.cancel_se)
  # Switch to map screen
  $scene = Scene_Map.new
  return
end
# If C button was pressed
if Input.trigger?(Input::C)
  # If command other than save or end game, and party members = 0
  if $game_party.actors.size == 0 and @command_window.index < 4
	# Play buzzer SE
	$game_system.se_play($data_system.buzzer_se)
	return
  end
  # Branch by command window cursor position
  case @command_window.index
  when 0  # Canzone 1
	# Play decision SE
	$game_system.se_play($data_system.decision_se)
	# Switch to item screen
	Audio.bgm_play("Audio/BGM/" + "062-slow05", 100, 100)
  when 1  # Canzone 2
	# Performing decision SE
	$game_system.se_play($data_system.decision_se)
	# The status window is made active
  Audio.bgm_play("Audio/BGM/" + "058-Slow01", 100, 100)
  when 2  # Canzone 3
	# Performing decision SE
	$game_system.se_play($data_system.decision_se)
	# The status window is made active
  Audio.bgm_play("Audio/BGM/" + "013-Theme02", 100, 100)
  when 3  # Canzone 4
	# Performing decision SE
	$game_system.se_play($data_system.decision_se)
	# The status window is made active
  Audio.bgm_play("Audio/BGM/" + "016-Theme05", 100, 100)
  when 4  # Canzone 5
	$game_system.se_play($data_system.decision_se)
	$game_system.bgm_play($data_system.battle_bgm)
  when 5  # Esci
	# Performing decision SE
	$game_system.se_play($data_system.decision_se)
	# Change to game end picture
	$scene = Scene_Map.new
  end
  return
end
 end
 end
#==============================================================================
# ** Window_Jukebox Text
#------------------------------------------------------------------------------
#  This window displays The Text on the menu screen.
#==============================================================================

class Window_Jukeboxtext < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
super(0, 0, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Jukebox")
self.contents.font.color = crisis_color
self.contents.draw_text(4, 0, 220, 32, "Scegli una canzone!", 2)
 end
end
#==============================================================================
# ** Window_Jukebox Text 2
#------------------------------------------------------------------------------
#  This window displays The sceound text on the menu screen.
#==============================================================================

class Window_Jukeboxtext2 < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
self.contents.clear
self.contents.font.color = crisis_color
self.contents.draw_text(4, 0, 120, 32, "Scegli")
 end
end

 

 

 

Bugs e Conflitti Noti

N/A

 

Screen:

http://img400.imageshack.us/img400/123/jukeboxscriptaq2.jpg

 

Note: io ho tradotto lo script, dunque le scritte sono in italiano.

Edited by Narutofan95
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...