Project1

标题: 地图名显示脚本与漫画对话脚本的冲突 [打印本页]

作者: 落雪鸦杀    时间: 2015-8-29 10:29
标题: 地图名显示脚本与漫画对话脚本的冲突
本帖最后由 落雪鸦杀 于 2015-8-29 11:05 编辑


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

上方是对话脚本
下方是地图名美化脚本
RUBY 代码复制
  1. # encoding: utf-8
  2. #==============================================================================
  3. # ** Window_MapNamePlus
  4. #------------------------------------------------------------------------------
  5. #  This window displays the map name.
  6. #------------------------------------------------------------------------------
  7. #使用方法:
  8. #新建脚本页,复制粘贴
  9. #在“Scene_Map”中找到“Window_MapName.new”,改成"Window_MapNamePlus.new"(大概在
  10. #159行左右)
  11. #在地图属性的设置窗口,“显示名称”中的地图名格式:“中文名@EnglishName”,即用“@”分割中文
  12. #和英文地图名
  13. #
  14. #脚本 by Majirefy
  15. #==============================================================================
  16.  
  17. class Window_MapNamePlus < Window_Base
  18.   #--------------------------------------------------------------------------
  19.   # * Settings
  20.   #--------------------------------------------------------------------------
  21.   FONT_NAME_CH = ["PMingLiU", "FangSong"]       # Chinese Font Name
  22.   FONT_SIZE_CH = 42                             # Chinese Font Size
  23.   FONT_NAME_EN = ["Monotype Corsiva"]           # English Font Name
  24.   FONT_SIZE_EN = 28                             # English Font Size
  25.   FONT_BOLD    = false                          # True if Font in Bold
  26.   FONT_COLOR   = Color.new(255, 255, 255, 255)  # Color of Font
  27.   FONT_OUT     = true                           # True if Font Has Outline
  28.   OUT_COLOR    = Color.new(0, 0, 0, 200)        # Color of Outline Color of Font
  29.   FONT_SHADOW  = false                          # True if Text Drops Shadow
  30.   MODIFIER     = "~"                            # Modifier Added beside Map Name
  31.   PADDING      = 8                              # Padding between Window's Frame and Contents
  32.   LINE_HEIGHT  = 6                              # Height of Split Line
  33.   #--------------------------------------------------------------------------
  34.   # * Public Instance Variables
  35.   #--------------------------------------------------------------------------
  36.   attr_reader :map_name_ch                      # Chinese Map Name
  37.   attr_reader :map_name_en                      # English Map Name
  38.   attr_reader :line_x                           # Split Line X Coordinate
  39.   attr_reader :line_y                           # Split Line Y Coordinate
  40.   #--------------------------------------------------------------------------
  41.   # * Object Initialization
  42.   #--------------------------------------------------------------------------
  43.   def initialize
  44.     #----------------------------------------------------------------------
  45.     # * Set the window in the middle of screen.
  46.     #----------------------------------------------------------------------
  47.     super(((Graphics.width - window_width) / 2),
  48.       ((Graphics.height - (FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)) / 2),
  49.       window_width, FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)
  50.     #----------------------------------------------------------------------
  51.     # * Custom font and style.
  52.     #----------------------------------------------------------------------
  53.     contents.font.bold      = FONT_BOLD
  54.     contents.font.color     = FONT_COLOR
  55.     contents.font.outline   = FONT_OUT
  56.     contents.font.out_color = OUT_COLOR
  57.     contents.font.shadow    = FONT_SHADOW
  58.     #----------------------------------------------------------------------
  59.     # * Set Window Opacity
  60.     #----------------------------------------------------------------------
  61.     self.opacity = 0
  62.     self.contents_opacity = 0
  63.     @show_count = 0
  64.     refresh
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # * Get Window Width
  68.   #--------------------------------------------------------------------------
  69.   def window_width
  70.     return Graphics.width
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # * Frame Update
  74.   #--------------------------------------------------------------------------
  75.   def update
  76.     super
  77.     if @show_count > 0 && $game_map.name_display
  78.       update_fadein
  79.       @show_count -= 1
  80.     else
  81.       update_fadeout
  82.     end
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # * Update Fadein
  86.   #--------------------------------------------------------------------------
  87.   def update_fadein
  88.     self.contents_opacity += 16
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # * Update Fadeout
  92.   #--------------------------------------------------------------------------
  93.   def update_fadeout
  94.     self.contents_opacity -= 16
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # * Open Window
  98.   #--------------------------------------------------------------------------
  99.   def open
  100.     refresh
  101.     @show_count = 150
  102.     self.contents_opacity = 0
  103.     self
  104.   end
  105.   #--------------------------------------------------------------------------
  106.   # * Close Window
  107.   #--------------------------------------------------------------------------
  108.   def close
  109.     @show_count = 0
  110.     self
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # * Refresh
  114.   #--------------------------------------------------------------------------
  115.   def refresh
  116.     contents.clear
  117.     set_map_name
  118.     unless $game_map.display_name.empty?
  119.       draw_map_name
  120.     end
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # * Draw Line
  124.   #--------------------------------------------------------------------------
  125.   def draw_line(rect)
  126.     temp_rect = rect.clone
  127.     temp_rect.height = LINE_HEIGHT
  128.     temp_rect.width /= 4
  129.     contents.gradient_fill_rect(temp_rect, color2, color1)
  130.     temp_rect.x += temp_rect.width
  131.     temp_rect.width *= 2
  132.     contents.fill_rect(temp_rect, color1)
  133.     temp_rect.x += temp_rect.width
  134.     temp_rect.width /= 2
  135.     contents.gradient_fill_rect(temp_rect, color1, color2)
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # * Set Map Name
  139.   #--------------------------------------------------------------------------
  140.   def set_map_name
  141.     temp_map_name = $game_map.display_name.split("@")
  142.     @map_name_ch  = temp_map_name[0].to_s
  143.     @map_name_en  = MODIFIER + " " + temp_map_name[1].to_s + " " + MODIFIER
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # * Draw Map Name
  147.   #--------------------------------------------------------------------------
  148.   def draw_map_name
  149.     set_line_position
  150.     set_line_width
  151.     temp_line_rect = Rect.new(@line_x, @line_y, set_line_width, LINE_HEIGHT)
  152.     draw_line(temp_line_rect)
  153.     temp_name_rect_ch = Rect.new(0, 0, contents.width, FONT_SIZE_CH)
  154.     contents.font.name = FONT_NAME_CH
  155.     contents.font.size = FONT_SIZE_CH
  156.     draw_text(temp_name_rect_ch, @map_name_ch, 1)
  157.     temp_name_rect_en = Rect.new(0, FONT_SIZE_CH, contents.width, FONT_SIZE_EN)
  158.     contents.font.size = FONT_SIZE_EN
  159.     contents.font.name = FONT_NAME_EN
  160.     draw_text(temp_name_rect_en, @map_name_en, 1)
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # * Set Line Width
  164.   #--------------------------------------------------------------------------
  165.   def set_line_width
  166.     text_width_ch = text_size(@map_name_ch).width * 1.5
  167.     text_width_en = text_size(@map_name_en).width * 1.5
  168.     (text_width_ch >= text_width_en) ?
  169.       (text_width_ch) : (text_width_en)
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # * Set Line Position
  173.   #--------------------------------------------------------------------------
  174.   def set_line_position
  175.     @line_x = (contents.width - set_line_width) / 2
  176.     @line_y = (contents.height - LINE_HEIGHT) / 2
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # * Get Color 1
  180.   #--------------------------------------------------------------------------
  181.   def color1
  182.     Color.new(255, 255, 255, 255)
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # * Get Color 2
  186.   #--------------------------------------------------------------------------
  187.   def color2
  188.     Color.new(255, 255, 255, 0)
  189.   end
  190. end
  
作者: 御之嵐    时间: 2015-8-29 11:00
我也有用這兩個腳本
沒有衝突的問題噢

順帶一提
我沒看到圖
作者: wangyanzhe6    时间: 2015-8-29 11:29
事件问题,检查一下事件
作者: 御之嵐    时间: 2015-8-29 18:20
本帖最后由 御之嵐 于 2015-8-29 18:21 编辑

只有使用
對話腳本、地圖名顯示美化腳本

對話只用 \h[1] 指定給 事件ID1
並列執行



使用結果:正常



==============================

但是你的問題
還真的是蠻詭異的_(:з」∠)_

能確定的是 他跟地圖名美化腳本
沒有衝突ლ(・ω・ლ)
作者: 落雪鸦杀    时间: 2015-8-29 20:24

@御之嵐
事件设置如上图
先不说有打错的地方,那条唯一对的而且运用脚本的那个没有显示。。。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1