#============================================================================== # 「文末ポーズサイン」(ACE) Ver.1.0 # 製作者:奈々(なな) # へぷたなすくろーる http://heptanas.mamagoto.com/ # # ◇使用規約 # 使用される場合はスクリプト作成者として「奈々」を明記して下さい。 # スクリプトの改変は自由に行って頂いて構いませんが # その場合も元のスクリプトの作成者として名前を載せて下さい。 # また配布前に必ず、ブログにある利用規約を確認して下さい。 # #------------------------------------------------------------------------------ # # デフォルトではウィンドウの下に表示される"キー入力を促すサイン"(▽)を # 文末に表示するようにします。 # # 基本的に入れるだけで動作しますが、初期設定でカーソルの高さを調整できます。 # #============================================================================== #初期設定 module Nana module PSM_S #カーソルの高さ指定("下揃え","中央揃え","上揃え") ALIGN = "中央揃え" end end #============================================================================== # ■ Window_Message #------------------------------------------------------------------------------ #  文章表示に使うメッセージウィンドウです。 #============================================================================== class Window_Message < Window_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :last_text_pos # 最後の文字の位置 #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias initialize_n7psm initialize def initialize initialize_n7psm @last_text_pos = {:x => 0, :y => 0, :new_x => 0, :height => 0} @mod_pause_sing = Sprite.new @mod_pause_sing.bitmap = self.windowskin @mod_pause_sing.src_rect = Rect.new(96, 64, 16, 16) @mod_pause_sing.z = self.z + 50 @mod_pause_sing.visible = false end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- alias dispose_n7psm dispose def dispose dispose_n7psm @mod_pause_sing.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias update_n7psm update def update update_n7psm frame = Graphics.frame_count % Graphics.frame_rate if frame < 15 @mod_pause_sing.src_rect.x = 96 @mod_pause_sing.src_rect.y = 64 elsif frame < 30 @mod_pause_sing.src_rect.x = 112 @mod_pause_sing.src_rect.y = 64 elsif frame < 45 @mod_pause_sing.src_rect.x = 96 @mod_pause_sing.src_rect.y = 80 else @mod_pause_sing.src_rect.x = 112 @mod_pause_sing.src_rect.y = 80 end #ポーズサインの位置調整 @mod_pause_sing.x = self.x + self.standard_padding + @last_text_pos[:x] @mod_pause_sing.y = self.y + self.standard_padding + @last_text_pos[:y] case Nana::PSM_S::ALIGN when "中央揃え" @mod_pause_sing.y += (@last_text_pos[:height] - 16) / 2 when "下揃え" @mod_pause_sing.y += (@last_text_pos[:height] - 16) end end #-------------------------------------------------------------------------- # ● 文字の処理 # c : 文字 # text : 描画処理中の文字列バッファ(必要なら破壊的に変更) # pos : 描画位置 {:x, :y, :new_x, :height} #-------------------------------------------------------------------------- alias process_character_n7psm process_character def process_character(c, text, pos) process_character_n7psm(c, text, pos) @last_text_pos = pos.dup if text != "" end #-------------------------------------------------------------------------- # ● ポーズサインの表示切替 #-------------------------------------------------------------------------- def pause=(value) @mod_pause_sing.visible = value end end