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

Project1

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

[已经过期] 有没有对话框脚本能显示多张图片?

[复制链接]

Lv4.逐梦者

梦石
10
星屑
5618
在线时间
1849 小时
注册时间
2013-2-14
帖子
395

开拓者

跳转到指定楼层
1
发表于 2014-3-22 16:57:54 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
事情是这样的,我用的素材图是这种分表情的组合型头像。


用对话框脚本时他只能显示一张,有没有可以显示多张图片的脚本?

点评

你的对话框脚本要放出来才能改哦  发表于 2014-3-22 18:37

Lv4.逐梦者

梦石
10
星屑
5618
在线时间
1849 小时
注册时间
2013-2-14
帖子
395

开拓者

2
 楼主| 发表于 2014-3-22 19:07:13 | 只看该作者
本帖最后由 hijl1990 于 2014-3-22 19:13 编辑

@正太君 脚本是这个,你看下。。
因为感觉这些对话框脚本都差不多,你用别的脚本修改也可以。。
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. #——说明

  5. #默认为一个字一个字的方式,如果需要一次全部显示,
  6. #请在游戏中使用脚本:$game_system.typing = true
  7.       
  8. #默认对话字没有声音,如果需要声音,
  9. #请在游戏中使用脚本:$game_system.soundname_on_speak = "这里输入文件名"
  10.   #我唯一一个见过“胡乱配音”的游戏是天使帝国2代,该游戏说话的时候每个字符随机发一个外星语音

  11. # 其他在对话中可以使用的功能:
  12.   
  13. # \n[1]:显示1号角色的姓名

  14. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
  15. # \nn[1]:显示一个“1号人物”方框,表示说话人姓名

  16. # \p[1]:对话框出现在1号事件的上方
  17. # \p[0]:主人公上方出现对话框
  18. #——————————————————使用\p功能后可以自动调整对话框大小

  19. # \\:显示"\"这个符号

  20. # \v[1] :显示变量1

  21. # \v[a1] :显示防具1

  22. # \v[w1] :显示武器1

  23. # \v[i1] :显示物品1

  24. # \v[s1] :显示特技1

  25. # \c[1-8]:更改颜色

  26. # \g:显示金钱窗口

  27. # \a[SE文件名]:对话的时候播放SE

  28. # \s[1-19]:更改弹字的速度

  29. # \.   :停顿一刹那(1、2帧)
  30. # \|   :停顿片刻(20帧)

  31. # \>   :文字不用打字方式
  32. # \<   :文字使用打字方式

  33. # \!   :等待玩家按回车再继续
  34. # \~   :文字直接消失

  35. # \I   :下一行从这个位置开始

  36. # \o[123]:文字透明度改为123,模拟将死之人(汗)

  37. # \h[12]:改用12号字

  38. # \b[50]:空50象素

  39. # \K[今天天气不错]:在出现“今天天气不错”这几个字的时候播放$game_system.soundname_on_speak设置的音效

  40. # \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
  41. # \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”

  42. # \Lk:清除左边的图像
  43. # \Rk:清除右边的图像

  44. #==============================================================================
  45. # ■ Game_System
  46. #------------------------------------------------------------------------------
  47. #  处理系统附属数据的类。也可执行诸如 BGM 管理之类的功能。本类的实例请参考
  48. # $game_system 。
  49. #==============================================================================

  50. class Game_System
  51.   attr_accessor :typing
  52.   attr_accessor :soundname_on_speak
  53.   alias carol3_ini initialize
  54.   def initialize
  55.     carol3_ini
  56.     @typing = true
  57.     @soundname_on_speak = nil
  58.   end
  59. end
  60. $加密 = true
  61. #==============================================================================
  62. # ■ Window_Message
  63. #------------------------------------------------------------------------------
  64. class Window_Message < Window_Selectable
  65.   #--------------------------------------------------------------------------
  66.   # ● 初始化状态
  67.   #--------------------------------------------------------------------------
  68.   def initialize
  69.     super(120, 344, 520, 200)
  70.     self.contents = Bitmap.new(width - 32, height - 32)
  71.     self.visible = false
  72.     self.z = 9998
  73.     @fade_in = false
  74.     @fade_out = false
  75.     @contents_showing = false
  76.     @cursor_width = 0
  77.     self.active = false
  78.     self.index = -1
  79.     if $game_system.soundname_on_speak == nil then
  80.       $game_system.soundname_on_speak = ""
  81.     end
  82.     @opacity_text_buf = Bitmap.new(32, 32)
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 释放
  86.   #--------------------------------------------------------------------------
  87.   def dispose
  88.     terminate_message
  89.     $game_temp.message_window_showing = false
  90.     if @input_number_window != nil
  91.       @input_number_window.dispose
  92.     end
  93.     super
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 处理信息结束
  97.   #--------------------------------------------------------------------------
  98.   def terminate_message
  99.     self.active = false
  100.     self.pause = false
  101.     self.index = -1
  102.     self.contents.clear
  103.     # 清除显示中标志
  104.     @contents_showing = false
  105.     # 呼叫信息调用
  106.     if $game_temp.message_proc != nil
  107.       $game_temp.message_proc.call
  108.     end
  109.     # 清除文章、选择项、输入数值的相关变量
  110.     $game_temp.message_text = nil
  111.     $game_temp.message_proc = nil
  112.     $game_temp.choice_start = 99
  113.     $game_temp.choice_max = 0
  114.     $game_temp.choice_cancel_type = 0
  115.     $game_temp.choice_proc = nil
  116.     $game_temp.num_input_start = 99
  117.     $game_temp.num_input_variable_id = 0
  118.     $game_temp.num_input_digits_max = 0
  119.     # 开放金钱窗口
  120.     if @gold_window != nil
  121.       @gold_window.dispose
  122.       @gold_window = nil
  123.     end
  124.     if @name_window_frame != nil
  125.       @name_window_frame.dispose
  126.       @name_window_frame = nil
  127.     end
  128.     if @name_window_text != nil
  129.       @name_window_text.dispose
  130.       @name_window_text = nil
  131.     end
  132.     if @right_picture != nil and @right_keep == true
  133.       @right_picture.dispose
  134.     end   
  135.     if @left_picture != nil and @left_keep == true
  136.       @left_picture.dispose
  137.     end
  138.   end
  139.   def refresh
  140.     # 初期化
  141.     self.contents.clear
  142.     self.contents.font.color = normal_color
  143.     self.contents.font.size = Font.default_size
  144.     @x = @y = @max_x = @max_y = @indent = @lines = 0
  145.     @left_keep = @right_keep = false
  146.     @face_indent = 0
  147.     [url=home.php?mod=space&uid=316553]@opacity[/url] = 255
  148.     @cursor_width = 0
  149.     @write_speed = 0
  150.     @write_wait = 0
  151.     @mid_stop = false
  152.     @face_file = nil
  153.     @popchar = -2
  154.     if $game_temp.choice_start == 0
  155.       @x = 8
  156.     end
  157.     if $game_temp.message_text != nil
  158.       @now_text = $game_temp.message_text
  159.       #——头像设置
  160.       if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
  161.          @face_file = $1 + ".png"
  162.          @x = @face_indent = 128
  163.          if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
  164.          self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 120, 120))
  165.         end
  166.        @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
  167.       end
  168.       #——左半身像设置
  169.       if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  170.         [url=home.php?mod=space&uid=84331]@face[/url] = "" + $1 + ".png"
  171.         if $加密 == true
  172.           if @left_picture != nil
  173.             @left_picture.dispose
  174.           end
  175.           @left_picture = Sprite.new
  176.           @left_picture.bitmap = Bitmap.new("Graphics/Pictures/#{@face}")
  177.           @left_picture.y = 464-@left_picture.bitmap.height
  178.           @left_picture.x = 0
  179.           @left_picture.mirror = true
  180.           @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  181.         else         
  182.           if FileTest.exist?("Graphics/Pictures/#{@face}")
  183.             if @left_picture != nil
  184.               @left_picture.dispose
  185.             end
  186.             @left_picture = Sprite.new
  187.             @left_picture.bitmap = Bitmap.new("Graphics/Pictures/#{@face}")
  188.             @left_picture.y = 464-@left_picture.bitmap.height
  189.             @left_picture.x = 0
  190.             @left_picture.mirror = true
  191.             @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  192.           end
  193.         end        
  194.       end
  195.       #——右半身像设置
  196.       if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  197.         [url=home.php?mod=space&uid=84331]@face[/url] = "" + $1 + ".png"
  198.         if $加密 == true
  199.           if @right_picture != nil
  200.             @right_picture.dispose
  201.           end
  202.           @right_picture = Sprite.new
  203.           @right_picture.bitmap = Bitmap.new("Graphics/Pictures/#{@face}")
  204.           @right_picture.y = 229-@right_picture.bitmap.height
  205.           @right_picture.x = 640-@right_picture.bitmap.width
  206.           @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  207.         else
  208.           if FileTest.exist?("Graphics/battlers/#{@face}")
  209.             if @right_picture != nil
  210.               @right_picture.dispose
  211.             end
  212.             @right_picture = Sprite.new
  213.             @right_picture.bitmap = Bitmap.new("Graphics/Pictures/#{@face}")
  214.             @right_picture.y = 229-@right_picture.bitmap.height
  215.             @right_picture.x = 640-@right_picture.bitmap.width
  216.             @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  217.           end
  218.         end
  219.       end
  220.       if (/\\[Rr]k/.match(@now_text)) != nil
  221.         @right_keep = true
  222.         @now_text.sub!(/\\[Rr]k/) { "" }
  223.       end
  224.       if (/\\[Ll]k/.match(@now_text)) != nil
  225.         @left_keep = true
  226.         @now_text.sub!(/\\[Ll]k/) { "" }
  227.       end
  228.       # 显示人物姓名
  229.       name_window_set = false
  230.       if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
  231.         name_window_set = true
  232.         name_text = $1
  233.         @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  234.       end
  235.       # 显示编号姓名
  236.       if (/\\[Nn]n\[(.+?)\]/.match(@now_text)) != nil
  237.        name_window_set = true
  238.        name_text = $game_actors[$1.to_i] == nil ? "???" : $game_actors[$1.to_i].name
  239.        @now_text.sub!(/\\[Nn]n\[(.*?)\]/) { "" }
  240.      end
  241.       # 文字位置的判定
  242.       if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  243.         @popchar = $1.to_i
  244.         if @popchar == -1
  245.           @x = @indent = 48
  246.           @y = 4
  247.         end
  248.         @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  249.       end
  250.       
  251.       # 开始
  252.       begin
  253.         last_text = @now_text.clone
  254.         @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  255.       end until @now_text == last_text
  256.       @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  257.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  258.     end
  259.     @now_text.gsub!(/\\\\/) { "\000" }
  260.     @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  261.     @now_text.gsub!(/\\[Gg]/) { "\002" }
  262.     @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
  263.     @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
  264.     @now_text.gsub!(/\\[.]/) { "\005" }
  265.     @now_text.gsub!(/\\[|]/) { "\006" }

  266.     @now_text.gsub!(/\\[>]/) { "\016" }
  267.     @now_text.gsub!(/\\[<]/) { "\017" }
  268.     @now_text.gsub!(/\\[!]/) { "\020" }
  269.     @now_text.gsub!(/\\[~]/) { "\021" }
  270.    
  271.     @now_text.gsub!(/\\[Ii]/) { "\023" }
  272.     @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  273.     @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  274.     @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  275.     @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }
  276.     if @popchar >= 0
  277.       @text_save = @now_text.clone
  278.       @max_x = 0
  279.       @max_y = 4
  280.       for i in 0..3
  281.         line = @now_text.split(/\n/)[3-i]
  282.         @max_y -= 1 if line == nil and @max_y <= 4-i
  283.         next if line == nil
  284.         cx = contents.text_size(line).width
  285.         @max_x = cx if cx > @max_x
  286.       end
  287.       self.width = @max_x + 48 + @face_indent
  288.       self.height = (@max_y - 1) * 32 + 64
  289.     else
  290.       @max_x = self.width - 32 - @face_indent
  291.     end
  292.     reset_window
  293.       if name_window_set
  294.         off_x = 0
  295.         off_y = -40
  296.         space = 2
  297.         x = self.x + off_x - space / 2
  298.         y = self.y + off_y - space / 2
  299.         w = self.contents.text_size(name_text).width + 26 + space
  300.         h = 40 + space
  301.         @name_window_frame = Window_Frame.new(x, y, w, h)
  302.         @name_window_frame.z = self.z + 1
  303.         x = self.x + off_x + 4
  304.         y = self.y + off_y
  305.         @name_window_text = Air_Text.new(x+4, y+6, name_text)
  306.         @name_window_text.z = self.z + 2
  307.       end
  308.     end
  309.     reset_window
  310.     if $game_temp.choice_max > 0
  311.       @item_max = $game_temp.choice_max
  312.       self.active = true
  313.       self.index = 0
  314.     end
  315.     if $game_temp.num_input_variable_id > 0
  316.       digits_max = $game_temp.num_input_digits_max
  317.       number = $game_variables[$game_temp.num_input_variable_id]
  318.       @input_number_window = Window_InputNumber.new(digits_max)
  319.       @input_number_window.number = number
  320.       @input_number_window.x = self.x + 8
  321.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  322.     end
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ● 更新
  326.   #--------------------------------------------------------------------------
  327.   def update
  328.     super
  329.     if @fade_in
  330.       self.contents_opacity += 24
  331.       if @input_number_window != nil
  332.         @input_number_window.contents_opacity += 24
  333.       end
  334.       if self.contents_opacity == 255
  335.         @fade_in = false
  336.       end
  337.       return
  338.     end
  339.     @now_text = nil if @now_text == ""
  340.    
  341.     if @now_text != nil and @mid_stop == false
  342.       if @write_wait > 0
  343.         @write_wait -= 1
  344.         return
  345.       end
  346.       text_not_skip = $game_system.typing
  347.       while true
  348.         @max_x = @x if @max_x < @x
  349.         @max_y = @y if @max_y < @y
  350.         if (c = @now_text.slice!(/./m)) != nil
  351.           if c == "\000"
  352.             c = "\\"
  353.           end
  354.           if c == "\001"
  355.             @now_text.sub!(/\[([0-9]+)\]/, "")
  356.             color = $1.to_i
  357.             if color >= 0 and color <= 7
  358.               self.contents.font.color = text_color(color)
  359.             end
  360.             c = ""
  361.           end
  362.           if c == "\002"
  363.             if @gold_window == nil and @popchar <= 0
  364.               @gold_window = Window_Gold.new
  365.               @gold_window.x = 560 - @gold_window.width
  366.               if $game_temp.in_battle
  367.                 @gold_window.y = 192
  368.               else
  369.                 @gold_window.y = self.y >= 128 ? 32 : 384
  370.               end
  371.               @gold_window.opacity = self.opacity
  372.               @gold_window.back_opacity = self.back_opacity
  373.             end
  374.             c = ""
  375.           end
  376.           if c == "\003"
  377.             @now_text.sub!(/\[([0-9]+)\]/, "")
  378.             speed = $1.to_i
  379.             if speed >= 0 and speed <= 100
  380.               @write_speed = speed
  381.             end
  382.             c = ""
  383.           end
  384.           if c == "\004"
  385.             @now_text.sub!(/\[(.*?)\]/, "")
  386.             buftxt = $1.dup.to_s
  387.             if buftxt.match(/\//) == nil and buftxt != "" then
  388.               $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  389.             else
  390.               $game_system.soundname_on_speak = buftxt.dup
  391.             end
  392.             c = ""
  393.           elsif c == "\004"
  394.             c = ""
  395.           end
  396.           if c == "\005"
  397.             @write_wait += 5
  398.             c = ""
  399.           end
  400.           if c == "\006"
  401.             @write_wait += 30
  402.             c = ""
  403.           end
  404.           if c == "\016"
  405.             text_not_skip = false
  406.             c = ""
  407.           end
  408.           if c == "\017"
  409.             text_not_skip = true
  410.             c = ""
  411.           end
  412.           if c == "\020"
  413.             @mid_stop = true
  414.             c = ""
  415.           end
  416.           if c == "\021"
  417.             terminate_message
  418.             return
  419.           end
  420.           if c == "\023"
  421.             @indent = @x
  422.             c = ""
  423.           end
  424.           if c == "\024"
  425.             @now_text.sub!(/\[([0-9]+)\]/, "")
  426.             [url=home.php?mod=space&uid=316553]@opacity[/url] = $1.to_i
  427.             c = ""
  428.           end
  429.           if c == "\025"
  430.             @now_text.sub!(/\[([0-9]+)\]/, "")
  431.             self.contents.font.size = [[$1.to_i, 6].max, 32].min
  432.             c = ""
  433.           end
  434.           if c == "\026"
  435.             @now_text.sub!(/\[([0-9]+)\]/, "")
  436.             @x += $1.to_i
  437.             c = ""
  438.           end
  439.           if c == "\027"
  440.             @now_text.sub!(/\[(.*?)\]/, "")
  441.             @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  442.             if $game_system.soundname_on_speak != ""
  443.               Audio.se_play($game_system.soundname_on_speak)
  444.             end
  445.             c = ""
  446.           end
  447.           if c == "\030"
  448.             @now_text.sub!(/\[(.*?)\]/, "")
  449.             self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  450.            if $game_system.soundname_on_speak != ""
  451.               Audio.se_play($game_system.soundname_on_speak)
  452.             end
  453.             @x += 24
  454.             c = ""
  455.           end
  456.           if c == "\n"
  457.             if @lines >= $game_temp.choice_start
  458.               @cursor_width = [@cursor_width, @max_x - @face_indent].max
  459.             end
  460.             @lines += 1
  461.             @y += 1
  462.             @x = 0 + @indent + @face_indent
  463.             if @lines >= $game_temp.choice_start
  464.               @x = 8 + @indent + @face_indent
  465.             end
  466.             c = ""
  467.           end
  468.           if c != ""
  469.             # 文字描画
  470.             @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  471.             if $game_system.soundname_on_speak != "" then
  472.             Audio.se_play($game_system.soundname_on_speak)
  473.             end
  474.           end
  475.           if Input.press?(Input::B)
  476.             text_not_skip = false
  477.           end
  478.         else
  479.           text_not_skip = true
  480.           break
  481.         end
  482.         # 終了判定
  483.         if text_not_skip
  484.           break
  485.         end
  486.       end
  487.       @write_wait += @write_speed
  488.       return
  489.     end
  490.     if @input_number_window != nil
  491.       @input_number_window.update
  492.       # 決定
  493.       if Input.trigger?(Input::C)
  494.         $game_system.se_play($data_system.decision_se)
  495.         $game_variables[$game_temp.num_input_variable_id] =
  496.         @input_number_window.number
  497.         $game_map.need_refresh = true
  498.         @input_number_window.dispose
  499.         @input_number_window = nil
  500.         terminate_message
  501.       end
  502.       return
  503.     end
  504.     if @contents_showing
  505.       if $game_temp.choice_max == 0
  506.         self.pause = true
  507.       end
  508.       # 取消
  509.       if Input.trigger?(Input::B)
  510.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  511.           $game_system.se_play($data_system.cancel_se)
  512.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  513.           terminate_message
  514.         end
  515.       end
  516.       # 決定
  517.       if Input.trigger?(Input::C)
  518.         if $game_temp.choice_max > 0
  519.           $game_system.se_play($data_system.decision_se)
  520.           $game_temp.choice_proc.call(self.index)
  521.         end
  522.         if @mid_stop
  523.           @mid_stop = false
  524.           return
  525.         else
  526.           terminate_message
  527.         end
  528.       end
  529.       return
  530.     end
  531.     if @fade_out == false and $game_temp.message_text != nil
  532.       @contents_showing = true
  533.       $game_temp.message_window_showing = true
  534.       refresh
  535.       Graphics.frame_reset
  536.       self.visible = true
  537.       self.contents_opacity = 0
  538.     if @input_number_window != nil
  539.       @input_number_window.contents_opacity = 0
  540.     end
  541.       @fade_in = true
  542.       return
  543.     end
  544.     if self.visible
  545.       @fade_out = true
  546.       self.opacity -= 48
  547.       if self.opacity == 0
  548.         self.visible = false
  549.         @fade_out = false
  550.         $game_temp.message_window_showing = false
  551.       end
  552.       return
  553.     end
  554.   end
  555.   #--------------------------------------------------------------------------
  556.   # ● 获得字符
  557.   #--------------------------------------------------------------------------
  558.   def get_character(parameter)
  559.     case parameter
  560.     when 0
  561.       return $game_player
  562.     else
  563.       events = $game_map.events
  564.       return events == nil ? nil : events[parameter]
  565.     end
  566.   end
  567.   #--------------------------------------------------------------------------
  568.   # ● ウィンドウの位置と不透明度の設定
  569.   #--------------------------------------------------------------------------
  570.   def reset_window
  571.     # 判定
  572.     if @popchar >= 0
  573.       events = $game_map.events
  574.       if events != nil
  575.         character = get_character(@popchar)
  576.         x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  577.         y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  578.         self.x = x
  579.         self.y = y
  580.       end
  581.     elsif @popchar == -1
  582.       self.x = -4
  583.       self.y = -4
  584.       self.width = 648
  585.       self.height = 488
  586.     else
  587.       if $game_temp.in_battle
  588.         self.y = 16
  589.       else
  590.         case $game_system.message_position
  591.         when 0 # 上
  592.           self.y = 16
  593.         when 1 # 中
  594.           self.y = 160
  595.         when 2 # 下
  596.           self.y = 304
  597.         end
  598.         self.x = 80
  599.         if @face_file == nil
  600.           self.width = 480
  601.         else
  602.           self.width = 600
  603.           self.x -= 60
  604.         end
  605.         self.height = 160
  606.       end
  607.     end
  608.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  609.     if @face_file != nil
  610.       self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 189, 144))
  611.     end
  612.     if @popchar == -1
  613.       self.opacity = 255
  614.       self.back_opacity = 0
  615.     elsif $game_system.message_frame == 0
  616.       self.opacity = 255
  617.       self.back_opacity = 200
  618.     else
  619.       self.opacity = 0
  620.       self.back_opacity = 200
  621.     end
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # ● line_height
  625.   #--------------------------------------------------------------------------
  626.   # 返回値:行高
  627.   #--------------------------------------------------------------------------
  628.   def line_height
  629.     return 32
  630.     if self.contents.font.size >= 20 and self.contents.font.size <= 24
  631.       return 32
  632.     else
  633.       return self.contents.font.size * 15 / 10
  634.     end
  635.   end
  636.   #--------------------------------------------------------------------------
  637.   # ● 透過文字描画
  638.   #--------------------------------------------------------------------------
  639.   # target :描画対象。Bitmapクラスを指定。
  640.   # x :x座標
  641.   # y :y座標
  642.   # str  :描画文字列
  643.   # opacity:透過率(0~255)
  644.   # 返回値 :文字幅(@x増加値)。
  645.   #--------------------------------------------------------------------------
  646.   def opacity_draw_text(target, x, y, str,opacity)
  647.     height = target.font.size
  648.     width = target.text_size(str).width
  649.     opacity = [[opacity, 0].max, 255].min
  650.     if opacity == 255
  651.       target.draw_text(x, y, width, height, str)
  652.       return width
  653.     else
  654.       if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  655.         @opacity_text_buf.dispose
  656.         @opacity_text_buf = Bitmap.new(width, height)
  657.       else
  658.         @opacity_text_buf.clear
  659.       end
  660.       @opacity_text_buf.font.size = target.font.size
  661.       @opacity_text_buf.draw_text(0, 0, width, height, str)
  662.       target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  663.     return width
  664.     end
  665.   end
  666.   def ruby_draw_text(target, x, y, str,opacity)
  667.     sizeback = target.font.size
  668.     target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  669.     rubysize = [rubysize, 6].max
  670.    
  671.     opacity = [[opacity, 0].max, 255].min
  672.     split_s = str.split(/,/)
  673.    
  674.     split_s[0] == nil ? split_s[0] = "" : nil
  675.     split_s[1] == nil ? split_s[1] = "" : nil
  676.    
  677.     height = sizeback + rubysize
  678.     width = target.text_size(split_s[0]).width
  679.    
  680.     target.font.size = rubysize
  681.     ruby_width = target.text_size(split_s[1]).width
  682.     target.font.size = sizeback
  683.    
  684.     buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  685.    
  686.     width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  687.    
  688.     if opacity == 255
  689.       target.font.size = rubysize
  690.       target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  691.       target.font.size = sizeback
  692.       target.draw_text(x, y, width, target.font.size, split_s[0])
  693.       return width
  694.     else
  695.       if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  696.         @opacity_text_buf.dispose
  697.         @opacity_text_buf = Bitmap.new(buf_width, height)
  698.       else
  699.         @opacity_text_buf.clear
  700.       end
  701.       @opacity_text_buf.font.size = rubysize
  702.       @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  703.       @opacity_text_buf.font.size = sizeback
  704.       @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  705.       if sub_x >= 0
  706.         target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  707.       else
  708.         target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  709.       end
  710.       return width
  711.     end
  712.   end
  713.   #--------------------------------------------------------------------------
  714.   # ● \V 变换
  715.   #--------------------------------------------------------------------------
  716.   def convart_value(option, index)
  717.     option == nil ? option = "" : nil
  718.     option.downcase!
  719.     case option
  720.       when "i"
  721.         unless $data_items[index].name == nil
  722.           r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  723.         end
  724.       when "w"
  725.         unless $data_weapons[index].name == nil
  726.           r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  727.         end
  728.       when "a"
  729.         unless $data_armors[index].name == nil
  730.           r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  731.         end
  732.       when "s"
  733.         unless $data_skills[index].name == nil
  734.           r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  735.         end
  736.       else
  737.       r = $game_variables[index]
  738.     end
  739.     r == nil ? r = "" : nil
  740.     return r
  741.   end
  742.   #--------------------------------------------------------------------------
  743.   # ● 解放
  744.   #--------------------------------------------------------------------------
  745.   def dispose
  746.     terminate_message
  747.     if @gaiji_cache != nil
  748.       unless @gaiji_cache.disposed?
  749.         @gaiji_cache.dispose
  750.       end
  751.     end
  752.     unless @opacity_text_buf.disposed?
  753.       @opacity_text_buf.dispose
  754.     end
  755.     $game_temp.message_window_showing = false
  756.     if @input_number_window != nil
  757.       @input_number_window.dispose
  758.     end
  759.     super
  760.   end
  761.   #--------------------------------------------------------------------------
  762.   # ● 矩形更新
  763.   #--------------------------------------------------------------------------
  764.   def update_cursor_rect
  765.     if @index >= 0
  766.       n = $game_temp.choice_start + @index
  767.       self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)
  768.     else
  769.       self.cursor_rect.empty
  770.     end
  771.   end
  772. end
  773. #==============================================================================
  774. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  775. #==============================================================================
  776. class Window_Frame < Window_Base
  777.   #--------------------------------------------------------------------------
  778.   # ● オブジェクト初期化
  779.   #--------------------------------------------------------------------------
  780.   def initialize(x, y, width, height)
  781.     super(x, y, width, height)
  782.     self.contents = nil
  783.     self.back_opacity = 200
  784.   end
  785.   #--------------------------------------------------------------------------
  786.   # ● 解放
  787.   #--------------------------------------------------------------------------
  788.   def dispose
  789.     super
  790.     end
  791.   end
  792. #==============================================================================
  793. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  794. #==============================================================================
  795. class Air_Text < Window_Base
  796.   #--------------------------------------------------------------------------
  797.   # ● オブジェクト初期化
  798.   #--------------------------------------------------------------------------
  799.   def initialize(x, y, designate_text)
  800.     super(x-16, y-16, 32 + designate_text.size * 12, 56)
  801.     self.opacity = 0
  802.     self.back_opacity = 0
  803.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  804.     w = self.contents.width
  805.     h = self.contents.height
  806.     self.contents.draw_text(0, 0, w, h, designate_text)
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● 解放
  810.   #--------------------------------------------------------------------------
  811.   def dispose
  812.     self.contents.clear
  813.     super
  814.   end
  815. end


  816. #==============================================================================
  817. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  818. #==============================================================================
