how would i implement this piece of code
Into this script
Code:
class Scene_Menu
alias main_menu_back main
def main
@spriteset = Spriteset_Map.new
main_menu_back
@spriteset.dispose
end
end
Into this script
Code:
#---------------------------------------------------------------------
#Test script
#===================================================
class Scene_Chapter3_menu1
def initialize(menu_index = 0)
@menu_index = menu_index #Store the cursor position
end
#--------------------------------------------------------------------------------------------------------
def main
@window_a1=Window_a1.new #Content Window
@window_a1.update(false) #Decide whether to show/hide the content...
@window_a1.x=218
@window_a1.y=400
s1 = "Items"
s2 = "Infos"
s3 = "Music A"
s4 = "Music B"
s5 = "Exit"
@window_a2 = Window_Command.new(200, [s1,s2,s3,s4,s5]) #Remember, 200 is the Width
@window_a2.y=400#Set a position for the menu other than 0:0
@window_a2.x=290
@window_a2.width=350
@window_a2.height=80 #Force a new height for the menu window
@window_a2.index = @menu_index
#This is what makes the scene update itself constantly:
Graphics.transition
loop do
Graphics.update
Input.update
update #Call the method DEF UPDATE starting below
if $scene != self
break
end
end
#Execute when exiting the scene:
Graphics.freeze
@window_a1.dispose
@window_a2.dispose
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------------------------------------
def update
@window_a2.update #menu
if Input.trigger?(Input::B) #Press ESCAPE to exit
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
$game_map.autoplay #Because we play music in the menu...
end
end
#--------------------------------------------------------------------------------------------------------
#Options Method Start Here:
#--------------------------------------------------------------------------------------------------------
end #of the Scene !
#===================================================
#===================================================
#===================================================
#===================================================
class Window_a1 < Window_Base
def initialize
super(300, 300, 50,80)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 20
end
def update(content) #Receive the argument from the menu
if content == false #If false, don't show content
self.contents.clear
self.contents.draw_text(0, 0, 120, 32, "No Content...")
else #else, if true, show it...
self.contents.clear
self.contents.draw_text(0, 0, 440, 32, "SHOW CONTENT")
end
end
end
#===================================================
#===================================================