=begin ▼ 選択肢位置揃え ver. 1.0 RPGツクールVXAce用スクリプト 制作 : 木星ペンギン URL : http://woodpenguin.blog.fc2.com/ ------------------------------------------------------------------------------ 概要 □ 選択肢の文字揃えの位置を変更できる機能を追加します。 ------------------------------------------------------------------------------ 使い方 □ 注釈に以下の文字列を入れることで、次に表示する選択肢の文字揃えの位置を  変更します。   選択肢位置揃え(n) n : 揃えの位置(0:左揃え, 1:中央揃え, 2:右揃え) =end #////////////////////////////////////////////////////////////////////////////// # # 以降、変更する必要なし # #////////////////////////////////////////////////////////////////////////////// module WdTk @material ||= [] @material << :ChoiceAlign def self.include?(sym) @material.include?(sym) end end #============================================================================== # ■ Game_Message #============================================================================== class Game_Message #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :choice_align # 選択肢の文字揃えの位置 #-------------------------------------------------------------------------- # ○ クリア #-------------------------------------------------------------------------- alias _wdtk_choice_align_clear clear def clear _wdtk_choice_align_clear @choice_align = 0 end end #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ◯ 注釈 #-------------------------------------------------------------------------- alias _wdtk_choice_align_command_108 command_108 def command_108 _wdtk_choice_align_command_108 @comments.each do |comment| case comment when /選択肢位置揃え\((\d+)\)/ $game_message.choice_align = $1.to_i end end end end #============================================================================== # ■ Window_ChoiceList #============================================================================== class Window_ChoiceList #-------------------------------------------------------------------------- # ● 制御文字つきテキストの描画 #-------------------------------------------------------------------------- alias _wdtk_choice_align_draw_text_ex draw_text_ex def draw_text_ex(x, y, text) case $game_message.choice_align when 1 x += ((item_width - 8) - text_size(text).width) / 2 when 2 x += (item_width - 8) - text_size(text).width end _wdtk_choice_align_draw_text_ex(x, y, text) end end