#This is for the "Are you sure you want to quit" message boxclass New_Text_Creator < Window_Base def initialize() super( 122, 170, 300, 75 ) end def change_text ( text ) contents.clear return unless text.is_a?(String) draw_text(text, 15, -200, 300, 450) #This is defined below end #-------------------------------------------------------------------------- # * Draw Text # args : Same as Bitmap#draw_text. #-------------------------------------------------------------------------- def draw_text(text, x, y, text_width, text_height, alignment = 0) contents.draw_text(x, y, text_width, text_height, text, alignment) #This is the contents of this message box endend#This is used by doing: # @new_text_creator = New_Text_Creator.new# @new_text_creator.change_text(#Insert_Text)
Code:
#This is the scene that is ultimately calledclass Scene_Exit < Scene_MenuBase def start super create_command_window end def create_command_window @command_window = Scene_ExitCommand.new #creates new instance of Scene_ExitCommand @command_window.set_handler(:exit, method(:exit_game)) @command_window.set_handler(:cancel, method(:return_scene)) end #-------------------------------------------------------------------------- # * Makes the exit command #-------------------------------------------------------------------------- def exit_game exit endendCode:
If anyone could make these 2 message boxes into 1 message box, that would be great!#This makes the window for Scene_Exit and makes the commands themselvesclass Scene_ExitCommand < Window_Command def initialize super(230, 245) end def make_command_list exit_command end def window_width return 90 end def window_height return 75 end def exit_command @new_text_creator = New_Text_Creator.new @new_text_creator.change_text("Are you sure you want to quit?") add_command("Yes", :exit) add_command("No", :cancel) endend