#============================================================================== # ■ VX-RGSS2-1 キャラ紹介画面 [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ #  ・ステータス画面時に何らかのボタンを押すことで、 #  各キャラの詳細説明画面が表示できます。 # ・ボタンはHELPのInputを見て、確認してください。 # ・標準では、キャラの年齢、出身地、身長、体重、 #  その他の文章説明を対応しています。 # ・これ以外に追加したい場合は、改造してください。 #============================================================================== module Chara_Review #---------------------------------------------------------------------------- # カスタマイズSTART #---------------------------------------------------------------------------- # キャラ紹介に切り替えるボタン(デフォルト:C) CHENGE_KEY = Input::C #-------------------------------------------------------------------------- # ● 年齢(アクターIDの順に入れていってください) #-------------------------------------------------------------------------- CHARA_AGE = { # アクターID => "年齢" 1 => "??", 2 => "??", 3 => "??", 4 => "??", 5 => "??", 6 => "??", 7 => "??", 8 => "??" } #-------------------------------------------------------------------------- # ● 出身地(同上) #-------------------------------------------------------------------------- CHARA_FROM = { # アクターID => "出身地" 1 => "??", 2 => "??", 3 => "??", 4 => "??", 5 => "??", 6 => "??", 7 => "??", 8 => "??" } #-------------------------------------------------------------------------- # ● 身長(同上) #-------------------------------------------------------------------------- CHARA_H = { # アクターID => "身長" 1 => "??", 2 => "??", 3 => "??", 4 => "??", 5 => "??", 6 => "??", 7 => "??", 8 => "??" } #-------------------------------------------------------------------------- # ● 体重(同上) #-------------------------------------------------------------------------- CHARA_W = { # アクターID => "体重" 1 => "??", 2 => "??", 3 => "??", 4 => "??", 5 => "??", 6 => "??", 7 => "??", 8 => "??" } #-------------------------------------------------------------------------- # ● その他文章(\nを入れると改行します) #-------------------------------------------------------------------------- CHARA_INFO = { # アクターID:1 1 => "???", # アクターID:2 2 => "???", # アクターID:3 3 => "???", # アクターID:4 4 => "???", # アクターID:5 5 => "???", # アクターID:6 6 => "???", # アクターID:7 7 => "???", # アクターID:8 8 => "???" } #-------------------------------------------------------------------------- # ● バストアップ画像 #-------------------------------------------------------------------------- # 顔グラフィックではなく、バストアップ画像を使う BSTUP = true # バストアップ画像のファイル名(Graphics/Face) BSTUP_FILE = { # アクターID:1 1 => "Actor1-1", # アクターID:2 2 => "Actor1-4", # アクターID:3 3 => "Actor2-3", # アクターID:4 4 => "Actor2-6" } #---------------------------------------------------------------------------- # カスタマイズEND #---------------------------------------------------------------------------- end #============================================================================== # ■ Window_Charactor #------------------------------------------------------------------------------ #  キャラ紹介画面 #============================================================================== class Window_Charactor < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 544, 416) self.contents = Bitmap.new(width - 32, height - 32) refresh(actor) end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh(actor) self.contents.clear return if actor.nil? if Chara_Review::BSTUP refresh_bstup(actor) # バストアップの描画 else refresh_face(actor) # 顔グラフィックの描画 end end #-------------------------------------------------------------------------- # ● リフレッシュ(BSTUP) #-------------------------------------------------------------------------- def refresh_bstup(actor) draw_face_picture(Chara_Review::BSTUP_FILE[actor.id], 0, 0) self.contents.font.color = system_color self.contents.draw_text(280, 30, 80, WLH, "Name:") self.contents.draw_text(280, 60, 80, WLH, "Age:") self.contents.draw_text(280, 90, 80, WLH, "From:") self.contents.draw_text(280, 120, 80, WLH, "Height:") self.contents.draw_text(280, 150, 80, WLH, "Weight:") self.contents.font.color = normal_color draw_actor_name(actor, 380, 30) self.contents.draw_text(380, 60, 80, WLH, Chara_Review::CHARA_AGE[actor.id]) self.contents.draw_text(380, 90, 180, WLH, Chara_Review::CHARA_FROM[actor.id]) self.contents.draw_text(380, 120 , 200, WLH, Chara_Review::CHARA_H[actor.id]) self.contents.draw_text(380, 150, 250, WLH, Chara_Review::CHARA_W[actor.id]) draw_enter_text(20, 300, 500, WLH, Chara_Review::CHARA_INFO[actor.id]) end #-------------------------------------------------------------------------- # ● リフレッシュ(FACE) #-------------------------------------------------------------------------- def refresh_face(actor) draw_actor_face(actor, 8, 32) self.contents.font.color = system_color self.contents.draw_text(200, 30, 80, WLH, "Name:") self.contents.draw_text(200, 60, 80, WLH, "Age:") self.contents.draw_text(200, 90, 80, WLH, "From:") self.contents.draw_text(200, 120, 80, WLH, "Height:") self.contents.draw_text(200, 150, 80, WLH, "Weight:") self.contents.font.color = normal_color draw_actor_name(actor, 300, 30) self.contents.draw_text(300, 60, 80, WLH, Chara_Review::CHARA_AGE[actor.id]) self.contents.draw_text(300, 90, 180, WLH, Chara_Review::CHARA_FROM[actor.id]) self.contents.draw_text(300, 120 , 200, WLH, Chara_Review::CHARA_H[actor.id]) self.contents.draw_text(300, 150, 250, WLH, Chara_Review::CHARA_W[actor.id]) draw_enter_text(20, 200, 500, WLH, Chara_Review::CHARA_INFO[actor.id]) end end class Window_Base < Window #-------------------------------------------------------------------------- # ● 改行を認識して表示 #-------------------------------------------------------------------------- def draw_enter_text(x, y, width, height, text) info_box = text.split(/\n/) for i in 0...info_box.size self.contents.draw_text( x, y+i*WLH, width, WLH, info_box[i]) break if (y+i*WLH) > (self.height-WLH) end end #-------------------------------------------------------------------------- # ● ピクチャ表示(Graphics/Face) #-------------------------------------------------------------------------- def draw_face_picture(file_name, x, y) bitmap = Cache.face(file_name) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x, y, bitmap, src_rect) end end #============================================================================== # ■ Scene_Charactor #------------------------------------------------------------------------------ #  キャラ紹介画面の処理を行うクラスです。 #============================================================================== class Scene_Charactor < Scene_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor_index : アクターインデックス #-------------------------------------------------------------------------- def initialize(actor_index = 0) @actor_index = actor_index end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @actor = $game_party.members[@actor_index] @status_window = Window_Charactor.new(@actor) end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @status_window.dispose end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene $scene = Scene_Status.new(@actor_index) end #-------------------------------------------------------------------------- # ● 次のアクターの画面に切り替え #-------------------------------------------------------------------------- def next_actor @actor_index += 1 @actor_index %= $game_party.members.size $scene = Scene_Charactor.new(@actor_index) end #-------------------------------------------------------------------------- # ● 前のアクターの画面に切り替え #-------------------------------------------------------------------------- def prev_actor @actor_index += $game_party.members.size - 1 @actor_index %= $game_party.members.size $scene = Scene_Charactor.new(@actor_index) end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update update_menu_background @status_window.update if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::R) Sound.play_cursor next_actor elsif Input.trigger?(Input::L) Sound.play_cursor prev_actor end super end end #============================================================================== # ■ Scene_Status #============================================================================== class Scene_Status #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias update_chara update def update if Input.trigger?(Chara_Review::CHENGE_KEY) Sound.play_decision $scene = Scene_Charactor.new(@actor_index) end update_chara end end