Neko Fondateur
Messages : 184 Date d'inscription : 14/07/2013 Age : 25 Localisation : Ici, la plupart du temps.
| Sujet: [VX] Fenêtre de message plus petite Ven 2 Aoû - 6:30 | |
| Auteur des modifications : Raymo - Auteur de base : ? ? ? Voici donc une petite modification de Game_Message (rien de bien sorcier, on change juste des nombres) afin d'afficher des messages sur une deux lignes seulement au lieu de 4. Cependant, pour afficher des faces, il est nécessaire d'avoir un faceset réduit, ou les visages sont de taille 48*48, de cette taille là : Code (à coller au-dessus du Main, comme d'habitude) - Code:
-
class Window_Message #-------------------------------------------------------------------------- # * Constants #-------------------------------------------------------------------------- MAX_LINE = 2 # Maximum number of lines #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 336, 544, 80) self.z = 200 self.active = false self.index = -1 self.openness = 0 @opening = false # WIndow opening flag @closing = false # Window closing flag @text = nil # Remaining text to be displayed @contents_x = 0 # X coordinate for drawing next character @contents_y = 0 # Y coordinate for drawing next character @line_count = 0 # Line count drawn up until now @wait_count = 0 # Wait count @background = 0 # Background type @position = 2 # Display position @show_fast = false # Fast forward flag @line_show_fast = false # Fast forward by line flag @pause_skip = false # Input standby omission flag create_gold_window create_number_input_window create_back_sprite end #-------------------------------------------------------------------------- # * New Page #-------------------------------------------------------------------------- def new_page contents.clear if $game_message.face_name.empty? @contents_x = 0 else name = $game_message.face_name index = $game_message.face_index size = 48 bitmap = Cache.face(name) rect = Rect.new(0, 0, 0, 0) rect.x = index % 4 * 48 + (48 - size) / 2 rect.y = index / 4 * 48 + (48 - size) / 2 rect.width = size rect.height = size self.contents.blt(0, 0, bitmap, rect) bitmap.dispose @contents_x = 64 end @contents_y = 0 @line_count = 0 @show_fast = false @line_show_fast = false @pause_skip = false contents.font.color = text_color(0) end #-------------------------------------------------------------------------- # * New Line #-------------------------------------------------------------------------- def new_line if $game_message.face_name.empty? @contents_x = 0 else @contents_x = 64 end @contents_y += WLH @line_count += 1 @line_show_fast = false end #-------------------------------------------------------------------------- # * Set Window Background and Position #-------------------------------------------------------------------------- def reset_window @background = $game_message.background @position = $game_message.position if @background == 0 # Normal window self.opacity = 255 else # Dim Background and Make it Transparent self.opacity = 0 end case @position when 0 # Top self.y = 0 @gold_window.y = 360 when 1 # Middle self.y = 144 @gold_window.y = 0 when 2 # Bottom self.y = 336 @gold_window.y = 0 end end #--------------------------------------------------------------- # * Start Number Input #-------------------------------------------------------------------------- def start_number_input digits_max = $game_message.num_input_digits_max number = $game_variables[$game_message.num_input_variable_id] @number_input_window.digits_max = digits_max @number_input_window.number = number if $game_message.face_name.empty? @number_input_window.x = x else @number_input_window.x = x + 64 end @number_input_window.y = y + @contents_y @number_input_window.active = true @number_input_window.visible = true @number_input_window.update end #-------------------------------------------------------------------------- # * Update cursor #-------------------------------------------------------------------------- def update_cursor if @index >= 0 x = $game_message.face_name.empty? ? 0 : 64 y = ($game_message.choice_start + @index) * WLH self.cursor_rect.set(x, y, contents.width - x, WLH) else self.cursor_rect.empty end end end
Screen : | |
|