复制代码
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (版主)

聪仔

梦石
0
星屑
6182
在线时间
3077 小时
注册时间
2013-12-26
帖子
3145
3
发表于 2014-3-22 19:55:17 | 只看该作者
我很奇怪,用这个脚本你怎么能控制头像的坐标呢?只能选择头像在左边还是右边啊

点评

那能给我个思路吗?  发表于 2014-3-23 13:24
聪聪全国第三帅...
他们都叫我【人赢聪】
我的RM能力雷达图:

回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
10
星屑
5618
在线时间
1849 小时
注册时间
2013-2-14
帖子
395

开拓者

4
 楼主| 发表于 2014-3-22 22:11:38 手机端发表。 | 只看该作者
正太君 发表于 2014-3-22 19:55
我很奇怪,用这个脚本你怎么能控制头像的坐标呢?只能选择头像在左边还是右边啊 ...

对呀,是只能显示左右。。所以我才发帖有没有可以显示多张的高级些的对话框。。用现在这个对话框只能显示半身像,表情都不能显示出来。。

点评

我不太理解,对话框脚本好像都是这样的啊。。。  发表于 2014-3-23 15:44
如果你能找到一个可以显示头像的脚本,我就可以帮助你修改成你需要的样子了  发表于 2014-3-23 14:21
应该有的吧!这个就算可以显示多个也不理想呀  发表于 2014-3-22 23:00
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 04:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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