Age : 30 Inscrit le : 22/12/2011 Messages : 1600
| Sujet: Message background Sam 3 Aoû 2013 - 11:19 | |
| Crédit: GalvCe script vous permet de remplacer votre boite de dialogue par une image: Votre image doit être dans la partie Graphics/System de votre projet. Script: - Code:
-
#------------------------------------------------------------------------------# # Galv's Message Background #------------------------------------------------------------------------------# # For: RPGMAKER VX ACE # Version 1.1 #------------------------------------------------------------------------------# # 2013-02-10 - version 1.1 - dim and transparent settings work with image now # 2012-12-02 - version 1.0 - release #------------------------------------------------------------------------------# # This script displays an image file for a message background instead of using # the windowskin. If you are using Galv's Message Busts put this script ABOVE. # # This image background will not stretch to fit, that's not it's purpose. # I encourage you to make your own message background images, the ones in the # demo are just quick examples! #------------------------------------------------------------------------------# # INSTRUCTIONS: # Put in script list below Materials and above Main. # # Read the instructions #------------------------------------------------------------------------------# # SCRIPT CALL #------------------------------------------------------------------------------# # # msgbg("ImageName", y_offset) # To change message background during game # # "ImageName" is the new file name to use # # y_offset is the new IMAGE_Y for that bg # EXAMPLE # msgbg("MsgImage", -98) # #------------------------------------------------------------------------------#
($imported ||= {})["Galvs_Message_Background"] = true module Galv_Msgbg
#------------------------------------------------------------------------------# # SCRIPT SETTINGS #------------------------------------------------------------------------------#
# DEFAULT MESSAGE # MESSAGE_IMAGE = "Message" # Name of image in /Graphics/System to use for # the message background.
IMAGE_Y = -296 # Y offset of image
DISABLE_SWITCH = 550 # Turn swith ON to disable image background #------------------------------------------------------------------------------# # END SCRIPT SETTINGS #------------------------------------------------------------------------------#
end
class Window_Message < Window_Base alias galv_msgbg_window_create_back_bitmap create_back_bitmap def create_back_bitmap @bg ||= Sprite.new if !$game_message.message_bg.nil? @bg.bitmap = Cache.system($game_message.message_bg) @current_bg = $game_message.message_bg end @bg.z = z - 1 @bg.opacity = 0 galv_msgbg_window_create_back_bitmap end alias galv_msgbg_window_dispose dispose def dispose galv_msgbg_window_dispose dispose_msgbg if !@bg.nil? end def dispose_msgbg @bg.dispose @bg.bitmap.dispose end alias galv_msgbg_window_update_back_sprite update_back_sprite def update_back_sprite if !$game_switches[Galv_Msgbg::DISABLE_SWITCH] update_msgbg if openness > 0 @bg.opacity = 0 if openness == 0 else galv_msgbg_window_update_back_sprite @bg.opacity = 0 end @bg.update @back_sprite.update end def update_msgbg if $game_message.message_bg != @current_bg if !$game_message.message_bg.nil? @bg.bitmap = Cache.system($game_message.message_bg) @current_bg = $game_message.message_bg end end @bg.y = self.y + $game_message.message_bg_y case @background when 0; @bg.opacity = openness when 1; @bg.opacity = openness * 0.5 when 2; @bg.opacity = 0 end @back_sprite.visible = false self.opacity = 0 end
end # Window_Message < Window_Base
class Game_Message attr_accessor :message_bg attr_accessor :message_bg_y alias galv_msgbg_message_initialize initialize def initialize galv_msgbg_message_initialize @message_bg = Galv_Msgbg::MESSAGE_IMAGE @message_bg_y = Galv_Msgbg::IMAGE_Y end end # Game_Message
class Game_Interpreter def msgbg(image,y_offset) $game_message.message_bg = image $game_message.message_bg_y = y_offset end end # Game_Interpreter |
|