设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3145|回复: 4
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
跳转到指定楼层
1
发表于 2014-7-16 20:38:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2014-7-16 20:50:34 | 只看该作者
本帖最后由 taroxd 于 2014-7-16 20:58 编辑

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

@Scene

RUBY 代码复制
  1. =begin
  2. 吹きだしウィンドウVXAce
  3.  
  4. 2011.12.25 tamura改造
  5. 2012年08月26日 改訂
  6.  
  7. ※このスクリプトは、ちいさな本屋様([url]http://xrxs.at-ninja.jp/[/url])
  8. が製作されたものをtamuraがACE用に改造した物です。
  9.  
  10. 原版:
  11.  ▽▽▽ XRXSv2. メッセージ表示フルグレードアップVX ▽▽▽
  12.  publish 2010/ 3/ 2
  13.  update  - 11/ 1/10a
  14.  
  15.  
  16. ※※警告※※
  17. THINK_TAIL や SYSTEM_LINE の機能を使わない場合は、
  18. これらに使用していないスイッチを割り当てておいてください。
  19.  
  20.  
  21. 「立ち絵機能」をONにしている時に、立ち絵を表示せずに、ウィンドウ位置を
  22. 右か左に変更した時、テールのY座標がずれるようです。
  23. 原因は調査中です。立ち絵を表示しない時は、イベントコマンド「注釈」で、
  24. 「立ち絵表示 off」と記述して立ち絵機能をOFFにしておいてください。
  25.  
  26. ●機能一覧
  27. ・イベントコマンド「スクリプト」で、$win_x $win_yに値を入力すると、
  28.  ($win_x 、$win_y)の位置にウィンドウを表示する。画面左上が(0,0)。
  29.  
  30. ・キーボードのQ(装備画面で前のキャラに戻るボタン)を押すと、
  31.  ウィンドウが消える。Qか決定、キャンセルキーで元に戻る。
  32.  
  33. ・イベントコマンド「スクリプト」で、
  34. $name_right = true
  35. と入力すれば、ネームウィンドウがウィンドウの右に移ります。
  36. 元に戻すには、イベントコマンド「スクリプト」で
  37. $name_right = false
  38. と入力すれば、左側に戻ります。
  39.  
  40.  
  41. ・イベントコマンド「スクリプト」で、
  42. $system_line = true
  43. と入力すれば、最初の一行目を表示しません。
  44. $system_line = false
  45. で元に戻ります。
  46.  
  47.  
  48. ・文章のどこでもいいので、以下の表記を行う。
  49. ・ \name[] : []の中の文字を、ウィンドウ左上に小さく表示する。
  50.  表示させる名前には、制御文字 \V、\P、\N、\G が使用可能。
  51.  
  52.  \h[-1] : プレーヤーの上にウィンドウをポップ。
  53.  \h[0] : 現在アクティブのイベントの上にウィンドウをポップ。
  54.  \h[1] : IDが1番のイベントの上にウィンドウをポップする。
  55.  hは大文字でもOK。
  56.  
  57.  ポップアップを行うとき、
  58.  「メッセージの表示」の設定で、ウィンドウの「表示位置」によって、
  59.  ウィンドウがイベントの上に出るか下に出るかを設定できます。
  60.  
  61. ウィンドウは通常の大きさのまま、テールだけ表示したい場合は、
  62.  \t[-2] : ウィンドウが上下に表示される時は、X座標をMINAS_TWE_X_POSで固定。
  63.            $win_x で左右に表示される時は、Y座標がウィンドウの中心やや下で固定。
  64.  \t[-3] : ウィンドウが上下に表示される時は、X座標をMINAS_THREE_X_POSで固定。
  65.            $win_x で左右に表示される時は、Y座標がウィンドウの中心やや下で固定。
  66.  \t[-1] : プレーヤーの上に向かってテール表示。
  67.  \t[0] : 現在アクティブのイベントに向かってテール表示。
  68.  \t[1] : IDが1番のイベントの上に向かってテール表示。
  69.  
  70.  その他
  71.  \O[128] : 文字を透明にする。128はalphaの値で、0で透明、255で通常。
  72.  \D : 文字に影をつける
  73.  \hold : メッセージ表示の、最後の文章に限定。
  74.       メッセージが終わっても、ウィンドウを閉じずに残します。
  75.       他のメッセージが表示されて次へ送られる時に消えます。
  76.       なお、ホールドされているウィンドウは、Qボタンで消せません。
  77.  
  78.  
  79.  
  80. ●その他
  81. ・ACEに標準装備されている機能は通常通り使用できます。
  82. ・A1殿([url]http://a1tktk.web.fc2.com/[/url])の立ち絵スクリプトに対応しています。
  83.  このスクリプトの上に「RGSS3用A1共通処理」
  84.  このスクリプトの下に「空メッセージでウィンドウを開かない」「立ち絵表示」を
  85.  配置して下さい。
  86.  残念ながら、「ネームウィンドウ」は使えません。上記\nameをお使いください。
  87. ※立ち絵を表示しない時は、注釈で「立ち絵表示 off」とした方が無難です。
  88. ・イベントの下から話しかけたら上へポップ、上から話しかけたら下へポップするという
  89.  機能を追加。カスタマイズポイントで POP_DIRECTION = ture と変更のこと。
  90.  
  91.  
  92. ●廃止機能 
  93. ・\Iがすでに使われているので、イタリック文字変換を廃止。
  94. ・スピード変更、改行、最後に入手したアイテムの表示を、ACE化にともない廃止。
  95.  
  96.  
  97. 【改訂履歴】
  98. 2012.01.10  ・ウィンドウを消したまま次のウィンドウを自動で表示すると、
  99.               ネームウィンドウが表示されるのを修正。
  100. 2012.01.11  ・ネームウィンドウが出しっぱなしになるのを修正。
  101. 2012.01.12  ・メニューを出してから決定ボタンを押すとネームウィンドウがでる不具合の修正。
  102. 2012.02.01 ・ネームウィンドウのオープン&クローズのタイミングを変更。
  103.       ・hold機能を追加。
  104. 2012.02.10 ・キャラポップした時、一行ずつしか表示されない不具合を修正。
  105. 2012.02.14 ・アイテム名などの文字数が正常に取得できなかったのを修正。
  106. 2012.02.21 ・話しかけられた方向によって、ポップ方向を変えられるようにした。
  107. 2012.02.25 ・すべてのシーン遷移の際はテールを破棄(イベント中でショップ起動など)
  108. 2012.02.28 ・エスケープ文字の処理が上手くいかない問題について暫定対策。
  109. 2012.03.05 ・微妙にウィンドウ幅が足りない時があったので、僅かにウィンドウ幅追加。
  110. 2012.03.14 ・ポップアップ時の顔グラ表示に対応。
  111. 2012.04.20 ・吹きだしが大型になると選択肢が入りきらない不具合の修正。
  112.             ・ネームウィンドウが残ったままシーン遷移があると、ネームウィンドウが
  113.              閉じない不具合の修正。
  114. 2012.05.02  ・名前には、制御文字 \V、\P、\N、\G が使用可能。
  115.             ・\V については、2段階の入れ子が使用可能。
  116.             ・ウィンドウ消去機能を、「背景を暗くする」に対応。
  117. 2012.05.09 ・通常の上表示のとき、ネームウィンドウが見切れるので少し下にずらす。
  118. 2012.05.12 ・ネームウィンドウの幅と高さを変更可能にした。
  119.             ・ネームウィンドウの高さを変えると、どんどん下に伸びるのを修正。
  120. 2012.07.15 ・イベントコマンドで、$name_right = true と入力すると、
  121.        名前ウィンドウが右に移ります。
  122. 2012.08.26 ・思案型テールへの変更機能追加。
  123.             ・文章の1行目を表示しない機能は、スイッチを使えるようにした。
  124.              (セーブ&ロードに対応していないため)
  125.              なお、従来の$system_line も使用可能。
  126.  
  127. =end
  128.  
  129. #==============================================================================
  130. # カスタマイズポイント
  131. #==============================================================================
  132. #=begin
  133. class Window_Message < Window_Base
  134.   #
  135.   # 基本行数
  136.   #
  137.   MAX_LINE = 4
  138.   #
  139.   # \p[] - キャラポップの高さ
  140.   #
  141.   CHARPOP_HEIGHT = 40
  142.   #
  143.   #
  144.   #\name[]で表示されるウィンドウのX座標、Y座標、幅、高さ の変更値。
  145.   #座標は、メッセージウィンドウの左上端が原点。名前はウィンドウ中央に表示。
  146.   NAME_WINDOW_OFFSET_X =   0
  147.   NAME_WINDOW_OFFSET_Y = -24
  148.   NAME_WINDOW_OFFSET_WIDTH = 0
  149.   NAME_WINDOW_OFFSET_HIGHT = 5
  150.  
  151.   #
  152.   #
  153.   MINAS_TWE_X_POS = 100 # $t[-2]のときの、テールのX座標。
  154.   MINAS_THREE_X_POS = 444 # $t[-3]のときの、テールのX座標。
  155.  
  156.   POP_DIRECTION = false #イベントの方向を考慮。
  157.  
  158.   THINK_TAIL = 101 #この番号のゲームスイッチがONの時、思案型テールになります。
  159.   SYSTEM_LINE = 102 #この番号のゲームスイッチがONの時、最初の1行を表示しません。
  160.  
  161. end
  162.  
  163. #(メモ)上表示で、ネームウィンドウのために少し下にずらす機能は、
  164. #再定義したupdate_placement_positionのところ。
  165.  
  166. #==============================================================================
  167. # 参照機能
  168. #==============================================================================
  169. class Game_Temp
  170.   attr_accessor :last_gain_material
  171.   attr_accessor :last_gain_holder
  172. end
  173.  
  174. class Window_Message < Window_Base
  175.   #--------------------------------------------------------------------------
  176.   # ● 改ページ処理
  177.   #--------------------------------------------------------------------------
  178.   def new_page(text, pos)
  179.     contents.clear
  180.     draw_face($game_message.face_name, $game_message.face_index, 0, 0)
  181.     reset_font_settings
  182.     pos[:x] = new_line_x
  183.  
  184.     #変更部分。システム用の一行目を表示しない。
  185.     if $system_line == false and $game_switches[SYSTEM_LINE] == false
  186.       pos[:y] = 0
  187.     else
  188.       pos[:y] = 0 - line_height
  189.     end
  190.  
  191.     pos[:new_x] = new_line_x
  192.     pos[:height] = calc_line_height(text)
  193.     clear_flags
  194.   end
  195. end
  196.  
  197. #==============================================================================
  198. # フルグレードアップベース - 制御文字・基本機能
  199. #==============================================================================
  200. class Window_Message < Window_Base
  201.   attr_accessor :tail
  202.   #--------------------------------------------------------------------------
  203.   # ● 特殊文字の変換 + 準備
  204.   #     変換・消去してもいい部分を処理、フラグのセット。
  205.   #--------------------------------------------------------------------------
  206.   alias xrxsv2_convert_escape_characters convert_escape_characters
  207.   def convert_escape_characters(text)
  208.     #@textsが使いずらいので、ここで別変数に保管。
  209.     @all_texts = []
  210.     str = text.gsub(/\\/) { "\e" }
  211.     @all_texts = str.split("\n")
  212.  
  213.     #この段階で、変数・アクター名を変換してしまう。
  214.     #ネームウィンドウ内の文字を変換するため。
  215.     text = convert_escape_characters_easy(text)
  216.  
  217.     # 初期化
  218.     contents.font.size   = Font.default_size
  219.     contents.font.bold   = Font.default_italic
  220.     contents.font.italic = Font.default_bold
  221.     contents.font.shadow = Font.default_shadow
  222.     @type_wait = 0
  223.     @line_widths = []
  224.     @line_aligns = []
  225.     self.pop_character = nil
  226.     # ウィンドウ保持指定\holdがあるか?
  227.     @window_hold = (text.gsub!(/\\hold/) { "" } != nil)
  228.     # \info
  229.     @info_mode = (text.gsub!(/\\info/) { "" } != nil)
  230.     # 改行削除指定\_があるか?
  231.     if (/\\_(.*?)\x00/.match(@text)) != nil
  232.       $game_message.choice_start -= 1
  233.       text.gsub!(/\\_(.*?)\x00/) { $1.to_s }
  234.     end
  235.     # \name 判定
  236.     if text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  237.       name = $1
  238.       bitmap = @name_sprite.bitmap
  239.       w = [bitmap.text_size(name).width, 1].max + NAME_WINDOW_OFFSET_WIDTH
  240.       bitmap.dispose
  241.       @name_sprite.bitmap = Bitmap.new(w, 32)
  242.       bitmap = @name_sprite.bitmap
  243.       bitmap.draw_text(0, 0, bitmap.width, bitmap.height, name)
  244.       @name_window.width = w + 16
  245.       @name_window.height = bitmap.height + NAME_WINDOW_OFFSET_HIGHT
  246.       @name_window.create_contents
  247.       @name_window.open if @name_window.openness == 0
  248.       if self.visible #名前だけ表示されるのを防止。
  249.         @name_window.visible = true
  250.         @name_sprite.visible = true
  251.       else
  252.         @name_window.visible = false
  253.         @name_sprite.visible = false
  254.       end
  255.     else
  256.       @name_window.visible = false
  257.       @name_sprite.visible = false
  258.       @name_sprite.bitmap.dispose
  259.       @name_sprite.bitmap = Bitmap.new(32,32)
  260.     end
  261.     $name = $1 #あれこれで使うので、ネームウィンドウに表示予定の名前を取得。
  262.     # キャラボップモード
  263.     if text.gsub!(/\\[Hh]\[-1\]/) { "" }
  264.       self.pop_character = -1
  265.     elsif text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "" }
  266.       self.pop_character = $1.to_i
  267.     elsif text.gsub!(/\\[Hh]/) { "" }
  268.       self.pop_character = 0
  269.     #テール表示モード
  270.     elsif text.gsub!(/\\[Tt]\[-1\]/) { "" }
  271.       self.tail_character = -1
  272.     elsif text.gsub!(/\\[Tt]\[-2\]/) { "" }
  273.       self.tail_character = -2
  274.     elsif text.gsub!(/\\[Tt]\[-3\]/) { "" }
  275.       self.tail_character = -3
  276.     elsif text.gsub!(/\\[Tt]\[([0-9]+)\]/) { "" }
  277.       self.tail_character = $1.to_i
  278.     elsif text.gsub!(/\\[Tt]/) { "" }
  279.       self.tail_character = 0
  280.     else
  281.       self.pop_character = nil
  282.     end
  283.  
  284.     # 制御文字処理
  285.     text = xrxsv2_convert_escape_characters(text)
  286.     text.gsub!(/\\[Ss]\[([0-9]+)\]/i) { "\eS[#{$1}]" }
  287.     text.gsub!(/\\[Oo]\[([0-9]+)\]/i) { "\eO[#{$1}]" }
  288.     text.gsub!(/\\last_holder/i) { "\e18" }
  289.     text.gsub!(/\\last_material/i) { "\e19" }
  290.     text.gsub!(/\\B/) { "\eB" }
  291.     text.gsub!(/\\D/) { "\eD" }
  292.     #text.gsub!(/\\n/) { "\n" }
  293.     #
  294.     # ライン情報の取得
  295.     rxs = ["\x01","\x02","\x03","\x04","\x05","\x06","\x07","\x08",
  296.       /\[([0-9]+)\]/,
  297.       "\x11","\x12","\x13","\x14", "\x15", "\x16", "\x17", "\x18","\x19"]
  298.     lines = text.split("\x00")
  299.     @lines_max = lines.size
  300.     for i in 0...@lines_max
  301.       line = lines[i]
  302.       for rx in rxs
  303.         line.gsub!(rx) {""}
  304.       end
  305.       @line_aligns[i] =
  306.         line.sub!(/\\center/) {""} ? CENTER :
  307.         line.sub!(/\\right/)  {""} ? RIGHT :
  308.                                      AUTO
  309.       # 行の横幅の取得と設定
  310.       cx = text_width_no_escape(line,text) #test
  311.       #cx = contents.text_size(line,text).width
  312.       @line_widths[i] = cx
  313.     end
  314.     # 位置揃え制御文字の削除
  315.     text.gsub!(/\\center/) {""}
  316.     text.gsub!(/\\right/) {""}
  317.     # キャラポップ時のウィンドウリサイズ
  318.     reszie_window_for_pop
  319.  
  320.     del_tail # if @tail != nil
  321.     # $mes_id が空のときと戦闘中はふきだしを表示しない
  322.     if defined?($game_system.show_stand_picture) #立ち絵に対応。
  323.       $mes_id = -1 if $game_system.show_stand_picture == true
  324.     end
  325.     if $mes_id != nil and not $game_party.in_battle
  326.       # ふきだしのテールを描画
  327.       skin = "Window"
  328.       if @background == 0
  329.         #画像の準備
  330.         @tail = Sprite.new
  331.         @tail.visible = false
  332.         # 位置を取得
  333.         tale_pos = get_tale_pos
  334.         if $win_x != nil
  335.           if $win_x > 0
  336.             @tail.bitmap = Cache.system(skin + "-right")
  337.             @tail.x = tale_pos[0]
  338.             @tail.y = tale_pos[1]
  339.             @tail.z = self.z + 1
  340.           elsif  $win_x < 0
  341.             @tail.bitmap = Cache.system(skin + "-left")
  342.             @tail.x = tale_pos[0]
  343.             @tail.y = tale_pos[1]
  344.             @tail.z = self.z + 1
  345.           else
  346.             create_tail_up_under
  347.           end
  348.         else
  349.           create_tail_up_under
  350.         end
  351.         # エクストラスプライトに登録
  352.         @extra_sprites = [] if @extra_sprites.nil?
  353.         @extra_sprites.push(@tail) if @tail != nil
  354.         # 更新
  355.         update_tail
  356.       end
  357.     end
  358.  
  359.     open_and_wait #リサイズが終わった時点でウィンドウオープン。
  360.  
  361.     return text
  362.   end
  363.   #--------------------------------------------------------------------------
  364.   # ● 制御文字の変換。
  365.   #    変数・パーティ名・アクター名・所持金のみ変換する。
  366.   #    文字「\」はエスケープ文字(\e)に変換。
  367.   #--------------------------------------------------------------------------
  368.   def convert_escape_characters_easy(text)
  369.     result = text.to_s.clone
  370.     result.gsub!(/\\[vV]\[/)          { "\eV\[" }
  371.     result.gsub!(/\\[nN]\[/)          { "\eN\[" }
  372.     result.gsub!(/\\[pP]\[/)          { "\eP\[" }
  373.     result.gsub!(/\\[gG]/)          { "\eG" }
  374.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  375.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  376.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  377.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  378.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  379.     result
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # ● 文字の長さを取得する。エスケープ文字は含まない。
  383.   # line : 表示しようとしている全ての文字列。
  384.   # text : その列の文字。
  385.   #--------------------------------------------------------------------------
  386.   def text_width_no_escape(line , text_o)
  387.     add = 5 #微妙に足りないので水増し。
  388.     text = Marshal.load(Marshal.dump(text_o))
  389.     text.gsub!(/\ehold/) { "" }
  390.     text.gsub!(/\einfo/) { "" }
  391.     # 改行削除指定\_があるか?
  392.     if (/\\_(.*?)\x00/.match(@text)) != nil
  393.       $game_message.choice_start -= 1
  394.       text.gsub!(/\\_(.*?)\x00/) { "" }
  395.     end
  396.     # \name 判定
  397.     text.sub!(/\e[Nn]ame\[(.*?)\]/) { "" }
  398.     text.gsub!(/\e[Hh]\[-1\]/) { "" }
  399.     text.gsub!(/\e[Hh]\[([0-9]+)\]/) { "" }
  400.     text.gsub!(/\e[Hh]/) { "" }
  401.     text.gsub!(/\e[Tt]\[-1\]/) { "" }
  402.     text.gsub!(/\e[Tt]\[-2\]/) { "" }
  403.     text.gsub!(/\e[Tt]\[-3\]/) { "" }
  404.     text.gsub!(/\e[Tt]\[([0-9]+)\]/) { "" }
  405.     text.gsub!(/\e[Tt]/) { "" }
  406.     # 制御文字処理
  407.     text.gsub!(/\e[Ss]\[([0-9]+)\]/i) { "" }
  408.     text.gsub!(/\e[Oo]\[([0-9]+)\]/i) { "" }
  409.     text.gsub!(/\elast_holder/i) { "" }
  410.     text.gsub!(/\elast_material/i) { "" }
  411.     #text.gsub!(/\eV/) { "" } #変数に置き換える。
  412.     #text.gsub!(/\eN/) { "" } #名前へ置き換える。
  413.     #text.gsub!(/\eP/) { "" } #名前へ置き換える。
  414.     #text.gsub!(/\eG/) { "" } #金額へ置き換える。
  415.     #text.gsub!(/\eC/) { "" }
  416.     text.gsub!(/\eB/) { "" }
  417.     text.gsub!(/\eD/) { "" }
  418.     if text =~ /\eI/
  419.       loop do
  420.         if str = text.sub!(/\eI\[(\d+)\]/){ "" }
  421.           add += 24
  422.         else
  423.           break
  424.         end
  425.       end
  426.     end
  427.     #text.gsub!(/\\n/) { "\n" }
  428.     text.sub!(/\ecenter/) {""}
  429.     text.sub!(/\eright/)  {""}
  430.     text.gsub!(/\ecenter/) {""}
  431.     text.gsub!(/\eright/) {""}
  432.  
  433.     text = xrxsv2_convert_escape_characters(text)
  434.     basic_width = text_size(text).width + add
  435.     esc = text.scan(/\e(\S)/)
  436.     return ( basic_width - esc.size * (contents.font.size - 4) ) #\eの幅は20?
  437.   end
  438.   #--------------------------------------------------------------------------
  439.   # ● 最も長い列の長さを調べる。エスケープ文字は含まない。
  440.   #--------------------------------------------------------------------------
  441.   def max_width
  442.     text_size = []
  443.     for i in 0 ... @all_texts.size
  444.       text_size.push text_width_no_escape(@all_texts[i],@all_texts[i]) + 20
  445.     end
  446.     return text_size.max
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # ● 吹きだしテールが上か下の場合の画像を準備。
  450.   #--------------------------------------------------------------------------
  451.   def create_tail_up_under
  452.     skin = "Window"
  453.     tale_pos = get_tale_pos
  454.     case @position
  455.     when 0  # 上
  456.       @tail.bitmap = Cache.system(skin + "-top")
  457.       @tail.x = tale_pos[0]
  458.       @tail.y = tale_pos[1]
  459.       @tail.z = self.z + 1
  460.     when 1  # 中
  461.       @tail.dispose
  462.       @tail = nil
  463.     when 2  # 下
  464.       @tail.bitmap = Cache.system(skin + "-under")
  465.       @tail.x = tale_pos[0]
  466.       @tail.y = tale_pos[1]
  467.       @tail.z = self.z + 1
  468.     end
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # ● 全テキストの処理
  472.   #--------------------------------------------------------------------------
  473.   def process_all_text
  474.     #open_and_wait #リサイズがあるので、すぐにウィンドウをオープンしない。
  475.     text = convert_escape_characters($game_message.all_text)
  476.     pos = {}
  477.     new_page(text, pos)
  478.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  479.   end
  480.   #--------------------------------------------------------------------------
  481.   # ● メッセージの更新 *
  482.   #--------------------------------------------------------------------------
  483.   def update_message
  484.     @wait_count = @type_wait
  485.     loop do
  486.       c = @text.slice!(/./m)
  487.       case update_message_type(c)
  488.       when 1
  489.         break
  490.       when 2
  491.         next
  492.       end
  493.       break unless @show_fast or @line_show_fast
  494.     end
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # 一文字の描画 (返り値 1:break, 2:next)
  498.   #--------------------------------------------------------------------------
  499. #=begin
  500.   def process_escape_character(code, text, pos)
  501.     case code.upcase
  502.     when '$'
  503.       @gold_window.open
  504.     when '.'
  505.       wait(15)
  506.     when '|'
  507.       wait(60)
  508.     when '!'
  509.       input_pause
  510.     when '>'
  511.       @line_show_fast = true
  512.     when '<'
  513.       @line_show_fast = false
  514.     when '^'
  515.       @pause_skip = true
  516.     #when 'n'                      # 改行
  517.     #  new_line
  518.     #  max = MAX_LINE
  519.     #  max = 14 if self.pop_character != nil
  520.     #  if @line_count >= max      # 行数が最大のとき
  521.     #    unless @text.empty?           # さらに続きがあるなら
  522.     #      self.pause = true           # 入力待ちを入れる
  523.           #return 1
  524.     #    end
  525.     #  end
  526.     #when 'S'                       # \S[n]  (スピード変更)
  527.     #  text.sub!(/\[([0-9]+)\]/, "")
  528.     #  @type_wait = $1.to_i
  529.     #  return 2
  530.     when 'O'                       # \O 文字を透明にする。
  531.       text.sub!(/\[([0-9]+)\]/, "")
  532.       contents.font.color.alpha = $1.to_i
  533.       #return 2
  534.     when 'D' #\D 文字に影をつける
  535.       contents.font.shadow ^= true
  536.     #when '18'
  537.     #  name = ($game_temp.last_gain_holder.name rescue "")
  538.     #  update_message_type_draw_at(name)
  539.     #when '19'
  540.     #  item = ($game_temp.last_gain_material.item rescue nil)
  541.     #  draw_item_name(item, @contents_x, @contents_y)
  542.     #  @contents_x += 196
  543.     else
  544.       super
  545.     end
  546.  
  547.   end
  548. #=end
  549.   #--------------------------------------------------------------------------
  550.   # ● 改ページ処理
  551.   #--------------------------------------------------------------------------
  552.   alias xrxsv2_new_page new_page
  553.   def new_page(text, pos)
  554.     xrxsv2_new_page(text, pos)
  555.     update_charpop_window
  556.   end
  557.   #--------------------------------------------------------------------------
  558.   # ● 改行位置の取得
  559.   #--------------------------------------------------------------------------
  560.   #def new_line_x
  561.   #  $game_message.face_name.empty? ? 0 : 112
  562.   #end
  563.   #--------------------------------------------------------------------------
  564.   # ● 改行処理
  565.   #--------------------------------------------------------------------------
  566.   alias xrxsv2_new_line_x new_line_x
  567.   def new_line
  568.     xrxsv2_new_line
  569.     set_align
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # 位置揃え
  573.   #--------------------------------------------------------------------------
  574.   def set_align
  575.     w = @line_widths[@line_count].to_i
  576.     a = @line_aligns[@line_count]
  577.     case a
  578.     when CENTER
  579.       @contents_x = @contents_x + ((contents.width - @contents_x) - w) / 2
  580.     when RIGHT
  581.       @contents_x = contents.width - w
  582.     end
  583.   end
  584.   #--------------------------------------------------------------------------
  585.   # ● ファイバーのメイン処理 ☆再定義
  586.   #--------------------------------------------------------------------------
  587.   def fiber_main
  588.     $game_message.visible = true
  589.     update_background
  590.     update_placement
  591.     loop do
  592.       process_all_text if $game_message.has_text?
  593.       process_input
  594.       $game_message.clear
  595.       @gold_window.close
  596.       process_hold #ホールドウィンドウの処理。
  597.       Fiber.yield
  598.       break unless text_continue?
  599.     end
  600.     close_and_wait
  601.     $game_message.visible = false
  602.     @fiber = nil
  603.   end
  604.   #--------------------------------------------------------------------------
  605.   # 定数
  606.   #--------------------------------------------------------------------------
  607.   AUTO   = 0
  608.   LEFT   = 1
  609.   CENTER = 2
  610.   RIGHT  = 3
  611. end
  612. #==============================================================================
  613. # アクティブイベント取得
  614. #==============================================================================
  615. class Game_Interpreter
  616.   attr_reader   :event_id
  617. end
  618.  
  619.  
  620. #==============================================================================
  621. # 各種機能の追加 - キャラポップ/ネーム/ホールド
  622. #==============================================================================
  623. class Window_Message < Window_Base
  624.   #--------------------------------------------------------------------------
  625.   # ● カーソルの更新 *
  626.   #--------------------------------------------------------------------------
  627.   def update_cursor
  628.     if @index >= 0
  629.       x = ($game_message.face_name.empty? ? 0 : 112)
  630.       y = ($game_message.choice_start + @index) * WLH - 1
  631.       w = contents.width - x
  632.       if self.pop_character != nil
  633.         x += 28
  634.         w -= 20
  635.       end
  636.       self.cursor_rect.set(x, y, w, WLH)
  637.     else
  638.       self.cursor_rect.empty
  639.     end
  640.   end
  641.   #--------------------------------------------------------------------------
  642.   # キャラクターの取得
  643.   #   parameter : パラメータ
  644.   #--------------------------------------------------------------------------
  645.   def get_character(parameter)
  646.     # パラメータで分岐
  647.     case parameter
  648.     when -1  # プレイヤー
  649.       return $game_player
  650.     when 0  # 現在アクティブなイベント
  651.       id = $game_map.interpreter.event_id
  652.       events = $game_map.events
  653.       return events == nil ? nil : events[id]
  654.     else  # 特定のイベント
  655.       events = $game_map.events
  656.       return events == nil ? nil : events[parameter]
  657.     end
  658.   end
  659.   #--------------------------------------------------------------------------
  660.   # (メッセージ終了時)ホールドの処理
  661.   #--------------------------------------------------------------------------
  662.   def process_hold
  663.     if @window_hold
  664.       @held_windows.push(Window_Copy.new(self))
  665.       @held_windows.push(Window_Copy.new(@name_window))
  666.       @held_windows.push(Sprite_Copy.new(@name_sprite))
  667.       @held_windows.push(Sprite_Copy.new(@back_sprite))
  668.       for sprite in @extra_sprites
  669.         next if sprite.disposed?
  670.         @held_windows.push(Sprite_Copy.new(sprite))
  671.       end
  672.       @extra_sprites.clear
  673.       self.openness = 0
  674.       #@name_window.openness = 0
  675.       @back_sprite.visible = false
  676.     else
  677.       @held_windows.each {|object| object.dispose}
  678.       @held_windows.clear
  679.     end
  680.     #@name_window.close
  681.     #@name_sprite.visible = false
  682.   end
  683.   #--------------------------------------------------------------------------
  684.   # キャラポップ位置の設定と取得
  685.   #--------------------------------------------------------------------------
  686.   def pop_character=(character_id)
  687.     @pop_character = character_id
  688.   end
  689.   def pop_character
  690.     return @pop_character
  691.   end
  692.   #--------------------------------------------------------------------------
  693.   # キャラポップ時のウィンドウリサイズ
  694.   #--------------------------------------------------------------------------
  695.   def reszie_window_for_pop
  696.     #キャラポップ
  697.     if self.pop_character != nil
  698.       #max_x = @line_widths.max.to_i
  699.       #n  = max_x + 32
  700.       n = 0
  701.       n += $game_message.face_name.empty? ? 0 : 122
  702.       m  = $game_message.face_name.empty? ? 0 : 96
  703.       w  = @name_sprite.bitmap.width
  704.       self.width  = max_width + n
  705.       self.height = [@all_texts.size * line_height, m].max + 32
  706.  
  707.       #システム用の一行目を表示しない。
  708.       if $system_line or $game_switches[SYSTEM_LINE]
  709.         self.height -= line_height
  710.       end
  711.  
  712.       create_contents
  713.       update_charpop_window
  714.     elsif @info_mode
  715.       @line_aligns[0] = CENTER
  716.       self.x = - 8
  717.       self.width = Graphics.width + 16
  718.       self.height = 56
  719.       create_contents
  720.     else
  721.       self.x = 0
  722.       self.width  = Graphics.width
  723.       self.height = MAX_LINE * line_height + 32
  724.       update_placement #位置情報修正。
  725.       create_contents
  726.     end
  727.   end
  728.   #--------------------------------------------------------------------------
  729.   # ● 背景スプライトの作成
  730.   #--------------------------------------------------------------------------
  731.   alias xrxsv2_create_back_sprite create_back_sprite
  732.   def create_back_sprite
  733.     xrxsv2_create_back_sprite
  734.     @back_sprite.zoom_x = 1.0 * Graphics.width / @back_sprite.bitmap.width
  735.     @name_window = Window_Base.new(0,0,112,36)
  736.     @name_window.visible = false
  737.     @name_sprite = Sprite.new
  738.     @name_sprite.bitmap = Bitmap.new(32,32)
  739.     @name_sprite.visible = false
  740.     self.x = self.x
  741.     self.y = self.y
  742.     self.z = self.z
  743.     @held_windows = []
  744.     @extra_sprites = []
  745.   end
  746.   #--------------------------------------------------------------------------
  747.   # ● 背景スプライトの解放
  748.   #--------------------------------------------------------------------------
  749.   alias xrxsv2_dispose_back_sprite dispose_back_sprite
  750.   def dispose_back_sprite
  751.     xrxsv2_dispose_back_sprite
  752.     @name_window.dispose if @name_window != nil #メニュー画面を出そうとするとエラー?
  753.     @name_sprite.dispose if @name_sprite != nil
  754.     for window in @held_windows
  755.       window.dispose
  756.     end
  757.   end
  758.   #--------------------------------------------------------------------------
  759.   # ● 背景スプライトの更新
  760.   #--------------------------------------------------------------------------
  761.   alias xrxsv2_update_back_sprite update_back_sprite
  762.   def update_back_sprite
  763.     @name_window.update
  764.     xrxsv2_update_back_sprite
  765.     update_charpop_window
  766.   end
  767.   #--------------------------------------------------------------------------
  768.   # ウィンドウの位置と不透明度の設定 (キャラポップ)
  769.   #--------------------------------------------------------------------------
  770.   def update_charpop_window
  771.     if self.pop_character
  772.       character = get_character(self.pop_character)
  773.       return if character == nil
  774.       # [X座標]
  775.       n = self.width / 2
  776.       n = [n, @name_skin.width + 16].max if @current_name != nil
  777.       w = @name_sprite.bitmap.width
  778.       x = character.screen_x - [[n, w].max, self.width - 32].min
  779.       # [Y座標]
  780.       if self.pop_character == 0 and POP_DIRECTION #イベントの方向を考慮。
  781.         if character.direction == 2 #下向き
  782.           @position = 0 #上にポップ
  783.         elsif character.direction == 8 #上向き
  784.           @position = 2 #下にポップ
  785.         end
  786.       end
  787.       case @position
  788.       when 0
  789.         y = character.screen_y - CHARPOP_HEIGHT - self.height
  790.       else
  791.         y = character.screen_y + 16
  792.       end
  793.       x_max = Graphics.width - 4 - self.width
  794.       x_min = 4
  795.       y_max = Graphics.height - self.height
  796.       y_min = 4
  797.       self.x = [[x, x_max].min, x_min].max
  798.       self.y = [[y, y_max].min, y_min].max
  799.     end
  800.   end
  801.   #--------------------------------------------------------------------------
  802.   # 位置の連動
  803.   #--------------------------------------------------------------------------
  804.   def x=(n)
  805.     super
  806.     if @name_window
  807.       if $name_right
  808.         @name_window.x = n + self.width - @name_window.width - NAME_WINDOW_OFFSET_X
  809.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  810.       else
  811.         @name_window.x = n + NAME_WINDOW_OFFSET_X
  812.         @name_sprite.x = @name_window.x + 8 + NAME_WINDOW_OFFSET_WIDTH / 2
  813.       end
  814.     end
  815.   end
  816.   def y=(n)
  817.     super
  818.     if @name_window
  819.       @name_window.y = n + NAME_WINDOW_OFFSET_Y
  820.       @name_sprite.y = n + NAME_WINDOW_OFFSET_Y + 2 + NAME_WINDOW_OFFSET_HIGHT / 2
  821.     end
  822.   end
  823.   def z=(n)
  824.     super
  825.     if @name_window
  826.       @name_window.z = n + 11#1 テールの上に表示されるので、Zを水増しする。
  827.       @name_sprite.z = n + 12#2
  828.     end
  829.   end
  830.   #--------------------------------------------------------------------------
  831.   # ● ファイバーのメイン処理
  832.   #--------------------------------------------------------------------------
  833.   def fiber_main_namewin
  834.     fiber_main_namewin_default
  835.     @name_window.openness = 0
  836.     @name_sprite.bitmap.clear
  837.     $name = ""
  838.   end
  839.   alias :fiber_main_namewin_default :fiber_main
  840.   alias :fiber_main :fiber_main_namewin
  841. end
  842. #==============================================================================
  843. # 伸縮対応
  844. #==============================================================================
  845. class Window_Message < Window_Base
  846.   #--------------------------------------------------------------------------
  847.   # ● ウィンドウの背景と位置の設定 [再定義]
  848.   #--------------------------------------------------------------------------
  849.   def reset_window
  850.     @background = $game_message.background
  851.     @position = $game_message.position
  852.     if @background == 0   # 通常ウィンドウ
  853.       self.opacity = 255
  854.     else                  # 背景を暗くする、透明にする
  855.       self.opacity = 0
  856.     end
  857.     case @position
  858.     when 0  # 上
  859.       self.y = 0
  860.       @gold_window.y = 360
  861.     when 1  # 中
  862.       self.y = (Graphics.height - self.height) / 2
  863.       @gold_window.y = 0
  864.     when 2  # 下
  865.       self.y = Graphics.height - self.height
  866.       @gold_window.y = 0
  867.     end
  868.   end
  869. end
  870. #==============================================================================
  871. # □ Window_Copy
  872. #------------------------------------------------------------------------------
  873. #   指定のウィンドウのコピーを作成します。
  874. #==============================================================================
  875. class Window_Copy < Window_Base
  876.   #--------------------------------------------------------------------------
  877.   # ○ オブジェクト初期化
  878.   #--------------------------------------------------------------------------
  879.   def initialize(window)
  880.     super(window.x, window.y, window.width, window.height)
  881.     self.contents = window.contents.dup unless window.contents.nil?
  882.     self.opacity = window.opacity
  883.     self.back_opacity = window.back_opacity
  884.     self.z = window.z - 3
  885.     self.visible = window.visible
  886.   end
  887. end
  888. #==============================================================================
  889. # □ Sprite_Copy
  890. #------------------------------------------------------------------------------
  891. #   指定のスプライトのコピーを作成します。
  892. #==============================================================================
  893. class Sprite_Copy < Sprite
  894.   #--------------------------------------------------------------------------
  895.   # ○ オブジェクト初期化
  896.   #--------------------------------------------------------------------------
  897.   def initialize(sprite)
  898.     super()
  899.     self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
  900.     self.opacity = sprite.opacity
  901.     self.x = sprite.x
  902.     self.y = sprite.y
  903.     self.z = sprite.z - 3
  904.     self.ox = sprite.ox
  905.     self.oy = sprite.oy
  906.     self.zoom_x = sprite.zoom_x
  907.     self.visible = sprite.visible
  908.   end
  909. end
  910.  
  911.  
  912.  
  913. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  914. #■吹きだしテールの表示ルーチン。
  915. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  916. #==============================================================================
  917. # +++ 「+ふきだし表示」VX +++
  918. # by パラ犬  [url]http://2d6.parasite.jp/[/url]
  919. #      ×
  920. #    row       [url]http://xms.rdy.jp/[/url]
  921. #
  922. # publish 2010/ 3/ 2
  923. # update  -
  924. #
  925. #------------------------------------------------------------------------------
  926. #    ほぼどんなメッセージウィンドウに対しても後付け可能な「ふきだし表示」です。
  927. #  また、テール部分のみの自動追尾機能を持ちます。
  928. #   ふきだし表示をするには、
  929. #  テール用画像「Window-top」「Window-under」を
  930. #  「Graphics/System」フォルダにインポートしておく必要があります。
  931. #==============================================================================
  932. # ■ Window_Message
  933. #==============================================================================
  934. class Window_Message < Window_Base
  935.   #--------------------------------------------------------------------------
  936.   # ● メッセージの開始
  937.   #--------------------------------------------------------------------------
  938.   alias parashelf_update_all_windows update_all_windows
  939.   def update_all_windows
  940.     parashelf_update_all_windows
  941.     update_tail
  942.   end
  943.   #--------------------------------------------------------------------------
  944.   # クローズ [オーバーライド]
  945.   #--------------------------------------------------------------------------
  946.   def close
  947.     super
  948.     del_tail
  949.     @name_window.close if @name_window != nil #ネームウィンドウのクローズ動作。
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● 背景スプライトの更新
  953.   #--------------------------------------------------------------------------
  954.   alias parashelf_update_back_sprite update_back_sprite
  955.   def update_back_sprite
  956.     parashelf_update_back_sprite
  957.     update_tail
  958.   end
  959.   #--------------------------------------------------------------------------
  960.   # ○ フレーム更新 (ふきだしテールの更新)
  961.   #--------------------------------------------------------------------------
  962.   def update_tail
  963.     # ふきだしモードではイベントの動きに追従
  964.     if $mes_id != nil and @tail != nil
  965.       tale_pos = get_tale_pos
  966.       @tail.x = tale_pos[0]
  967.       @tail.y = tale_pos[1]
  968.       update_tail_bitmap
  969.     end
  970.   end
  971.   ##--------------------------------------------------------------------------
  972.   # ○ ふきだしテールの画像を更新。
  973.   #--------------------------------------------------------------------------
  974.   def update_tail_bitmap
  975.     skin = "Window"
  976.     skin = "Think" if $game_switches[THINK_TAIL]
  977.     if $win_x != nil
  978.       if $win_x > 0
  979.         @tail.bitmap = Cache.system(skin + "-right")
  980.       elsif  $win_x < 0
  981.         @tail.bitmap = Cache.system(skin + "-left")
  982.       else
  983.         case @position
  984.         when 0  # 上
  985.           @tail.bitmap = Cache.system(skin + "-top")
  986.         when 2  # 下
  987.           @tail.bitmap = Cache.system(skin + "-under")
  988.         end
  989.       end
  990.     else
  991.       case @position
  992.       when 0  # 上
  993.         @tail.bitmap = Cache.system(skin + "-top")
  994.       when 2  # 下
  995.         @tail.bitmap = Cache.system(skin + "-under")
  996.       end
  997.     end
  998.     # 可視状態
  999.     if self.visible == true
  1000.       @tail.visible = self.openness == 255
  1001.     else
  1002.       @tail.visible = false
  1003.     end
  1004.   end
  1005.   #--------------------------------------------------------------------------
  1006.   # ○ テールの位置を計算
  1007.   #--------------------------------------------------------------------------
  1008.   def get_tale_pos
  1009.     if defined?($game_system.show_stand_picture) #A1立ち絵スクリプトを入れている。
  1010.       if $game_system.show_stand_picture #立ち絵on
  1011.         pos = get_tale_pos_stand_pic
  1012.       else
  1013.         pos = get_tale_pos_normal
  1014.       end
  1015.     else
  1016.       pos = get_tale_pos_normal
  1017.     end
  1018.     return pos
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # ○ テールの位置を計算/立ち絵使用時。※NAME_CHANGEの編集必須。
  1022.   #--------------------------------------------------------------------------
  1023.   def get_tale_pos_stand_pic
  1024.     if $game_message.face_name != ""  and @tail != nil
  1025.       name = A1_System::StandPicture::NAME_CHANGE[$game_message.face_name]
  1026.       chara = name[$game_message.face_index][0]
  1027.       if @stand_pic[chara] != nil #立ち絵無しの場合通常通り。
  1028.         x = @stand_pic[chara].pic_sprite.x + @stand_pic[chara].pic_sprite.width / 2
  1029.         y = get_tale_pos_normal_updown
  1030.         update_tail_bitmap
  1031.       else
  1032.         return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  1033.       end
  1034.     else
  1035.       return get_tale_pos_normal #立ち絵が見つからない場合は通常通り。
  1036.     end
  1037.     return [x,y]
  1038.   end
  1039.   #--------------------------------------------------------------------------
  1040.   # ○ テールの位置を計算/立ち絵未使用時。
  1041.   #--------------------------------------------------------------------------
  1042.   def get_tale_pos_normal
  1043.     if $mes_id == (-2) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1044.       if $win_x != nil
  1045.         if $win_x > 0
  1046.           x = $win_x - @tail.width / 2
  1047.           y = self.y + self.height / 2 - @tail.height / 2
  1048.         elsif $win_x < 0
  1049.           x = self.width - @tail.width / 2
  1050.           y = self.y + self.height / 2 - @tail.height / 2
  1051.         else
  1052.           x = MINAS_TWE_X_POS
  1053.           y = get_tale_pos_normal_updown
  1054.         end
  1055.       else
  1056.         x = MINAS_TWE_X_POS
  1057.         y = get_tale_pos_normal_updown
  1058.       end
  1059.     elsif $mes_id <= (-3) #左右の場合は高さはウィンドウ中心。上下ならやや左に配置。
  1060.       if $win_x != nil
  1061.         if $win_x > 0
  1062.           x = $win_x - @tail.width / 2
  1063.           y = self.y + self.height / 2
  1064.         elsif $win_x < 0
  1065.           x = self.width - @tail.width / 2
  1066.           y = self.y + self.height / 2
  1067.         else
  1068.           x = MINAS_THREE_X_POS
  1069.           y = get_tale_pos_normal_updown
  1070.         end
  1071.       else
  1072.         x = MINAS_THREE_X_POS
  1073.         y = get_tale_pos_normal_updown
  1074.       end
  1075.     else
  1076.       character = get_character($mes_id)
  1077.       x = [[character.screen_x - 16, self.x].max, self.x + self.width - 32].min
  1078.       if $win_x != nil
  1079.         if $win_x > 0
  1080.           x = $win_x - @tail.width / 2
  1081.           y = character.screen_y
  1082.         elsif $win_x < 0
  1083.           x = self.width
  1084.           y = character.screen_y
  1085.         else
  1086.           y = get_tale_pos_normal_updown
  1087.         end
  1088.       else
  1089.         y = get_tale_pos_normal_updown
  1090.       end
  1091.     end
  1092.     return [x, y]
  1093.   end
  1094.   #--------------------------------------------------------------------------
  1095.   # ○ テールが上下の時、かつ[-2][-3]でない時のy座標の取得。
  1096.   #--------------------------------------------------------------------------
  1097.   def get_tale_pos_normal_updown
  1098.     case @position
  1099.     when 0
  1100.       y = self.y + self.height - @tail.height / 2
  1101.     else
  1102.       y = self.y - @tail.height / 2
  1103.     end
  1104.     return y
  1105.   end
  1106.   #--------------------------------------------------------------------------
  1107.   # ○ ふきだしを破棄
  1108.   #--------------------------------------------------------------------------
  1109.   def del_tail
  1110.     if @tail != nil
  1111.       @tail.dispose
  1112.       @tail = nil
  1113.     end
  1114.   end
  1115. end
  1116. #
  1117. # ▼▲▼ XRXS 9拡張CO-X. ふきだし自動設定 ▼▲▼
  1118. #==============================================================================
  1119. # ■ Window_Message
  1120. #==============================================================================
  1121. class Window_Message < Window_Base
  1122.   #--------------------------------------------------------------------------
  1123.   # ○ ポップキャラクターの設定
  1124.   #--------------------------------------------------------------------------
  1125.   def pop_character=(character_id)
  1126.     @pop_character = character_id
  1127.     $mes_id = character_id
  1128.   end
  1129.   #--------------------------------------------------------------------------
  1130.   # ○ テールキャラクターの設定
  1131.   #--------------------------------------------------------------------------
  1132.   def tail_character=(character_id)
  1133.     #@pop_character = character_id
  1134.     $mes_id = character_id
  1135.   end
  1136. end
  1137.  
  1138.  
  1139. #==============================================================================
  1140. # ■ Window_ChoiceList
  1141. #------------------------------------------------------------------------------
  1142. #  イベントコマンド[選択肢の表示]で、Y座標を修正します。
  1143. #==============================================================================
  1144. class Window_ChoiceList < Window_Command
  1145.   #--------------------------------------------------------------------------
  1146.   # ● ウィンドウ位置の更新
  1147.   #--------------------------------------------------------------------------
  1148.   def update_placement_hukidasi
  1149.     #self.width = [max_choice_width + 12, 96].max + padding * 2
  1150.     #self.width = [width, Graphics.width].min
  1151.     #self.height = fitting_height($game_message.choices.size)
  1152.     #self.x = Graphics.width - width
  1153.     #if @message_window.y >= Graphics.height / 2
  1154.     #  self.y = @message_window.y - height
  1155.     #else
  1156.     #  self.y = @message_window.y + @message_window.height
  1157.     #end
  1158.     update_placement_hukidasi_default
  1159.     if self.y + self.height > Graphics.height
  1160.       self.y -= ( ( self.height + self.y ) - Graphics.height)
  1161.       self.z += 100
  1162.     end
  1163.   end
  1164.   alias :update_placement_hukidasi_default :update_placement
  1165.   alias :update_placement :update_placement_hukidasi
  1166. end
  1167.  
  1168. #==============================================================================
  1169. # ■ Scene_Menu
  1170. #------------------------------------------------------------------------------
  1171. #  メニューを開いてからウィンドウが出るとネームウィンドウが表示される不具合修正。
  1172. #==============================================================================
  1173. #class Scene_Menu < Scene_MenuBase
  1174. #  def terminate_hukidasi_menyu
  1175. #    @name_window.openness = 0 if @name_window != nil
  1176. #    terminate_hukidasi_menyu_default
  1177. #  end
  1178. #  alias :terminate_hukidasi_menyu_default :terminate
  1179. #  alias :terminate :terminate_hukidasi_menyu
  1180. #end
  1181.  
  1182. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1183. #■ウィンドウ非表示ルーチン
  1184. #■吹きだしテールとネームウィンドウに対応。
  1185. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1186. #==============================================================================
  1187. # L(キーボードのQ)を押すと、メッセージウィンドウを表示・非表示
  1188. #==============================================================================
  1189. class Window_Message < Window_Base
  1190.   def update_winoff
  1191.     unless $game_party.in_battle #バトル中は無効。
  1192.       if Input.trigger?(Input::L)
  1193.         if self.visible == true
  1194.           self.visible = false
  1195.           @background = 777 if @back_sprite != nil and @background == 1 #「背景を暗くする」
  1196.           @tail.visible = false if @tail != nil
  1197.         else
  1198.           self.visible = true
  1199.           @background = 1 if @back_sprite != nil and @background == 777 #「背景を暗くする」
  1200.         end
  1201.         if @name_window != nil
  1202.           if @name_window.visible == false and $name != nil and $name != ""
  1203.             @name_window.visible = true
  1204.             @name_sprite.visible = true
  1205.           else
  1206.             @name_window.visible = false
  1207.             @name_sprite.visible = false
  1208.           end
  1209.         end
  1210.       elsif Input.trigger?(Input::C) or Input.trigger?(Input::B)
  1211.         if self.visible == false
  1212.           self.visible = true
  1213.           @back_sprite.visible = true unless @back_sprite
  1214.         end
  1215.         @tail.visible = true if @tail != nil and @tail.visible == false
  1216.         if @name_window != nil and $name != nil
  1217.           if $name != ""
  1218.             @name_window.visible = true
  1219.             @name_sprite.visible = true
  1220.           end
  1221.         end
  1222.       end
  1223.     end
  1224.     update_winoff_default
  1225.   end
  1226.   alias :update_winoff_default :update
  1227.   alias :update :update_winoff
  1228. end
  1229.  
  1230.  
  1231. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1232. #■ウィンドウ表示位置指定ルーチン
  1233. #■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□
  1234. #===========================================================================
  1235. #イベントコマンド「スクリプト」を使い、
  1236. #$win_x=100 
  1237. #$win_y=100
  1238. #と入力すれば、ウィンドウを(100、100)の位置に表示します。
  1239. #使わない時は
  1240. #$win_x=nil
  1241. #などとnilを入力しておいてください。
  1242. #===========================================================================
  1243. class Window_Message < Window_Base
  1244.   #--------------------------------------------------------------------------
  1245.   # ● ウィンドウの背景と位置の設定 [再定義]
  1246.   #--------------------------------------------------------------------------
  1247.   def update_placement_position
  1248.     update_placement_position_default
  1249.     if $win_x != nil
  1250.       if $win_x > 0
  1251.         self.x = $win_x
  1252.         self.width -= $win_x
  1253.       else
  1254.         self.x = 0
  1255.         self.width += $win_x
  1256.       end
  1257.     end
  1258.     if $win_y != nil
  1259.       self.y = $win_y
  1260.     end
  1261.     #上表示の時、ネームウィンドウが見切れるので少し下にずらす。
  1262.     if self.y == 0 and @position == 0 and @name_window != nil and $name != nil
  1263.       self.y += (-NAME_WINDOW_OFFSET_Y)
  1264.     end
  1265.   end
  1266.   alias_method :update_placement_position_default, :update_placement
  1267.   alias_method :update_placement, :update_placement_position
  1268. end
  1269.  
  1270.  
  1271. #==============================================================================
  1272. # ■ SceneManager
  1273. #------------------------------------------------------------------------------
  1274. #  シーン遷移のさい、テールを破棄。ネームウィンドウのデータをクリア。
  1275. #==============================================================================
  1276. module SceneManager
  1277.   #--------------------------------------------------------------------------
  1278.   # ● 呼び出し
  1279.   #--------------------------------------------------------------------------
  1280.   def self.call_sceman_hukidasi(scene_class)
  1281.     if defined?(self.scene.message_window)
  1282.       self.scene.message_window.del_tail if self.scene.message_window.tail != nil
  1283.       $name = ""
  1284.     end
  1285.     @stack.push(@scene)
  1286.     [url=home.php?mod=space&uid=420706]@Scene[/url] = scene_class.new
  1287.   end
  1288.   #--------------------------------------------------------------------------
  1289.   # ● クラスメソッドのエイリアス
  1290.   #--------------------------------------------------------------------------
  1291.   class << self
  1292.     alias :call_sceman_hukidasi_default :call
  1293.     alias :call :call_sceman_hukidasi
  1294.   end
  1295. end
  1296.  
  1297. #==============================================================================
  1298. # ■ Scene_Map
  1299. #------------------------------------------------------------------------------
  1300. #  戦闘トランジションのさい、テールを破棄。
  1301. #==============================================================================
  1302. class Scene_Map < Scene_Base
  1303.   attr_accessor :message_window
  1304.   #--------------------------------------------------------------------------
  1305.   # ● 戦闘前トランジション実行
  1306.   #--------------------------------------------------------------------------
  1307.   def perform_battle_transition_hukidasi
  1308.     @message_window.del_tail #テールの破棄
  1309.     perform_battle_transition_hukidasi_default
  1310.   end
  1311.   alias_method :perform_battle_transition_hukidasi_default, :perform_battle_transition
  1312.   alias_method :perform_battle_transition, :perform_battle_transition_hukidasi
  1313. end
  

点评

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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
3
 楼主| 发表于 2014-7-17 17:55:50 | 只看该作者
急用 不好意思
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

无限の剣制

梦石
0
星屑
10073
在线时间
5020 小时
注册时间
2013-2-28
帖子
5030

开拓者贵宾

4
发表于 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 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
210 小时
注册时间
2013-7-26
帖子
346
5
 楼主| 发表于 2014-7-18 20:10:48 | 只看该作者

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

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

点评

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-25 19:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表