查看: 3636|回复: 4

[已经过期] RMVA事件和主角等头上显示名字

[复制链接]
梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
回帖
265
发表于 2014-7-16 20:38:27 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
如图 在事件头上显示名字 还有 主角以及队员显示名字

…あたしは天

梦石
0
星屑
2311
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2014-7-16 20:50:34 | 显示全部楼层
本帖最后由 taroxd 于 2014-7-16 20:58 编辑

http://tamurarpgvx.blog137.fc2.com/blog-entry-117.html

@Scene

  1. =begin
  2. 吹きだしウィンドウVXAce

  3. 2011.12.25 tamura改造
  4. 2012年08月26日 改訂

  5. ※このスクリプトは、ちいさな本屋様([url]http://xrxs.at-ninja.jp/[/url])
  6. が製作されたものをtamuraがACE用に改造した物です。

  7. 原版:
  8. ▽▽▽ XRXSv2. メッセージ表示フルグレードアップVX ▽▽▽
  9. publish 2010/ 3/ 2
  10. update  - 11/ 1/10a


  11. ※※警告※※
  12. THINK_TAIL や SYSTEM_LINE の機能を使わない場合は、
  13. これらに使用していないスイッチを割り当てておいてください。


  14. 「立ち絵機能」をONにしている時に、立ち絵を表示せずに、ウィンドウ位置を
  15. 右か左に変更した時、テールのY座標がずれるようです。
  16. 原因は調査中です。立ち絵を表示しない時は、イベントコマンド「注釈」で、
  17. 「立ち絵表示 off」と記述して立ち絵機能をOFFにしておいてください。

  18. ●機能一覧
  19. ・イベントコマンド「スクリプト」で、$win_x $win_yに値を入力すると、
  20.  ($win_x 、$win_y)の位置にウィンドウを表示する。画面左上が(0,0)。

  21. ・キーボードのQ(装備画面で前のキャラに戻るボタン)を押すと、
  22.  ウィンドウが消える。Qか決定、キャンセルキーで元に戻る。

  23. ・イベントコマンド「スクリプト」で、
  24. $name_right = true
  25. と入力すれば、ネームウィンドウがウィンドウの右に移ります。
  26. 元に戻すには、イベントコマンド「スクリプト」で
  27. $name_right = false
  28. と入力すれば、左側に戻ります。


  29. ・イベントコマンド「スクリプト」で、
  30. $system_line = true
  31. と入力すれば、最初の一行目を表示しません。
  32. $system_line = false
  33. で元に戻ります。


  34. ・文章のどこでもいいので、以下の表記を行う。
  35. ・ \name[] : []の中の文字を、ウィンドウ左上に小さく表示する。
  36.  表示させる名前には、制御文字 \V、\P、\N、\G が使用可能。

  37. \h[-1] : プレーヤーの上にウィンドウをポップ。
  38. \h[0] : 現在アクティブのイベントの上にウィンドウをポップ。
  39. \h[1] : IDが1番のイベントの上にウィンドウをポップする。
  40. hは大文字でもOK。

  41. ポップアップを行うとき、
  42. 「メッセージの表示」の設定で、ウィンドウの「表示位置」によって、
  43. ウィンドウがイベントの上に出るか下に出るかを設定できます。

  44. ウィンドウは通常の大きさのまま、テールだけ表示したい場合は、
  45. \t[-2] : ウィンドウが上下に表示される時は、X座標をMINAS_TWE_X_POSで固定。
  46.            $win_x で左右に表示される時は、Y座標がウィンドウの中心やや下で固定。
  47. \t[-3] : ウィンドウが上下に表示される時は、X座標をMINAS_THREE_X_POSで固定。
  48.            $win_x で左右に表示される時は、Y座標がウィンドウの中心やや下で固定。
  49. \t[-1] : プレーヤーの上に向かってテール表示。
  50. \t[0] : 現在アクティブのイベントに向かってテール表示。
  51. \t[1] : IDが1番のイベントの上に向かってテール表示。

  52. その他
  53. \O[128] : 文字を透明にする。128はalphaの値で、0で透明、255で通常。
  54. \D : 文字に影をつける
  55. \hold : メッセージ表示の、最後の文章に限定。
  56.      メッセージが終わっても、ウィンドウを閉じずに残します。
  57.      他のメッセージが表示されて次へ送られる時に消えます。
  58.      なお、ホールドされているウィンドウは、Qボタンで消せません。



  59. ●その他
  60. ・ACEに標準装備されている機能は通常通り使用できます。
  61. ・A1殿([url]http://a1tktk.web.fc2.com/[/url])の立ち絵スクリプトに対応しています。
  62.  このスクリプトの上に「RGSS3用A1共通処理」
  63.  このスクリプトの下に「空メッセージでウィンドウを開かない」「立ち絵表示」を
  64.  配置して下さい。
  65.  残念ながら、「ネームウィンドウ」は使えません。上記\nameをお使いください。
  66. ※立ち絵を表示しない時は、注釈で「立ち絵表示 off」とした方が無難です。
  67. ・イベントの下から話しかけたら上へポップ、上から話しかけたら下へポップするという
  68.  機能を追加。カスタマイズポイントで POP_DIRECTION = ture と変更のこと。


  69. ●廃止機能 
  70. ・\Iがすでに使われているので、イタリック文字変換を廃止。
  71. ・スピード変更、改行、最後に入手したアイテムの表示を、ACE化にともない廃止。


  72. 【改訂履歴】
  73. 2012.01.10  ・ウィンドウを消したまま次のウィンドウを自動で表示すると、
  74.               ネームウィンドウが表示されるのを修正。
  75. 2012.01.11  ・ネームウィンドウが出しっぱなしになるのを修正。
  76. 2012.01.12  ・メニューを出してから決定ボタンを押すとネームウィンドウがでる不具合の修正。
  77. 2012.02.01 ・ネームウィンドウのオープン&クローズのタイミングを変更。
  78.       ・hold機能を追加。
  79. 2012.02.10 ・キャラポップした時、一行ずつしか表示されない不具合を修正。
  80. 2012.02.14 ・アイテム名などの文字数が正常に取得できなかったのを修正。
  81. 2012.02.21 ・話しかけられた方向によって、ポップ方向を変えられるようにした。
  82. 2012.02.25 ・すべてのシーン遷移の際はテールを破棄(イベント中でショップ起動など)
  83. 2012.02.28 ・エスケープ文字の処理が上手くいかない問題について暫定対策。
  84. 2012.03.05 ・微妙にウィンドウ幅が足りない時があったので、僅かにウィンドウ幅追加。
  85. 2012.03.14 ・ポップアップ時の顔グラ表示に対応。
  86. 2012.04.20 ・吹きだしが大型になると選択肢が入りきらない不具合の修正。
  87.             ・ネームウィンドウが残ったままシーン遷移があると、ネームウィンドウが
  88.              閉じない不具合の修正。
  89. 2012.05.02  ・名前には、制御文字 \V、\P、\N、\G が使用可能。
  90.             ・\V については、2段階の入れ子が使用可能。
  91.             ・ウィンドウ消去機能を、「背景を暗くする」に対応。
  92. 2012.05.09 ・通常の上表示のとき、ネームウィンドウが見切れるので少し下にずらす。
  93. 2012.05.12 ・ネームウィンドウの幅と高さを変更可能にした。
  94.             ・ネームウィンドウの高さを変えると、どんどん下に伸びるのを修正。
  95. 2012.07.15 ・イベントコマンドで、$name_right = true と入力すると、
  96.        名前ウィンドウが右に移ります。
  97. 2012.08.26 ・思案型テールへの変更機能追加。
  98.             ・文章の1行目を表示しない機能は、スイッチを使えるようにした。
  99.              (セーブ&ロードに対応していないため)
  100.              なお、従来の$system_line も使用可能。

  101. =end

  102. #==============================================================================
  103. # カスタマイズポイント
  104. #==============================================================================
  105. #=begin
  106. class Window_Message < Window_Base
  107.   #
  108.   # 基本行数
  109.   #
  110.   MAX_LINE = 4
  111.   #
  112.   # \p[] - キャラポップの高さ
  113.   #
  114.   CHARPOP_HEIGHT = 40
  115.   #
  116.   #
  117.   #\name[]で表示されるウィンドウのX座標、Y座標、幅、高さ の変更値。
  118.   #座標は、メッセージウィンドウの左上端が原点。名前はウィンドウ中央に表示。
  119.   NAME_WINDOW_OFFSET_X =   0
  120.   NAME_WINDOW_OFFSET_Y = -24
  121.   NAME_WINDOW_OFFSET_WIDTH = 0
  122.   NAME_WINDOW_OFFSET_HIGHT = 5
  123.   
  124.   #
  125.   #
  126.   MINAS_TWE_X_POS = 100 # $t[-2]のときの、テールのX座標。
  127.   MINAS_THREE_X_POS = 444 # $t[-3]のときの、テールのX座標。
  128.   
  129.   POP_DIRECTION = false #イベントの方向を考慮。
  130.   
  131.   THINK_TAIL = 101 #この番号のゲームスイッチがONの時、思案型テールになります。
  132.   SYSTEM_LINE = 102 #この番号のゲームスイッチがONの時、最初の1行を表示しません。
  133.   
  134. end

  135. #(メモ)上表示で、ネームウィンドウのために少し下にずらす機能は、
  136. #再定義したupdate_placement_positionのところ。

  137. #==============================================================================
  138. # 参照機能
  139. #==============================================================================
  140. class Game_Temp
  141.   attr_accessor :last_gain_material
  142.   attr_accessor :last_gain_holder
  143. end

  144. class Window_Message < Window_Base
  145.   #--------------------------------------------------------------------------
  146.   # ● 改ページ処理
  147.   #--------------------------------------------------------------------------
  148.   def new_page(text, pos)
  149.     contents.clear
  150.     draw_face($game_message.face_name, $game_message.face_index, 0, 0)
  151.     reset_font_settings
  152.     pos[:x] = new_line_x
  153.    
  154.     #変更部分。システム用の一行目を表示しない。
  155.     if $system_line == false and $game_switches[SYSTEM_LINE] == false
  156.       pos[:y] = 0
  157.     else
  158.       pos[:y] = 0 - line_height
  159.     end

  160.     pos[:new_x] = new_line_x
  161.     pos[:height] = calc_line_height(text)
  162.     clear_flags
  163.   end
  164. end

  165. #==============================================================================
  166. # フルグレードアップベース - 制御文字・基本機能
  167. #==============================================================================
  168. class Window_Message < Window_Base
  169.   attr_accessor :tail
  170.   #--------------------------------------------------------------------------
  171.   # ● 特殊文字の変換 + 準備
  172.   #     変換・消去してもいい部分を処理、フラグのセット。
  173.   #--------------------------------------------------------------------------
  174.   alias xrxsv2_convert_escape_characters convert_escape_characters
  175.   def convert_escape_characters(text)
  176.     #@textsが使いずらいので、ここで別変数に保管。
  177.     @all_texts = []
  178.     str = text.gsub(/\\/) { "\e" }
  179.     @all_texts = str.split("\n")
  180.    
  181.     #この段階で、変数・アクター名を変換してしまう。
  182.     #ネームウィンドウ内の文字を変換するため。
  183.     text = convert_escape_characters_easy(text)
  184.    
  185.     # 初期化
  186.     contents.font.size   = Font.default_size
  187.     contents.font.bold   = Font.default_italic
  188.     contents.font.italic = Font.default_bold
  189.     contents.font.shadow = Font.default_shadow
  190.     @type_wait = 0
  191.     @line_widths = []
  192.     @line_aligns = []
  193.     self.pop_character = nil
  194.     # ウィンドウ保持指定\holdがあるか?
  195.     @window_hold = (text.gsub!(/\\hold/) { "" } != nil)
  196.     # \info
  197.     @info_mode = (text.gsub!(/\\info/) { "" } != nil)
  198.     # 改行削除指定\_があるか?
  199.     if (/\\_(.*?)\x00/.match(@text)) != nil
  200.       $game_message.choice_start -= 1
  201.       text.gsub!(/\\_(.*?)\x00/) { $1.to_s }
  202.     end
  203.     # \name 判定
  204.     if text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  205.       name = $1
  206.       bitmap = @name_sprite.bitmap
  207.       w = [bitmap.text_size(name).width, 1].max + NAME_WINDOW_OFFSET_WIDTH
  208.       bitmap.dispose
  209.       @name_sprite.bitmap = Bitmap.new(w, 32)
  210.       bitmap = @name_sprite.bitmap
  211.       bitmap.draw_text(0, 0, bitmap.width, bitmap.height, name)
  212.       @name_window.width = w + 16
  213.       @name_window.height = bitmap.height + NAME_WINDOW_OFFSET_HIGHT
  214.       @name_window.create_contents
  215.       @name_window.open if @name_window.openness == 0
  216.       if self.visible #名前だけ表示されるのを防止。
  217.         @name_window.visible = true
  218.         @name_sprite.visible = true
  219.       else
  220.         @name_window.visible = false
  221.         @name_sprite.visible = false
  222.       end
  223.     else
  224.       @name_window.visible = false
  225.       @name_sprite.visible = false
  226.       @name_sprite.bitmap.dispose
  227.       @name_sprite.bitmap = Bitmap.new(32,32)
  228.     end
  229.     $name = $1 #あれこれで使うので、ネームウィンドウに表示予定の名前を取得。
  230.     # キャラボップモード
  231.     if text.gsub!(/\\[Hh]\[-1\]/) { "" }
  232.       self.pop_character = -1
  233.     elsif text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "" }
  234.       self.pop_character = $1.to_i
  235.     elsif text.gsub!(/\\[Hh]/) { "" }
  236.       self.pop_character = 0
  237.     #テール表示モード
  238.     elsif text.gsub!(/\\[Tt]\[-1\]/) { "" }
  239.       self.tail_character = -1
  240.     elsif text.gsub!(/\\[Tt]\[-2\]/) { "" }
  241.       self.tail_character = -2
  242.     elsif text.gsub!(/\\[Tt]\[-3\]/) { "" }
  243.       self.tail_character = -3
  244.     elsif text.gsub!(/\\[Tt]\[([0-9]+)\]/) { "" }
  245.       self.tail_character = $1.to_i
  246.     elsif text.gsub!(/\\[Tt]/) { "" }
  247.       self.tail_character = 0
  248.     else
  249.       self.pop_character = nil
  250.     end
  251.    
  252.     # 制御文字処理
  253.     text = xrxsv2_convert_escape_characters(text)
  254.     text.gsub!(/\\[Ss]\[([0-9]+)\]/i) { "\eS[#{$1}]" }
  255.     text.gsub!(/\\[Oo]\[([0-9]+)\]/i) { "\eO[#{$1}]" }
  256.     text.gsub!(/\\last_holder/i) { "\e18" }
  257.     text.gsub!(/\\last_material/i) { "\e19" }
  258.     text.gsub!(/\\B/) { "\eB" }
  259.     text.gsub!(/\\D/) { "\eD" }
  260.     #text.gsub!(/\\n/) { "\n" }
  261.     #
  262.     # ライン情報の取得
  263.     rxs = ["\x01","\x02","\x03","\x04","\x05","\x06","\x07","\x08",
  264.       /\[([0-9]+)\]/,
  265.       "\x11","\x12","\x13","\x14", "\x15", "\x16", "\x17", "\x18","\x19"]
  266.     lines = text.split("\x00")
  267.     @lines_max = lines.size
  268.     for i in 0...@lines_max
  269.       line = lines[i]
  270.       for rx in rxs
  271.         line.gsub!(rx) {""}
  272.       end
  273.       @line_aligns[i] =
  274.         line.sub!(/\\center/) {""} ? CENTER :
  275.         line.sub!(/\\right/)  {""} ? RIGHT :
  276.                                      AUTO
  277.       # 行の横幅の取得と設定
  278.       cx = text_width_no_escape(line,text) #test
  279.       #cx = contents.text_size(line,text).width
  280.       @line_widths[i] = cx
  281.     end
  282.     # 位置揃え制御文字の削除
  283.     text.gsub!(/\\center/) {""}
  284.     text.gsub!(/\\right/) {""}
  285.     # キャラポップ時のウィンドウリサイズ
  286.     reszie_window_for_pop
  287.    
  288.     del_tail # if @tail != nil
  289.     # $mes_id が空のときと戦闘中はふきだしを表示しない
  290.     if defined?($game_system.show_stand_picture) #立ち絵に対応。
  291.       $mes_id = -1 if $game_system.show_stand_picture == true
  292.     end
  293.     if $mes_id != nil and not $game_party.in_battle
  294.       # ふきだしのテールを描画
  295.       skin = "Window"
  296.       if @background == 0
  297.         #画像の準備
  298.         @tail = Sprite.new
  299.         @tail.visible = false
  300.         # 位置を取得
  301.         tale_pos = get_tale_pos
  302.         if $win_x != nil
  303.           if $win_x > 0
  304.             @tail.bitmap = Cache.system(skin + "-right")
  305.             @tail.x = tale_pos[0]
  306.             @tail.y = tale_pos[1]
  307.             @tail.z = self.z + 1
  308.           elsif  $win_x < 0
  309.             @tail.bitmap = Cache.system(skin + "-left")
  310.             @tail.x = tale_pos[0]
  311.             @tail.y = tale_pos[1]
  312.             @tail.z = self.z + 1
  313.           else
  314.             create_tail_up_under
  315.           end
  316.         else
  317.           create_tail_up_under
  318.         end
  319.         # エクストラスプライトに登録
  320.         @extra_sprites = [] if @extra_sprites.nil?
  321.         @extra_sprites.push(@tail) if @tail != nil
  322.         # 更新
  323.         update_tail
  324.       end
  325.     end

  326.     open_and_wait #リサイズが終わった時点でウィンドウオープン。
  327.    
  328.     return text
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ● 制御文字の変換。
  332.   #    変数・パーティ名・アクター名・所持金のみ変換する。
  333.   #    文字「\」はエスケープ文字(\e)に変換。
  334.   #--------------------------------------------------------------------------
  335.   def convert_escape_characters_easy(text)
  336.     result = text.to_s.clone
  337.     result.gsub!(/\\[vV]\[/)          { "\eV\[" }
  338.     result.gsub!(/\\[nN]\[/)          { "\eN\[" }
  339.     result.gsub!(/\\[pP]\[/)          { "\eP\[" }
  340.     result.gsub!(/\\[gG]/)          { "\eG" }
  341.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  342.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  343.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  344.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  345.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  346.     result
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● 文字の長さを取得する。エスケープ文字は含まない。
  350.   # line : 表示しようとしている全ての文字列。
  351.   # text : その列の文字。
  352.   #--------------------------------------------------------------------------
  353.   def text_width_no_escape(line , text_o)
  354.     add = 5 #微妙に足りないので水増し。
  355.     text = Marshal.load(Marshal.dump(text_o))
  356.     text.gsub!(/\ehold/) { "" }
  357.     text.gsub!(/\einfo/) { "" }
  358.     # 改行削除指定\_があるか?
  359.     if (/\\_(.*?)\x00/.match(@text)) != nil
  360.       $game_message.choice_start -= 1
  361.       text.gsub!(/\\_(.*?)\x00/) { "" }
  362.     end
  363.     # \name 判定
  364.     text.sub!(/\e[Nn]ame\[(.*?)\]/) { "" }
  365.     text.gsub!(/\e[Hh]\[-1\]/) { "" }
  366.     text.gsub!(/\e[Hh]\[([0-9]+)\]/) { "" }
  367.     text.gsub!(/\e[Hh]/) { "" }
  368.     text.gsub!(/\e[Tt]\[-1\]/) { "" }
  369.     text.gsub!(/\e[Tt]\[-2\]/) { "" }
  370.     text.gsub!(/\e[Tt]\[-3\]/) { "" }
  371.     text.gsub!(/\e[Tt]\[([0-9]+)\]/) { "" }
  372.     text.gsub!(/\e[Tt]/) { "" }
  373.     # 制御文字処理
  374.     text.gsub!(/\e[Ss]\[([0-9]+)\]/i) { "" }
  375.     text.gsub!(/\e[Oo]\[([0-9]+)\]/i) { "" }
  376.     text.gsub!(/\elast_holder/i) { "" }
  377.     text.gsub!(/\elast_material/i) { "" }
  378.     #text.gsub!(/\eV/) { "" } #変数に置き換える。
  379.     #text.gsub!(/\eN/) { "" } #名前へ置き換える。
  380.     #text.gsub!(/\eP/) { "" } #名前へ置き換える。
  381.     #text.gsub!(/\eG/) { "" } #金額へ置き換える。
  382.     #text.gsub!(/\eC/) { "" }
  383.     text.gsub!(/\eB/) { "" }
  384.     text.gsub!(/\eD/) { "" }
  385.     if text =~ /\eI/
  386.       loop do
  387.         if str = text.sub!(/\eI\[(\d+)\]/){ "" }
  388.           add += 24
  389.         else
  390.           break
  391.         end
  392.       end
  393.     end
  394.     #text.gsub!(/\\n/) { "\n" }
  395.     text.sub!(/\ecenter/) {""}
  396.     text.sub!(/\eright/)  {""}
  397.     text.gsub!(/\ecenter/) {""}
  398.     text.gsub!(/\eright/) {""}
  399.    
  400.     text = xrxsv2_convert_escape_characters(text)
  401.     basic_width = text_size(text).width + add
  402.     esc = text.scan(/\e(\S)/)
  403.     return ( basic_width - esc.size * (contents.font.size - 4) ) #\eの幅は20?
  404.   end
  405.   #--------------------------------------------------------------------------
  406.   # ● 最も長い列の長さを調べる。エスケープ文字は含まない。
  407.   #--------------------------------------------------------------------------
  408.   def max_width
  409.     text_size = []
  410.     for i in 0 ... @all_texts.size
  411.       text_size.push text_width_no_escape(@all_texts[i],@all_texts[i]) + 20
  412.     end
  413.     return text_size.max
  414.   end
  415.   #--------------------------------------------------------------------------
  416.   # ● 吹きだしテールが上か下の場合の画像を準備。
  417.   #--------------------------------------------------------------------------
  418.   def create_tail_up_under
  419.     skin = "Window"
  420.     tale_pos = get_tale_pos
  421.     case @position
  422.     when 0  # 上
  423.       @tail.bitmap = Cache.system(skin + "-top")
  424.       @tail.x = tale_pos[0]
  425.       @tail.y = tale_pos[1]
  426.       @tail.z = self.z + 1
  427.     when 1  # 中
  428.       @tail.dispose
  429.       @tail = nil
  430.     when 2  # 下
  431.       @tail.bitmap = Cache.system(skin + "-under")
  432.       @tail.x = tale_pos[0]
  433.       @tail.y = tale_pos[1]
  434.       @tail.z = self.z + 1
  435.     end
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● 全テキストの処理
  439.   #--------------------------------------------------------------------------
  440.   def process_all_text
  441.     #open_and_wait #リサイズがあるので、すぐにウィンドウをオープンしない。
  442.     text = convert_escape_characters($game_message.all_text)
  443.     pos = {}
  444.     new_page(text, pos)
  445.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ● メッセージの更新 *
  449.   #--------------------------------------------------------------------------
  450.   def update_message
  451.     @wait_count = @type_wait
  452.     loop do
  453.       c = @text.slice!(/./m)
  454.       case update_message_type(c)
  455.       when 1
  456.         break
  457.       when 2
  458.         next
  459.       end
  460.       break unless @show_fast or @line_show_fast
  461.     end
  462.   end
  463.   #--------------------------------------------------------------------------
  464.   # 一文字の描画 (返り値 1:break, 2:next)
  465.   #--------------------------------------------------------------------------
  466. #=begin
  467.   def process_escape_character(code, text, pos)
  468.     case code.upcase
  469.     when '$'
  470.       @gold_window.open
  471.     when '.'
  472.       wait(15)
  473.     when '|'
  474.       wait(60)
  475.     when '!'
  476.       input_pause
  477.     when '>'
  478.       @line_show_fast = true
  479.     when '<'
  480.       @line_show_fast = false
  481.     when '^'
  482.       @pause_skip = true
  483.     #when 'n'                      # 改行
  484.     #  new_line
  485.     #  max = MAX_LINE
  486.     #  max = 14 if self.pop_character != nil
  487.     #  if @line_count >= max      # 行数が最大のとき
  488.     #    unless @text.empty?           # さらに続きがあるなら
  489.     #      self.pause = true           # 入力待ちを入れる
  490.           #return 1
  491.     #    end
  492.     #  end
  493.     #when 'S'                       # \S[n]  (スピード変更)
  494.     #  text.sub!(/\[([0-9]+)\]/, "")
  495.     #  @type_wait = $1.to_i
  496.     #  return 2
  497.     when 'O'                       # \O 文字を透明にする。
  498.       text.sub!(/\[([0-9]+)\]/, "")
  499.       contents.font.color.alpha = $1.to_i
  500.       #return 2
  501.     when 'D' #\D 文字に影をつける
  502.       contents.font.shadow ^= true
  503.     #when '18'
  504.     #  name = ($game_temp.last_gain_holder.name rescue "")
  505.     #  update_message_type_draw_at(name)
  506.     #when '19'
  507.     #  item = ($game_temp.last_gain_material.item rescue nil)
  508.     #  draw_item_name(item, @contents_x, @contents_y)
  509.     #  @contents_x += 196
  510.     else
  511.       super
  512.     end
  513.         
  514.   end
  515. #=end
  516.   #--------------------------------------------------------------------------
  517.   # ● 改ページ処理
  518.   #--------------------------------------------------------------------------
  519.   alias xrxsv2_new_page new_page
  520.   def new_page(text, pos)
  521.     xrxsv2_new_page(text, pos)
  522.     update_charpop_window
  523.   end
  524.   #--------------------------------------------------------------------------
  525.   # ● 改行位置の取得
  526.   #--------------------------------------------------------------------------
  527.   #def new_line_x
  528.   #  $game_message.face_name.empty? ? 0 : 112
  529.   #end
  530.   #--------------------------------------------------------------------------
  531.   # ● 改行処理
  532.   #--------------------------------------------------------------------------
  533.   alias xrxsv2_new_line_x new_line_x
  534.   def new_line
  535.     xrxsv2_new_line
  536.     set_align
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # 位置揃え
  540.   #--------------------------------------------------------------------------
  541.   def set_align
  542.     w = @line_widths[@line_count].to_i
  543.     a = @line_aligns[@line_count]
  544.     case a
  545.     when CENTER
  546.       @contents_x = @contents_x + ((contents.width - @contents_x) - w) / 2
  547.     when RIGHT
  548.       @contents_x = contents.width - w
  549.     end
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # ● ファイバーのメイン処理 ☆再定義
  553.   #--------------------------------------------------------------------------
  554.   def fiber_main
  555.     $game_message.visible = true
  556.     update_background
  557.     update_placement
  558.     loop do
  559.       process_all_text if $game_message.has_text?
  560.       process_input
  561.       $game_message.clear
  562.       @gold_window.close
  563.       process_hold #ホールドウィンドウの処理。
  564.       Fiber.yield
  565.       break unless text_continue?
  566.     end
  567.     close_and_wait
  568.     $game_message.visible = false
  569.     @fiber = nil
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # 定数
  573.   #--------------------------------------------------------------------------
  574.   AUTO   = 0
  575.   LEFT   = 1
  576.   CENTER = 2
  577.   RIGHT  = 3
  578. end
  579. #==============================================================================
  580. # アクティブイベント取得
  581. #==============================================================================
  582. class Game_Interpreter
  583.   attr_reader   :event_id
  584. end


  585. #==============================================================================
  586. # 各種機能の追加 - キャラポップ/ネーム/ホールド
  587. #==============================================================================
  588. class Window_Message < Window_Base
  589.   #--------------------------------------------------------------------------
  590.   # ● カーソルの更新 *
  591.   #--------------------------------------------------------------------------
  592.   def update_cursor
  593.     if @index >= 0
  594.       x = ($game_message.face_name.empty? ? 0 : 112)
  595.       y = ($game_message.choice_start + @index) * WLH - 1
  596.       w = contents.width - x
  597.       if self.pop_character != nil
  598.         x += 28
  599.         w -= 20
  600.       end
  601.       self.cursor_rect.set(x, y, w, WLH)
  602.     else
  603.       self.cursor_rect.empty
  604.     end
  605.   end
  606.   #--------------------------------------------------------------------------
  607.   # キャラクターの取得
  608.   #   parameter : パラメータ
  609.   #--------------------------------------------------------------------------
  610.   def get_character(parameter)
  611.     # パラメータで分岐
  612.     case parameter
  613.     when -1  # プレイヤー
  614.       return $game_player
  615.     when 0  # 現在アクティブなイベント
  616.       id = $game_map.interpreter.event_id
  617.       events = $game_map.events
  618.       return events == nil ? nil : events[id]
  619.     else  # 特定のイベント
  620.       events = $game_map.events
  621.       return events == nil ? nil : events[parameter]
  622.     end
  623.   end
  624.   #--------------------------------------------------------------------------
  625.   # (メッセージ終了時)ホールドの処理
  626.   #--------------------------------------------------------------------------
  627.   def process_hold
  628.     if @window_hold
  629.       @held_windows.push(Window_Copy.new(self))
  630.       @held_windows.push(Window_Copy.new(@name_window))
  631.       @held_windows.push(Sprite_Copy.new(@name_sprite))
  632.       @held_windows.push(Sprite_Copy.new(@back_sprite))
  633.       for sprite in @extra_sprites
  634.         next if sprite.disposed?
  635.         @held_windows.push(Sprite_Copy.new(sprite))
  636.       end
  637.       @extra_sprites.clear
  638.       self.openness = 0
  639.       #@name_window.openness = 0
  640.       @back_sprite.visible = false
  641.     else
  642.       @held_windows.each {|object| object.dispose}
  643.       @held_windows.clear
  644.     end
  645.     #@name_window.close
  646.     #@name_sprite.visible = false
  647.   end
  648.   #--------------------------------------------------------------------------
  649.   # キャラポップ位置の設定と取得
  650.   #--------------------------------------------------------------------------
  651.   def pop_character=(character_id)
  652.     @pop_character = character_id
  653.   end
  654.   def pop_character
  655.     return @pop_character
  656.   end
  657.   #--------------------------------------------------------------------------
  658.   # キャラポップ時のウィンドウリサイズ
  659.   #--------------------------------------------------------------------------
  660.   def reszie_window_for_pop
  661.     #キャラポップ
  662.     if self.pop_character != nil
  663.       #max_x = @line_widths.max.to_i
  664.       #n  = max_x + 32
  665.       n = 0
  666.       n += $game_message.face_name.empty? ? 0 : 122
  667.       m  = $game_message.face_name.empty? ? 0 : 96
  668.       w  = @name_sprite.bitmap.width
  669.       self.width  = max_width + n
  670.       self.height = [@all_texts.size * line_height, m].max + 32
  671.       
  672.       #システム用の一行目を表示しない。
  673.       if $system_line or $game_switches[SYSTEM_LINE]
  674.         self.height -= line_height
  675.       end
  676.       
  677.       create_contents
  678.       update_charpop_window
  679.     elsif @info_mode
  680.       @line_aligns[0] = CENTER
  681.       self.x = - 8
  682.       self.width = Graphics.width + 16
  683.       self.height = 56
  684.       create_contents
  685.     else
  686.       self.x = 0
  687.       self.width  = Graphics.width
  688.       self.height = MAX_LINE * line_height + 32
  689.       update_placement #位置情報修正。
  690.       create_contents
  691.     end
  692.   end
  693.   #--------------------------------------------------------------------------
  694.   # ● 背景スプライトの作成
  695.   #--------------------------------------------------------------------------
  696.   alias xrxsv2_create_back_sprite create_back_sprite
  697.   def create_back_sprite
  698.     xrxsv2_create_back_sprite
  699.     @back_sprite.zoom_x = 1.0 * Graphics.width / @back_sprite.bitmap.width
  700.     @name_window = Window_Base.new(0,0,112,36)
  701.     @name_window.visible = false
  702.     @name_sprite = Sprite.new
  703.     @name_sprite.bitmap = Bitmap.new(32,32)
  704.     @name_sprite.visible = false
  705.     self.x = self.x
  706.     self.y = self.y
  707.     self.z = self.z
  708.     @held_windows = []
  709.     @extra_sprites = []
  710.   end
  711.   #--------------------------------------------------------------------------
  712.   # ● 背景スプライトの解放
  713.   #--------------------------------------------------------------------------
  714.   alias xrxsv2_dispose_back_sprite dispose_back_sprite
  715.   def dispose_back_sprite
  716.     xrxsv2_dispose_back_sprite
  717.     @name_window.dispose if @name_window != nil #メニュー画面を出そうとするとエラー?
  718.     @name_sprite.dispose if @name_sprite != nil
  719.     for window in @held_windows
  720.       window.dispose
  721.     end
  722.   end
  723.   #--------------------------------------------------------------------------
  724.   # ● 背景スプライトの更新
  725.   #--------------------------------------------------------------------------
  726.   alias xrxsv2_update_back_sprite update_back_sprite
  727.   def update_back_sprite
  728.     @name_window.update
  729.     xrxsv2_update_back_sprite
  730.     update_charpop_window
  731.   end
  732.   #--------------------------------------------------------------------------
  733.   # ウィンドウの位置と不透明度の設定 (キャラポップ)
  734.   #--------------------------------------------------------------------------
  735.   def update_charpop_window
  736.     if self.pop_character
  737.       character = get_character(self.pop_character)
  738.       return if character == nil
  739.       # [X座標]
  740.       n = self.width / 2
  741.       n = [n, @name_skin.width + 16].max if @current_name != nil
  742.       w = @name_sprite.bitmap.width
  743.       x = character.screen_x - [[n, w].max, self.width - 32].min
  744.       # [Y座標]
  745.       if self.pop_character == 0 and POP_DIRECTION #イベントの方向を考慮。
  746.         if character.direction == 2 #下向き
  747.           @position = 0 #上にポップ
  748.         elsif character.direction == 8 #上向き
  749.           @position = 2 #下にポップ
  750.         end
  751.       end
  752.       case @position
  753.       when 0
  754.         y = character.screen_y - CHARPOP_HEIGHT - self.height
  755.       else
  756.         y = character.screen_y + 16
  757.       end
  758.       x_max = Graphics.width - 4 - self.width
  759.       x_min = 4
  760.       y_max = Graphics.height - self.height
  761.       y_min = 4
  762.       self.x = [[x, x_max].min, x_min].max
  763.       self.y = [[y, y_max].min, y_min].max
  764.     end
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # 位置の連動
  768.   #--------------------------------------------------------------------------
  769.   def x=(n)
  770.     super
  771.     if @name_window
  772.       if $name_right
  773.         @name_window.x = n + self.width - @name_window.width - NAME_WINDOW_OFFSET_X
  774.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  775.       else
  776.         @name_window.x = n + NAME_WINDOW_OFFSET_X
  777.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  778.       end
  779.     end
  780.   end
  781.   def y=(n)
  782.     super
  783.     if @name_window
  784.       @name_window.y = n + NAME_WINDOW_OFFSET_Y
  785.       @name_sprite.y = n + NAME_WINDOW_OFFSET_Y + 2 + NAME_WINDOW_OFFSET_HIGHT / 2
  786.     end
  787.   end
  788.   def z=(n)
  789.     super
  790.     if @name_window
  791.       @name_window.z = n + 11#1 テールの上に表示されるので、Zを水増しする。
  792.       @name_sprite.z = n + 12#2
  793.     end
  794.   end
  795.   #--------------------------------------------------------------------------
  796.   # ● ファイバーのメイン処理
  797.   #--------------------------------------------------------------------------
  798.   def fiber_main_namewin
  799.     fiber_main_namewin_default
  800.     @name_window.openness = 0
  801.     @name_sprite.bitmap.clear
  802.     $name = ""
  803.   end
  804.   alias :fiber_main_namewin_default :fiber_main
  805.   alias :fiber_main :fiber_main_namewin
  806. end
  807. #==============================================================================
  808. # 伸縮対応
  809. #==============================================================================
  810. class Window_Message < Window_Base
  811.   #--------------------------------------------------------------------------
  812.   # ● ウィンドウの背景と位置の設定 [再定義]
  813.   #--------------------------------------------------------------------------
  814.   def reset_window
  815.     @background = $game_message.background
  816.     @position = $game_message.position
  817.     if @background == 0   # 通常ウィンドウ
  818.       self.opacity = 255
  819.     else                  # 背景を暗くする、透明にする
  820.       self.opacity = 0
  821.     end
  822.     case @position
  823.     when 0  # 上
  824.       self.y = 0
  825.       @gold_window.y = 360
  826.     when 1  # 中
  827.       self.y = (Graphics.height - self.height) / 2
  828.       @gold_window.y = 0
  829.     when 2  # 下
  830.       self.y = Graphics.height - self.height
  831.       @gold_window.y = 0
  832.     end
  833.   end
  834. end
  835. #==============================================================================
  836. # □ Window_Copy
  837. #------------------------------------------------------------------------------
  838. #   指定のウィンドウのコピーを作成します。
  839. #==============================================================================
  840. class Window_Copy < Window_Base
  841.   #--------------------------------------------------------------------------
  842.   # ○ オブジェクト初期化
  843.   #--------------------------------------------------------------------------
  844.   def initialize(window)
  845.     super(window.x, window.y, window.width, window.height)
  846.     self.contents = window.contents.dup unless window.contents.nil?
  847.     self.opacity = window.opacity
  848.     self.back_opacity = window.back_opacity
  849.     self.z = window.z - 3
  850.     self.visible = window.visible
  851.   end
  852. end
  853. #==============================================================================
  854. # □ Sprite_Copy
  855. #------------------------------------------------------------------------------
  856. #   指定のスプライトのコピーを作成します。
  857. #==============================================================================
  858. class Sprite_Copy < Sprite
  859.   #--------------------------------------------------------------------------
  860.   # ○ オブジェクト初期化
  861.   #--------------------------------------------------------------------------
  862.   def initialize(sprite)
  863.     super()
  864.     self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
  865.     self.opacity = sprite.opacity
  866.     self.x = sprite.x
  867.     self.y = sprite.y
  868.     self.z = sprite.z - 3
  869.     self.ox = sprite.ox
  870.     self.oy = sprite.oy
  871.     self.zoom_x = sprite.zoom_x
  872.     self.visible = sprite.visible
  873.   end
  874. end



  875. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  876. #■吹きだしテールの表示ルーチン。
  877. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  878. #==============================================================================
  879. # +++ 「+ふきだし表示」VX +++
  880. # by パラ犬  [url]http://2d6.parasite.jp/[/url]
  881. #      ×
  882. #    row       [url]http://xms.rdy.jp/[/url]
  883. #
  884. # publish 2010/ 3/ 2
  885. # update  -
  886. #
  887. #------------------------------------------------------------------------------
  888. #    ほぼどんなメッセージウィンドウに対しても後付け可能な「ふきだし表示」です。
  889. #  また、テール部分のみの自動追尾機能を持ちます。
  890. #   ふきだし表示をするには、
  891. #  テール用画像「Window-top」「Window-under」を
  892. #  「Graphics/System」フォルダにインポートしておく必要があります。
  893. #==============================================================================
  894. # ■ Window_Message
  895. #==============================================================================
  896. class Window_Message < Window_Base
  897.   #--------------------------------------------------------------------------
  898.   # ● メッセージの開始
  899.   #--------------------------------------------------------------------------
  900.   alias parashelf_update_all_windows update_all_windows
  901.   def update_all_windows
  902.     parashelf_update_all_windows
  903.     update_tail
  904.   end
  905.   #--------------------------------------------------------------------------
  906.   # クローズ [オーバーライド]
  907.   #--------------------------------------------------------------------------
  908.   def close
  909.     super
  910.     del_tail
  911.     @name_window.close if @name_window != nil #ネームウィンドウのクローズ動作。
  912.   end
  913.   #--------------------------------------------------------------------------
  914.   # ● 背景スプライトの更新
  915.   #--------------------------------------------------------------------------
  916.   alias parashelf_update_back_sprite update_back_sprite
  917.   def update_back_sprite
  918.     parashelf_update_back_sprite
  919.     update_tail
  920.   end
  921.   #--------------------------------------------------------------------------
  922.   # ○ フレーム更新 (ふきだしテールの更新)
  923.   #--------------------------------------------------------------------------
  924.   def update_tail
  925.     # ふきだしモードではイベントの動きに追従
  926.     if $mes_id != nil and @tail != nil
  927.       tale_pos = get_tale_pos
  928.       @tail.x = tale_pos[0]
  929.       @tail.y = tale_pos[1]
  930.       update_tail_bitmap
  931.     end
  932.   end
  933.   ##--------------------------------------------------------------------------
  934.   # ○ ふきだしテールの画像を更新。
  935.   #--------------------------------------------------------------------------
  936.   def update_tail_bitmap
  937.     skin = "Window"
  938.     skin = "Think" if $game_switches[THINK_TAIL]
  939.     if $win_x != nil
  940.       if $win_x > 0
  941.         @tail.bitmap = Cache.system(skin + "-right")
  942.       elsif  $win_x < 0
  943.         @tail.bitmap = Cache.system(skin + "-left")
  944.       else
  945.         case @position
  946.         when 0  # 上
  947.           @tail.bitmap = Cache.system(skin + "-top")
  948.         when 2  # 下
  949.           @tail.bitmap = Cache.system(skin + "-under")
  950.         end
  951.       end
  952.     else
  953.       case @position
  954.       when 0  # 上
  955.         @tail.bitmap = Cache.system(skin + "-top")
  956.       when 2  # 下
  957.         @tail.bitmap = Cache.system(skin + "-under")
  958.       end
  959.     end
  960.     # 可視状態
  961.     if self.visible == true
  962.       @tail.visible = self.openness == 255
  963.     else
  964.       @tail.visible = false
  965.     end
  966.   end
  967.   #--------------------------------------------------------------------------
  968.   # ○ テールの位置を計算
  969.   #--------------------------------------------------------------------------
  970.   def get_tale_pos
  971.     if defined?($game_system.show_stand_picture) #A1立ち絵スクリプトを入れている。
  972.       if $game_system.show_stand_picture #立ち絵on
  973.         pos = get_tale_pos_stand_pic
  974.       else
  975.         pos = get_tale_pos_normal
  976.       end
  977.     else
  978.       pos = get_tale_pos_normal
  979.     end
  980.     return pos
  981.   end
  982.   #--------------------------------------------------------------------------
  983.   # ○ テールの位置を計算/立ち絵使用時。※NAME_CHANGEの編集必須。
  984.   #--------------------------------------------------------------------------
  985.   def get_tale_pos_stand_pic
  986.     if $game_message.face_name != ""  and @tail != nil
  987.       name = A1_System::StandPicture::NAME_CHANGE[$game_message.face_name]
  988.       chara = name[$game_message.face_index][0]
  989.       if @stand_pic[chara] != nil #立ち絵無しの場合通常通り。
  990.         x = @stand_pic[chara].pic_sprite.x + @stand_pic[chara].pic_sprite.width / 2
  991.         y = get_tale_pos_normal_updown
  992.         update_tail_bitmap
  993.       else
  994.         return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  995.       end
  996.     else
  997.       return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  998.     end
  999.     return [x,y]
  1000.   end
  1001.   #--------------------------------------------------------------------------
  1002.   # ○ テールの位置を計算/立ち絵未使用時。
  1003.   #--------------------------------------------------------------------------
  1004.   def get_tale_pos_normal
  1005.     if $mes_id == (-2) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1006.       if $win_x != nil
  1007.         if $win_x > 0
  1008.           x = $win_x - @tail.width / 2
  1009.           y = self.y + self.height / 2 - @tail.height / 2
  1010.         elsif $win_x < 0
  1011.           x = self.width - @tail.width / 2
  1012.           y = self.y + self.height / 2 - @tail.height / 2
  1013.         else
  1014.           x = MINAS_TWE_X_POS
  1015.           y = get_tale_pos_normal_updown
  1016.         end
  1017.       else
  1018.         x = MINAS_TWE_X_POS
  1019.         y = get_tale_pos_normal_updown
  1020.       end
  1021.     elsif $mes_id <= (-3) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1022.       if $win_x != nil
  1023.         if $win_x > 0
  1024.           x = $win_x - @tail.width / 2
  1025.           y = self.y + self.height / 2
  1026.         elsif $win_x < 0
  1027.           x = self.width - @tail.width / 2
  1028.           y = self.y + self.height / 2
  1029.         else
  1030.           x = MINAS_THREE_X_POS
  1031.           y = get_tale_pos_normal_updown
  1032.         end
  1033.       else
  1034.         x = MINAS_THREE_X_POS
  1035.         y = get_tale_pos_normal_updown
  1036.       end
  1037.     else
  1038.       character = get_character($mes_id)
  1039.       x = [[character.screen_x - 16, self.x].max, self.x + self.width - 32].min
  1040.       if $win_x != nil
  1041.         if $win_x > 0
  1042.           x = $win_x - @tail.width / 2
  1043.           y = character.screen_y
  1044.         elsif $win_x < 0
  1045.           x = self.width
  1046.           y = character.screen_y
  1047.         else
  1048.           y = get_tale_pos_normal_updown
  1049.         end
  1050.       else
  1051.         y = get_tale_pos_normal_updown
  1052.       end
  1053.     end
  1054.     return [x, y]
  1055.   end
  1056.   #--------------------------------------------------------------------------
  1057.   # ○ テールが上下の時、かつ[-2][-3]でない時のy座標の取得。
  1058.   #--------------------------------------------------------------------------
  1059.   def get_tale_pos_normal_updown
  1060.     case @position
  1061.     when 0
  1062.       y = self.y + self.height - @tail.height / 2
  1063.     else
  1064.       y = self.y - @tail.height / 2
  1065.     end
  1066.     return y
  1067.   end
  1068.   #--------------------------------------------------------------------------
  1069.   # ○ ふきだしを破棄
  1070.   #--------------------------------------------------------------------------
  1071.   def del_tail
  1072.     if @tail != nil
  1073.       @tail.dispose
  1074.       @tail = nil
  1075.     end
  1076.   end
  1077. end
  1078. #
  1079. # ▼▲▼ XRXS 9拡張CO-X. ふきだし自動設定 ▼▲▼
  1080. #==============================================================================
  1081. # ■ Window_Message
  1082. #==============================================================================
  1083. class Window_Message < Window_Base
  1084.   #--------------------------------------------------------------------------
  1085.   # ○ ポップキャラクターの設定
  1086.   #--------------------------------------------------------------------------
  1087.   def pop_character=(character_id)
  1088.     @pop_character = character_id
  1089.     $mes_id = character_id
  1090.   end
  1091.   #--------------------------------------------------------------------------
  1092.   # ○ テールキャラクターの設定
  1093.   #--------------------------------------------------------------------------
  1094.   def tail_character=(character_id)
  1095.     #@pop_character = character_id
  1096.     $mes_id = character_id
  1097.   end
  1098. end


  1099. #==============================================================================
  1100. # ■ Window_ChoiceList
  1101. #------------------------------------------------------------------------------
  1102. #  イベントコマンド[選択肢の表示]で、Y座標を修正します。
  1103. #==============================================================================
  1104. class Window_ChoiceList < Window_Command
  1105.   #--------------------------------------------------------------------------
  1106.   # ● ウィンドウ位置の更新
  1107.   #--------------------------------------------------------------------------
  1108.   def update_placement_hukidasi
  1109.     #self.width = [max_choice_width + 12, 96].max + padding * 2
  1110.     #self.width = [width, Graphics.width].min
  1111.     #self.height = fitting_height($game_message.choices.size)
  1112.     #self.x = Graphics.width - width
  1113.     #if @message_window.y >= Graphics.height / 2
  1114.     #  self.y = @message_window.y - height
  1115.     #else
  1116.     #  self.y = @message_window.y + @message_window.height
  1117.     #end
  1118.     update_placement_hukidasi_default
  1119.     if self.y + self.height > Graphics.height
  1120.       self.y -= ( ( self.height + self.y ) - Graphics.height)
  1121.       self.z += 100
  1122.     end
  1123.   end
  1124.   alias :update_placement_hukidasi_default :update_placement
  1125.   alias :update_placement :update_placement_hukidasi
  1126. end

  1127. #==============================================================================
  1128. # ■ Scene_Menu
  1129. #------------------------------------------------------------------------------
  1130. #  メニューを開いてからウィンドウが出るとネームウィンドウが表示される不具合修正。
  1131. #==============================================================================
  1132. #class Scene_Menu < Scene_MenuBase
  1133. #  def terminate_hukidasi_menyu
  1134. #    @name_window.openness = 0 if @name_window != nil
  1135. #    terminate_hukidasi_menyu_default
  1136. #  end
  1137. #  alias :terminate_hukidasi_menyu_default :terminate
  1138. #  alias :terminate :terminate_hukidasi_menyu
  1139. #end

  1140. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1141. #■ウィンドウ非表示ルーチン
  1142. #■吹きだしテールとネームウィンドウに対応。
  1143. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1144. #==============================================================================
  1145. # L(キーボードのQ)を押すと、メッセージウィンドウを表示・非表示
  1146. #==============================================================================
  1147. class Window_Message < Window_Base
  1148.   def update_winoff
  1149.     unless $game_party.in_battle #バトル中は無効。
  1150.       if Input.trigger?(Input::L)
  1151.         if self.visible == true
  1152.           self.visible = false
  1153.           @background = 777 if @back_sprite != nil and @background == 1 #「背景を暗くする」
  1154.           @tail.visible = false if @tail != nil
  1155.         else
  1156.           self.visible = true
  1157.           @background = 1 if @back_sprite != nil and @background == 777 #「背景を暗くする」
  1158.         end
  1159.         if @name_window != nil
  1160.           if @name_window.visible == false and $name != nil and $name != ""
  1161.             @name_window.visible = true
  1162.             @name_sprite.visible = true
  1163.           else
  1164.             @name_window.visible = false
  1165.             @name_sprite.visible = false
  1166.           end
  1167.         end
  1168.       elsif Input.trigger?(Input::C) or Input.trigger?(Input::B)
  1169.         if self.visible == false
  1170.           self.visible = true
  1171.           @back_sprite.visible = true unless @back_sprite
  1172.         end
  1173.         @tail.visible = true if @tail != nil and @tail.visible == false
  1174.         if @name_window != nil and $name != nil
  1175.           if $name != ""
  1176.             @name_window.visible = true
  1177.             @name_sprite.visible = true
  1178.           end
  1179.         end
  1180.       end
  1181.     end
  1182.     update_winoff_default
  1183.   end
  1184.   alias :update_winoff_default :update
  1185.   alias :update :update_winoff
  1186. end


  1187. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1188. #■ウィンドウ表示位置指定ルーチン
  1189. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1190. #===========================================================================
  1191. #イベントコマンド「スクリプト」を使い、
  1192. #$win_x=100 
  1193. #$win_y=100
  1194. #と入力すれば、ウィンドウを(100、100)の位置に表示します。
  1195. #使わない時は
  1196. #$win_x=nil
  1197. #などとnilを入力しておいてください。
  1198. #===========================================================================
  1199. class Window_Message < Window_Base
  1200.   #--------------------------------------------------------------------------
  1201.   # ● ウィンドウの背景と位置の設定 [再定義]
  1202.   #--------------------------------------------------------------------------
  1203.   def update_placement_position
  1204.     update_placement_position_default
  1205.     if $win_x != nil
  1206.       if $win_x > 0
  1207.         self.x = $win_x
  1208.         self.width -= $win_x
  1209.       else
  1210.         self.x = 0
  1211.         self.width += $win_x
  1212.       end
  1213.     end
  1214.     if $win_y != nil
  1215.       self.y = $win_y
  1216.     end
  1217.     #上表示の時、ネームウィンドウが見切れるので少し下にずらす。
  1218.     if self.y == 0 and @position == 0 and @name_window != nil and $name != nil
  1219.       self.y += (-NAME_WINDOW_OFFSET_Y)
  1220.     end
  1221.   end
  1222.   alias_method :update_placement_position_default, :update_placement
  1223.   alias_method :update_placement, :update_placement_position
  1224. end


  1225. #==============================================================================
  1226. # ■ SceneManager
  1227. #------------------------------------------------------------------------------
  1228. #  シーン遷移のさい、テールを破棄。ネームウィンドウのデータをクリア。
  1229. #==============================================================================
  1230. module SceneManager
  1231.   #--------------------------------------------------------------------------
  1232.   # ● 呼び出し
  1233.   #--------------------------------------------------------------------------
  1234.   def self.call_sceman_hukidasi(scene_class)
  1235.     if defined?(self.scene.message_window)
  1236.       self.scene.message_window.del_tail if self.scene.message_window.tail != nil
  1237.       $name = ""
  1238.     end
  1239.     @stack.push(@scene)
  1240.     [url=home.php?mod=space&uid=420706]@Scene[/url] = scene_class.new
  1241.   end
  1242.   #--------------------------------------------------------------------------
  1243.   # ● クラスメソッドのエイリアス
  1244.   #--------------------------------------------------------------------------
  1245.   class << self
  1246.     alias :call_sceman_hukidasi_default :call
  1247.     alias :call :call_sceman_hukidasi
  1248.   end
  1249. end

  1250. #==============================================================================
  1251. # ■ Scene_Map
  1252. #------------------------------------------------------------------------------
  1253. #  戦闘トランジションのさい、テールを破棄。
  1254. #==============================================================================
  1255. class Scene_Map < Scene_Base
  1256.   attr_accessor :message_window
  1257.   #--------------------------------------------------------------------------
  1258.   # ● 戦闘前トランジション実行
  1259.   #--------------------------------------------------------------------------
  1260.   def perform_battle_transition_hukidasi
  1261.     @message_window.del_tail #テールの破棄
  1262.     perform_battle_transition_hukidasi_default
  1263.   end
  1264.   alias_method :perform_battle_transition_hukidasi_default, :perform_battle_transition
  1265.   alias_method :perform_battle_transition, :perform_battle_transition_hukidasi
  1266. end
复制代码

点评

这个脚本不行,把我的鼠标系统屏蔽了。。还有是日文不会用  发表于 2014-7-16 21:02
回复

使用道具 举报

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
回帖
265
 楼主| 发表于 2014-7-17 17:55:50 | 显示全部楼层
急用 不好意思
回复

使用道具 举报

无限の剣制

梦石
0
星屑
10460
在线时间
5019 小时
注册时间
2013-2-28
回帖
4942

开拓者贵宾

发表于 2014-7-17 18:29:50 | 显示全部楼层
夕仔 发表于 2014-7-17 17:55
急用 不好意思

那试试这个,貌似没办法显示角色名。只能显示事件名 ,
  1. #==============================================================================
  2. # ★ RGSS3_ネームポップ Ver1.1
  3. #==============================================================================
  4. =begin

  5. 作者:tomoaky
  6. webサイト:ひきも記 (http://hikimoki.sakura.ne.jp/)

  7. イベント名かイベント実行内容の先頭に『注釈』コマンドで
  8. <namepop 文字列>
  9. と記述してください。
  10. イベントキャラクターの頭上に文字列が表示されます。

  11. イベント名で指定した場合はイベント全ページに適用されますが、
  12. 優先度は注釈コマンドの方が高くなっています。

  13. 文字を消したい場合は <namepop none> としてください。

  14. 2011.12.16  Ver1.1
  15.   ・フォントの縁取り不透明度を設定項目に追加

  16. 2011.12.15  Ver1.0
  17.   公開

  18. =end

  19. #==============================================================================
  20. # □ 設定項目
  21. #==============================================================================
  22. module TMNPOP
  23.   FONT_SIZE = 14          # フォントサイズ
  24.   FONT_OUT_ALPHA = 255    # フォントの縁取り不透明度
  25. end

  26. #==============================================================================
  27. # ■ Game_Character
  28. #==============================================================================
  29. class Game_Character
  30.   #--------------------------------------------------------------------------
  31.   # ● 公開インスタンス変数
  32.   #--------------------------------------------------------------------------
  33.   attr_accessor :namepop                  # ポップアップテキスト
  34.   #--------------------------------------------------------------------------
  35. end

  36. #==============================================================================
  37. # ■ Game_Event
  38. #==============================================================================
  39. class Game_Event < Game_Character
  40.   #--------------------------------------------------------------------------
  41.   # ● イベントページの設定をセットアップ
  42.   #--------------------------------------------------------------------------
  43.   alias tmnpop_game_event_setup_page_settings setup_page_settings
  44.   def setup_page_settings
  45.     tmnpop_game_event_setup_page_settings
  46.     if @list
  47.       @namepop = $1 if /<namepop\s*(\S+?)>/i =~ @event.name
  48.       @list.each do |list|
  49.         if list.code == 108 || list.code == 408
  50.           @namepop = $1 if /<namepop\s*(\S+?)>/i =~ list.parameters[0]
  51.         else
  52.           break
  53.         end
  54.       end
  55.     end
  56.   end
  57. end

  58. #==============================================================================
  59. # ■ Sprite_Character
  60. #==============================================================================
  61. class Sprite_Character < Sprite_Base
  62.   #--------------------------------------------------------------------------
  63.   # ● 解放
  64.   #--------------------------------------------------------------------------
  65.   alias tmnpop_sprite_character_dispose dispose
  66.   def dispose
  67.     dispose_namepop
  68.     tmnpop_sprite_character_dispose
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● フレーム更新
  72.   #--------------------------------------------------------------------------
  73.   alias tmnpop_sprite_character_update update
  74.   def update
  75.     tmnpop_sprite_character_update
  76.     update_namepop
  77.     if @character.namepop != @namepop
  78.       @namepop = @character.namepop
  79.       start_namepop
  80.     end
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ○ namepopの開始
  84.   #--------------------------------------------------------------------------
  85.   def start_namepop
  86.     dispose_namepop
  87.     return if @namepop == "none" || @namepop == nil
  88.     @namepop_sprite = ::Sprite.new(viewport)
  89.     h = TMNPOP::FONT_SIZE + 4
  90.     @namepop_sprite.bitmap = Bitmap.new(h * 10, h)
  91.     @namepop_sprite.bitmap.font.size = TMNPOP::FONT_SIZE
  92.     @namepop_sprite.bitmap.font.out_color.alpha = TMNPOP::FONT_OUT_ALPHA
  93.     @namepop_sprite.bitmap.draw_text(0, 0, h * 10, h, @namepop, 1)
  94.     @namepop_sprite.ox = h * 5
  95.     @namepop_sprite.oy = h
  96.     update_namepop
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ○ namepopの更新
  100.   #--------------------------------------------------------------------------
  101.   def update_namepop
  102.     if @namepop_sprite
  103.       @namepop_sprite.x = x
  104.       @namepop_sprite.y = y - height
  105.       @namepop_sprite.z = z + 200
  106.     end
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ○ namepopの解放
  110.   #--------------------------------------------------------------------------
  111.   def dispose_namepop
  112.     if @namepop_sprite
  113.       @namepop_sprite.bitmap.dispose
  114.       @namepop_sprite.dispose
  115.       @namepop_sprite = nil
  116.     end
  117.   end
  118. end

复制代码

点评

主角没办法,改颜色的话在这个脚本里绘制文字的地方改。  发表于 2014-7-17 20:02
事件可以,谢谢。怎么改字的颜色? 主角没办法吗?  发表于 2014-7-17 19:49

评分

参与人数 1星屑 +100 收起 理由
taroxd + 100 我很赞同

查看全部评分

回复

使用道具 举报

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
回帖
265
 楼主| 发表于 2014-7-18 20:10:48 | 显示全部楼层

RMVA显示主角以及队员的名字

在主角和主角的队员的头上显示他们的名字,怎么操作?

点评

可是没解答 主角和队员的  发表于 2014-7-19 19:30
你之前是不是问过一模一样的问题了?  发表于 2014-7-18 20:15
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部