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

Project1

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

[已经解决] 对话框调用头像的问题......

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
23 小时
注册时间
2013-8-30
帖子
27
跳转到指定楼层
1
发表于 2014-1-5 01:17:56 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
按照脚本提示还是用不了啊QAQ

我用的是这个脚本:

RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4.  
  5.  
  6. #——说明
  7.  
  8. #默认为一个字一个字的方式,如果需要一次全部显示,
  9. #请在游戏中使用脚本:$game_system.typing = true
  10.  
  11. #默认对话字没有声音,如果需要声音,
  12. #请在游戏中使用脚本:$game_system.soundname_on_speak = "这里输入文件名"
  13. #我唯一一个见过“胡乱配音”的游戏是天使帝国2代,该游戏说话的时候每个字符随机发一个外星语音
  14.  
  15. # 其他在对话中可以使用的功能:
  16.  
  17. # \n[1]:显示1号角色的姓名
  18.  
  19. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
  20.  
  21. # \p[1]:对话框出现在1号事件的上方
  22. # \p[0]:主人公上方出现对话框
  23. #——————————————————使用\p功能后可以自动调整对话框大小
  24.  
  25. # \\:显示"\"这个符号
  26.  
  27. # \c[1-8]:更改颜色
  28.  
  29. # \g:显示金钱窗口
  30.  
  31. # \a[SE文件名]:对话的时候播放SE
  32.  
  33. # \s[1-19]:更改弹字的速度
  34.  
  35. # \.   :停顿一刹那(1、2帧)
  36. # \|   :停顿片刻(20帧)
  37.  
  38. # \>   :文字不用打字方式
  39. # \<   :文字使用打字方式
  40.  
  41. # \!   :等待玩家按回车再继续
  42. # \~   :文字直接消失
  43.  
  44. # \I   :下一行从这个位置开始
  45.  
  46. # \o[123]:文字透明度改为123,模拟将死之人(汗)
  47.  
  48. # \h[12]:改用12号字
  49.  
  50. # \b[50]:空50象素
  51.  
  52. # \K[今天天气不错]:在出现“今天天气不错”这几个字的时候播放$game_system.soundname_on_speak设置的音效
  53.  
  54. # \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
  55. # \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”
  56.  
  57. # \Lk:清除左边的图像
  58. # \Rk:清除右边的图像
  59. # \M[60]:等待60帧文字直接消失
  60.  
  61. #脚本冲突可能:
  62. #不用说了。因为改了分辨率所有原有窗口需要自己定义,基本上可以算是和所有脚本冲突。
  63.  
  64. #============================
  65. class Game_System
  66. attr_accessor :typing
  67. attr_accessor :soundname_on_speak
  68. alias carol3_ini initialize
  69. def initialize
  70.    carol3_ini
  71.    @typing = true
  72.    @soundname_on_speak = nil
  73. end
  74. end
  75. #=================================
  76. #==============================================================================
  77. # ■ Window_Message
  78. #------------------------------------------------------------------------------
  79. class Window_Message < Window_Selectable
  80. #--------------------------------------------------------------------------
  81. # ● 初始化状态
  82. #--------------------------------------------------------------------------
  83. def initialize
  84.    super(80, 304, 480, 160)
  85.    self.contents = Bitmap.new(width - 32, height - 32)
  86.    self.visible = false
  87.    self.z = 9998
  88.    @fade_in = false
  89.    @fade_out = false
  90.    @contents_showing = false
  91.    @cursor_width = 0
  92.    @autoclosetime = -1
  93.    self.active = false
  94.    self.index = -1
  95.    if $game_system.soundname_on_speak == nil then
  96.      $game_system.soundname_on_speak = ""
  97.    end
  98.    @opacity_text_buf = Bitmap.new(32, 32)
  99. end
  100. #--------------------------------------------------------------------------
  101. # ● 释放
  102. #--------------------------------------------------------------------------
  103. def dispose
  104.    terminate_message
  105.    $game_temp.message_window_showing = false
  106.    if @input_number_window != nil
  107.      @input_number_window.dispose
  108.    end
  109.    super
  110. end
  111. #--------------------------------------------------------------------------
  112. # ● 处理信息结束
  113. #--------------------------------------------------------------------------
  114. def terminate_message
  115.    self.active = false
  116.    self.pause = false
  117.    self.index = -1
  118.    self.contents.clear
  119.    # 清除显示中标志
  120.    @contents_showing = false
  121.    # 呼叫信息调用
  122.    if $game_temp.message_proc != nil
  123.      $game_temp.message_proc.call
  124.    end
  125.    # 清除文章、选择项、输入数值的相关变量
  126.    $game_temp.message_text = nil
  127.    $game_temp.message_proc = nil
  128.    $game_temp.choice_start = 99
  129.    $game_temp.choice_max = 0
  130.    $game_temp.choice_cancel_type = 0
  131.    $game_temp.choice_proc = nil
  132.    $game_temp.num_input_start = 99
  133.    $game_temp.num_input_variable_id = 0
  134.    $game_temp.num_input_digits_max = 0
  135.    # 开放金钱窗口
  136.    if @gold_window != nil
  137.      @gold_window.dispose
  138.      @gold_window = nil
  139.    end
  140.    if @name_window_frame != nil
  141.      @name_window_frame.dispose
  142.      @name_window_frame = nil
  143.    end
  144.    if @name_window_text != nil
  145.      @name_window_text.dispose
  146.      @name_window_text = nil
  147.    end
  148.    if @right_picture != nil and @right_keep == true
  149.      @right_picture.dispose
  150.    end   
  151.    if @left_picture != nil and @left_keep == true
  152.      @left_picture.dispose
  153.    end
  154. end
  155. def refresh
  156.    # 初期化
  157.    self.contents.clear
  158.    self.contents.font.color = normal_color
  159.    self.contents.font.size = Font.default_size
  160.    @x = @y = @max_x = @max_y = @indent = @lines = 0
  161.    @left_keep = @right_keep = false
  162.    @face_indent = 0
  163.    @opacity = 255
  164.    @cursor_width = 0
  165.    @autoclosetime = -1
  166.    @write_speed = 0
  167.    @write_wait = 0
  168.    @mid_stop = false
  169.    @face_file = nil
  170.    @popchar = -2
  171.    if $game_temp.choice_start == 0
  172.      @x = 8
  173.    end
  174.    if $game_temp.message_text != nil
  175.      @now_text = $game_temp.message_text
  176.      #——头像设置
  177.      if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
  178.        @face_file = $1 + ".png"
  179.        @x = @face_indent = 128
  180.        if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
  181.          self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  182.        end
  183.        @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
  184.      end
  185.      #——左半身像设置
  186.      if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  187.        @face = "66rpg_" + $1 + "_h.png"
  188.        if $加密 == true
  189.          if @left_picture != nil
  190.            @left_picture.dispose
  191.          end
  192.          @left_picture = Sprite.new
  193.          @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  194.          @left_picture.y = [email]480-@left_picture.bitmap.height[/email]
  195.          @left_picture.x = 0
  196.          @left_picture.mirror = true
  197.          @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  198.        else         
  199.          if FileTest.exist?("Graphics/battlers/#{@face}")
  200.            if @left_picture != nil
  201.              @left_picture.dispose
  202.            end
  203.            @left_picture = Sprite.new
  204.            @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  205.            @left_picture.y = [email]480-@left_picture.bitmap.height[/email]
  206.            @left_picture.x = 0
  207.            @left_picture.mirror = true
  208.            @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  209.          end
  210.        end        
  211.      end
  212.      #——右半身像设置
  213.      if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  214.        @face = "66rpg_" + $1 + "_h.png"
  215.        if $加密 == true
  216.          if @right_picture != nil
  217.            @right_picture.dispose
  218.          end
  219.          @right_picture = Sprite.new
  220.          @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  221.          @right_picture.y = [email]480-@right_picture.bitmap.height[/email]
  222.          @right_picture.x = [email]640-@right_picture.bitmap.width[/email]
  223.          @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  224.        else
  225.          if FileTest.exist?("Graphics/battlers/#{@face}")
  226.            if @right_picture != nil
  227.              @right_picture.dispose
  228.            end
  229.            @right_picture = Sprite.new
  230.            @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  231.            @right_picture.y = [email]480-@right_picture.bitmap.height[/email]
  232.            @right_picture.x = [email]640-@right_picture.bitmap.width[/email]
  233.            @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  234.          end
  235.        end
  236.      end
  237.      if (/\\[Rr]k/.match(@now_text)) != nil
  238.        @right_keep = true
  239.        @now_text.sub!(/\\[Rr]k/) { "" }
  240.      end
  241.      if (/\\[Ll]k/.match(@now_text)) != nil
  242.        @left_keep = true
  243.        @now_text.sub!(/\\[Ll]k/) { "" }
  244.      end
  245.      # 显示人物姓名
  246.      name_window_set = false
  247.      if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
  248.        name_window_set = true
  249.        name_text = $1
  250.        @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  251.      end
  252.  
  253.      # 文字位置的判定
  254.      if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  255.        @popchar = $1.to_i
  256.        if @popchar == -1
  257.          @x = @indent = 48
  258.          @y = 4
  259.        end
  260.        @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  261.      end
  262.  
  263.      # 开始
  264.      begin
  265.        last_text = @now_text.clone
  266.        @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  267.      end until @now_text == last_text
  268.      @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  269.      $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  270.    end
  271.    @now_text.gsub!(/\\\\/) { "\000" }
  272.    @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  273.    @now_text.gsub!(/\\[Gg]/) { "\002" }
  274.    @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
  275.    @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
  276.    @now_text.gsub!(/\\[.]/) { "\005" }
  277.    @now_text.gsub!(/\\[|]/) { "\006" }
  278.    @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) { "\050[#{$1}]" }
  279.  
  280.    @now_text.gsub!(/\\[>]/) { "\016" }
  281.    @now_text.gsub!(/\\[<]/) { "\017" }
  282.    @now_text.gsub!(/\\[!]/) { "\020" }
  283.    @now_text.gsub!(/\\[~]/) { "\021" }
  284.  
  285.    @now_text.gsub!(/\\[Ii]/) { "\023" }
  286.    @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  287.    @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  288.    @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  289.    @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }
  290.    if @popchar >= 0
  291.      @text_save = @now_text.clone
  292.      @max_x = 0
  293.      @max_y = 4
  294.      for i in 0..3
  295.        line = @now_text.split(/\n/)[3-i]
  296.        @max_y -= 1 if line == nil and @max_y <= 4-i
  297.        next if line == nil
  298.        cx = contents.text_size(line).width
  299.        @max_x = cx if cx > @max_x
  300.      end
  301.      self.width = @max_x + 48 + @face_indent
  302.      self.height = (@max_y - 1) * 32 + 64
  303.    else
  304.      @max_x = self.width - 32 - @face_indent
  305.    end
  306.    reset_window
  307.      if name_window_set
  308.        off_x = 0
  309.        off_y = -40
  310.        space = 2
  311.        x = self.x + off_x - space / 2
  312.        y = self.y + off_y - space / 2
  313.        w = self.contents.text_size(name_text).width + 26 + space
  314.        h = 40 + space
  315.        @name_window_frame = Window_Frame.new(x, y, w, h)
  316.        @name_window_frame.z = self.z + 1
  317.        x = self.x + off_x + 4
  318.        y = self.y + off_y
  319.        @name_window_text = Air_Text.new(x+4, y+6, name_text)
  320.        @name_window_text.z = self.z + 2
  321.      end
  322.    end
  323.    reset_window
  324.    if $game_temp.choice_max > 0
  325.      @item_max = $game_temp.choice_max
  326.      self.active = true
  327.      self.index = 0
  328.    end
  329.    if $game_temp.num_input_variable_id > 0
  330.      digits_max = $game_temp.num_input_digits_max
  331.      number = $game_variables[$game_temp.num_input_variable_id]
  332.      @input_number_window = Window_InputNumber.new(digits_max)
  333.      @input_number_window.number = number
  334.      @input_number_window.x = self.x + 8
  335.      @input_number_window.y = self.y + $game_temp.num_input_start * 32
  336.    end
  337. end
  338. #--------------------------------------------------------------------------
  339. # ● 更新
  340. #--------------------------------------------------------------------------
  341. def update
  342.    super
  343.    if @autoclosetime == 0
  344.      @autoclosetime = -1
  345.      terminate_message
  346.   end
  347.    if @autoclosetime >= 1
  348.      @autoclosetime -= 1
  349.    end
  350.    if @fade_in
  351.      self.contents_opacity += 24
  352.      if @input_number_window != nil
  353.        @input_number_window.contents_opacity += 24
  354.      end
  355.      if self.contents_opacity == 255
  356.        @fade_in = false
  357.      end
  358.      return
  359.    end
  360.    @now_text = nil if @now_text == ""
  361.  
  362.    if @now_text != nil and @mid_stop == false
  363.      if @write_wait > 0
  364.        @write_wait -= 1
  365.        return
  366.      end
  367.      text_not_skip = $game_system.typing
  368.      while true
  369.        @max_x = @x if @max_x < @x
  370.        @max_y = @y if @max_y < @y
  371.        if (c = @now_text.slice!(/./m)) != nil
  372.          if c == "\000"
  373.            c = "\\"
  374.          end
  375.          if c == "\001"
  376.            @now_text.sub!(/\[([0-9]+)\]/, "")
  377.            color = $1.to_i
  378.            if color >= 0 and color <= 7
  379.              self.contents.font.color = text_color(color)
  380.            end
  381.            c = ""
  382.          end
  383.          if c == "\002"
  384.            if @gold_window == nil and @popchar <= 0
  385.              @gold_window = Window_Gold.new
  386.              @gold_window.x = 560 - @gold_window.width
  387.              if $game_temp.in_battle
  388.                @gold_window.y = 192
  389.              else
  390.                @gold_window.y = self.y >= 128 ? 32 : 384
  391.              end
  392.              @gold_window.opacity = self.opacity
  393.              @gold_window.back_opacity = self.back_opacity
  394.            end
  395.            c = ""
  396.          end
  397.          if c == "\003"
  398.            @now_text.sub!(/\[([0-9]+)\]/, "")
  399.            speed = $1.to_i
  400.            if speed >= 0 and speed <= 19
  401.              @write_speed = speed
  402.            end
  403.            c = ""
  404.          end
  405.          if c == "\004"
  406.            @now_text.sub!(/\[(.*?)\]/, "")
  407.            buftxt = $1.dup.to_s
  408.            if buftxt.match(/\//) == nil and buftxt != "" then
  409.              $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  410.            else
  411.              $game_system.soundname_on_speak = buftxt.dup
  412.            end
  413.            c = ""
  414.          elsif c == "\004"
  415.            c = ""
  416.          end
  417.          if c == "\005"
  418.            @write_wait += 5
  419.            c = ""
  420.          end
  421.          if c == "\006"
  422.            @write_wait += 20
  423.            c = ""
  424.          end
  425.          if c == "\016"
  426.            text_not_skip = false
  427.            c = ""
  428.          end
  429.          if c == "\017"
  430.            text_not_skip = true
  431.            c = ""
  432.          end
  433.          if c == "\020"
  434.            @mid_stop = true
  435.            c = ""
  436.          end
  437.          if c == "\021"
  438.            terminate_message
  439.            return
  440.          end
  441.          if c == "\023"
  442.            @indent = @x
  443.            c = ""
  444.          end
  445.          if c == "\024"
  446.            @now_text.sub!(/\[([0-9]+)\]/, "")
  447.            @opacity = $1.to_i
  448.            c = ""
  449.          end
  450.          if c == "\025"
  451.            @now_text.sub!(/\[([0-9]+)\]/, "")
  452.            self.contents.font.size = [[$1.to_i, 6].max, 32].min
  453.            c = ""
  454.          end
  455.          if c == "\026"
  456.            @now_text.sub!(/\[([0-9]+)\]/, "")
  457.            @x += $1.to_i
  458.            c = ""
  459.          end
  460.          if c == "\027"
  461.            @now_text.sub!(/\[(.*?)\]/, "")
  462.            @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  463.            if $game_system.soundname_on_speak != ""
  464.              Audio.se_play($game_system.soundname_on_speak)
  465.            end
  466.            c = ""
  467.          end
  468.          if c == "\030"
  469.            @now_text.sub!(/\[(.*?)\]/, "")
  470.            self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  471.           if $game_system.soundname_on_speak != ""
  472.              Audio.se_play($game_system.soundname_on_speak)
  473.            end
  474.            @x += 24
  475.            c = ""
  476.          end
  477.          if c == "\050"
  478.  
  479.          @now_text.sub!(/\[([0-9]+)\]/, "")
  480.  
  481.          @autoclosetime = $1.to_i
  482.  
  483.          next
  484.  
  485.        end
  486.          if c == "\n"
  487.            if @lines >= $game_temp.choice_start
  488.              @cursor_width = [@cursor_width, @max_x - @face_indent].max
  489.            end
  490.            @lines += 1
  491.            @y += 1
  492.            @x = 0 + @indent + @face_indent
  493.            if @lines >= $game_temp.choice_start
  494.              @x = 8 + @indent + @face_indent
  495.            end
  496.            c = ""
  497.          end
  498.          if c != ""
  499.            # 文字描画
  500.            @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  501.            if $game_system.soundname_on_speak != "" then
  502.            Audio.se_play($game_system.soundname_on_speak)
  503.            end
  504.          end
  505.          if Input.press?(Input::B)
  506.            text_not_skip = false
  507.          end
  508.        else
  509.          text_not_skip = true
  510.          break
  511.        end
  512.        # 終了判定
  513.        if text_not_skip
  514.          break
  515.        end
  516.      end
  517.      @write_wait += @write_speed
  518.      return
  519.    end
  520.    if @input_number_window != nil
  521.      @input_number_window.update
  522.      # 決定
  523.      if Input.trigger?(Input::C)
  524.        $game_system.se_play($data_system.decision_se)
  525.        $game_variables[$game_temp.num_input_variable_id] =
  526.        @input_number_window.number
  527.        $game_map.need_refresh = true
  528.        @input_number_window.dispose
  529.        @input_number_window = nil
  530.        terminate_message
  531.      end
  532.      return
  533.    end
  534.    if @contents_showing
  535.      if $game_temp.choice_max == 0
  536.        self.pause = true
  537.      end
  538.      # 取消
  539.      if Input.trigger?(Input::B)
  540.        if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  541.          $game_system.se_play($data_system.cancel_se)
  542.          $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  543.          terminate_message
  544.        end
  545.      end
  546.      # 決定
  547.      if Input.trigger?(Input::C)
  548.        if $game_temp.choice_max > 0
  549.          $game_system.se_play($data_system.decision_se)
  550.          $game_temp.choice_proc.call(self.index)
  551.        end
  552.        if @mid_stop
  553.          @mid_stop = false
  554.          return
  555.        else
  556.          terminate_message
  557.        end
  558.      end
  559.      return
  560.    end
  561.    if @fade_out == false and $game_temp.message_text != nil
  562.      @contents_showing = true
  563.      $game_temp.message_window_showing = true
  564.      refresh
  565.      Graphics.frame_reset
  566.      self.visible = true
  567.      self.contents_opacity = 0
  568.    if @input_number_window != nil
  569.      @input_number_window.contents_opacity = 0
  570.    end
  571.      @fade_in = true
  572.      return
  573.    end
  574.    if self.visible
  575.      @fade_out = true
  576.      self.opacity -= 48
  577.      if self.opacity == 0
  578.        self.visible = false
  579.        @fade_out = false
  580.        $game_temp.message_window_showing = false
  581.      end
  582.      return
  583.    end
  584. end
  585. #--------------------------------------------------------------------------
  586. # ● 获得字符
  587. #--------------------------------------------------------------------------
  588. def get_character(parameter)
  589.    case parameter
  590.    when 0
  591.      return $game_player
  592.    else
  593.      events = $game_map.events
  594.      return events == nil ? nil : events[parameter]
  595.    end
  596. end
  597. #--------------------------------------------------------------------------
  598. # ● ウィンドウの位置と不透明度の設定
  599. #--------------------------------------------------------------------------
  600. def reset_window
  601.    # 判定
  602.    if @popchar >= 0
  603.      events = $game_map.events
  604.      if events != nil
  605.        character = get_character(@popchar)
  606.        x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  607.        y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  608.        self.x = x
  609.        self.y = y
  610.      end
  611.    elsif @popchar == -1
  612.      self.x = -4
  613.      self.y = -4
  614.      self.width = 648
  615.      self.height = 488
  616.    else
  617.      if $game_temp.in_battle
  618.        self.y = 16
  619.      else
  620.        case $game_system.message_position
  621.        when 0 # 上
  622.          self.y = 16
  623.        when 1 # 中
  624.          self.y = 160
  625.        when 2 # 下
  626.          self.y = 304
  627.        end
  628.        self.x = 80
  629.        if @face_file == nil
  630.          self.width = 480
  631.        else
  632.          self.width = 600
  633.          self.x -= 60
  634.        end
  635.        self.height = 160
  636.      end
  637.    end
  638.    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  639.    if @face_file != nil
  640.      self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  641.    end
  642.    if @popchar == -1
  643.      self.opacity = 255
  644.      self.back_opacity = 0
  645.    elsif $game_system.message_frame == 0
  646.      self.opacity = 255
  647.      self.back_opacity = 100
  648.    else
  649.      self.opacity = 0
  650.      self.back_opacity = 100
  651.    end
  652. end
  653. #--------------------------------------------------------------------------
  654. # ● line_height
  655. #--------------------------------------------------------------------------
  656. # 返回値:行高
  657. #--------------------------------------------------------------------------
  658. def line_height
  659.    return 32
  660.    if self.contents.font.size >= 20 and self.contents.font.size <= 24
  661.      return 32
  662.    else
  663.      return self.contents.font.size * 15 / 10
  664.    end
  665. end
  666. #--------------------------------------------------------------------------
  667. # ● 透過文字描画
  668. #--------------------------------------------------------------------------
  669. # target :描画対象。Bitmapクラスを指定。
  670. # x :x座標
  671. # y :y座標
  672. # str  :描画文字列
  673. # opacity:透過率(0~255)
  674. # 返回値 :文字幅(@x増加値)。
  675. #--------------------------------------------------------------------------
  676. def opacity_draw_text(target, x, y, str,opacity)
  677.    height = target.font.size
  678.    width = target.text_size(str).width
  679.    opacity = [[opacity, 0].max, 255].min
  680.    if opacity == 255
  681.      target.draw_text(x, y, width, height, str)
  682.      return width
  683.    else
  684.      if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  685.        @opacity_text_buf.dispose
  686.        @opacity_text_buf = Bitmap.new(width, height)
  687.      else
  688.        @opacity_text_buf.clear
  689.      end
  690.      @opacity_text_buf.font.size = target.font.size
  691.      @opacity_text_buf.draw_text(0, 0, width, height, str)
  692.      target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  693.    return width
  694.    end
  695. end
  696. def ruby_draw_text(target, x, y, str,opacity)
  697.    sizeback = target.font.size
  698.    target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  699.    rubysize = [rubysize, 6].max
  700.  
  701.    opacity = [[opacity, 0].max, 255].min
  702.    split_s = str.split(/,/)
  703.  
  704.    split_s[0] == nil ? split_s[0] = "" : nil
  705.    split_s[1] == nil ? split_s[1] = "" : nil
  706.  
  707.    height = sizeback + rubysize
  708.    width = target.text_size(split_s[0]).width
  709.  
  710.    target.font.size = rubysize
  711.    ruby_width = target.text_size(split_s[1]).width
  712.    target.font.size = sizeback
  713.  
  714.    buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  715.  
  716.    width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  717.  
  718.    if opacity == 255
  719.      target.font.size = rubysize
  720.      target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  721.      target.font.size = sizeback
  722.      target.draw_text(x, y, width, target.font.size, split_s[0])
  723.      return width
  724.    else
  725.      if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  726.        @opacity_text_buf.dispose
  727.        @opacity_text_buf = Bitmap.new(buf_width, height)
  728.      else
  729.        @opacity_text_buf.clear
  730.      end
  731.      @opacity_text_buf.font.size = rubysize
  732.      @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  733.      @opacity_text_buf.font.size = sizeback
  734.      @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  735.      if sub_x >= 0
  736.        target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  737.      else
  738.        target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  739.      end
  740.      return width
  741.    end
  742. end
  743. #--------------------------------------------------------------------------
  744. # ● \V 变换
  745. #--------------------------------------------------------------------------
  746. def convart_value(option, index)
  747.    option == nil ? option = "" : nil
  748.    option.downcase!
  749.    case option
  750.      when "i"
  751.        unless $data_items[index].name == nil
  752.          r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  753.        end
  754.      when "w"
  755.        unless $data_weapons[index].name == nil
  756.          r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  757.        end
  758.      when "a"
  759.        unless $data_armors[index].name == nil
  760.          r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  761.        end
  762.      when "s"
  763.        unless $data_skills[index].name == nil
  764.          r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  765.        end
  766.      else
  767.      r = $game_variables[index]
  768.    end
  769.    r == nil ? r = "" : nil
  770.    return r
  771. end
  772. #--------------------------------------------------------------------------
  773. # ● 解放
  774. #--------------------------------------------------------------------------
  775. def dispose
  776.    terminate_message
  777.    if @gaiji_cache != nil
  778.      unless @gaiji_cache.disposed?
  779.        @gaiji_cache.dispose
  780.      end
  781.    end
  782.    unless @opacity_text_buf.disposed?
  783.      @opacity_text_buf.dispose
  784.    end
  785.    $game_temp.message_window_showing = false
  786.    if @input_number_window != nil
  787.      @input_number_window.dispose
  788.    end
  789.    super
  790. end
  791. #--------------------------------------------------------------------------
  792. # ● 矩形更新
  793. #--------------------------------------------------------------------------
  794. def update_cursor_rect
  795.    if @index >= 0
  796.      n = $game_temp.choice_start + @index
  797.      self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)
  798.    else
  799.      self.cursor_rect.empty
  800.    end
  801. end
  802. end
  803. #==============================================================================
  804. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  805. #==============================================================================
  806. class Window_Frame < Window_Base
  807. #--------------------------------------------------------------------------
  808. # ● オブジェクト初期化
  809. #--------------------------------------------------------------------------
  810. def initialize(x, y, width, height)
  811.    super(x, y, width, height)
  812.    self.contents = nil
  813.    self.back_opacity = 100
  814. end
  815. #--------------------------------------------------------------------------
  816. # ● 解放
  817. #--------------------------------------------------------------------------
  818. def dispose
  819.    super
  820.    end
  821. end
  822. #==============================================================================
  823. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  824. #==============================================================================
  825. class Air_Text < Window_Base
  826. #--------------------------------------------------------------------------
  827. # ● オブジェクト初期化
  828. #--------------------------------------------------------------------------
  829. def initialize(x, y, designate_text)
  830.    super(x-16, y-16, 32 + designate_text.size * 12, 56)
  831.    self.opacity = 0
  832.    self.back_opacity = 0
  833.    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  834.    w = self.contents.width
  835.    h = self.contents.height
  836.    self.contents.draw_text(0, 0, w, h, designate_text)
  837. end
  838. #--------------------------------------------------------------------------
  839. # ● 解放
  840. #--------------------------------------------------------------------------
  841. def dispose
  842.    self.contents.clear
  843.    super
  844. end
  845. end
  846.  
  847.  
  848.  
  849. #==============================================================================
  850. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  851. #==============================================================================


