#============================================================================== # ★バックグラウンドピクチャー設定 ver1.01 by USK #------------------------------------------------------------------------------ #・メニュー画面やショップ画面等でバックグラウンドとしてピクチャーを表示します。 #・64行目までで各場面に応じた設定が行えます。 #============================================================================== #============================================================================== # ■ BackgroundManager #============================================================================== module BackgroundManager BackGroundPicture = { Scene_Menu => #メニュー画面 { #↓背景に使用するピクチャーのパス。使用しない場合は "" :picture => "Graphics/Titles1/Universe.png", #↓ウィンドウを表示する場合はtrue、しない場合false :window => true }, Scene_Item => #アイテム画面 { :picture => "Graphics/Parallaxes/BlueSky.png", :window => false }, Scene_Skill => #スキル画面 { :picture => "", :window => true }, Scene_Equip => #装備画面 { :picture => "", :window => true }, Scene_Status => #ステータス画面 { :picture => "", :window => true }, Scene_Save => #セーブ画面 { :picture => "", :window => true }, Scene_Load => #ロード画面 { :picture => "", :window => true }, Scene_End => #終了画面 { :picture => "", :window => true }, Scene_Shop => #ショップ画面 { :picture => "", :window => true }, Scene_Name => #名前入力画面 { :picture => "", :window => true }, } #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def self.non_picture?(_class) return true unless BackGroundPicture.include?(_class) BackGroundPicture[_class][:picture].empty? end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def self.non_window?(_class) return false unless BackGroundPicture.include?(_class) !BackGroundPicture[_class][:window] end #-------------------------------------------------------------------------- # ● #-------------------------------------------------------------------------- def self.picture(_class) Bitmap.new(BackGroundPicture[_class][:picture]) end end #============================================================================== # ■ Scene_MenuBase #============================================================================== class Scene_MenuBase #-------------------------------------------------------------------------- # ● 背景の作成 #-------------------------------------------------------------------------- alias usk_bkgd_create_background create_background def create_background if BackgroundManager.non_picture?(self.class) usk_bkgd_create_background else @background_sprite = Plane.new @background_sprite.bitmap = BackgroundManager.picture(self.class) end end #-------------------------------------------------------------------------- # ● 開始後処理 #-------------------------------------------------------------------------- alias usk_bkgd_post_start post_start def post_start instance_variables.each do |varname| ivar = instance_variable_get(varname) ivar.opacity = 0 if ivar.is_a?(Window) end if BackgroundManager.non_window?(self.class) usk_bkgd_post_start end end #============================================================================== # ■ Window_MenuActor #============================================================================== class Window_MenuActor < Window_MenuStatus #-------------------------------------------------------------------------- # ● ウィンドウ幅の取得 #-------------------------------------------------------------------------- alias usk_bkgd_window_width window_width def window_width if BackgroundManager.non_window?(SceneManager.scene.class) Graphics.width else usk_bkgd_window_width end end end