文件导好了


然后

最后却是 {:2_271:}

Lv1.梦旅人

梦石
0
星屑
50
在线时间
52 小时
注册时间
2006-9-2
帖子
782
2
发表于 2014-1-5 04:21:45 | 只看该作者
建议换个脚本,柳柳《三国凡人传》里的脚本推荐,主站上有下载
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
600
在线时间
1118 小时
注册时间
2012-12-24
帖子
831
3
发表于 2014-1-5 08:36:13 | 只看该作者
我目测头像名后面应该不要加.png只要是png格式就行了

点评

0.0真的是这样...额好尴尬,一没留意就连格式都直接复制黏贴过来了- -|||  发表于 2014-1-5 17:02

评分

参与人数 1星屑 +90 收起 理由
myownroc + 90 认可答案

查看全部评分


点击签名档去一个神奇的地方
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
23 小时
注册时间
2013-8-30
帖子
27
4
 楼主| 发表于 2014-1-6 19:59:55 | 只看该作者
@ ︶ㄣ牛排ぶ  认可2楼

点评

0.0为什么不认可我  发表于 2014-1-10 19:30
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
445
在线时间
377 小时
注册时间
2012-11-5
帖子
267
5
发表于 2014-1-7 20:59:13 | 只看该作者
本帖最后由 789456qwe 于 2014-1-7 21:01 编辑

“l”要大写  “L”    R也是{:2_270:}
说明
54行
55行
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
23 小时
注册时间
2013-8-30
帖子
27
6
 楼主| 发表于 2014-1-10 19:34:09 | 只看该作者
江户川洛奇 发表于 2014-1-5 08:36
我目测头像名后面应该不要加.png只要是png格式就行了

我错了是3楼{:2_264:}
其实我在手动认可里面写了3楼,版主估计没注意看我回复,于是我又再这边写了一遍,不过写错了{:2_264:}
反正没召唤成功,再来召唤一次@myownroc   
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 05:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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