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

Project1

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

[已经过期] 【请教+求助】半身像显示问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
55
在线时间
14 小时
注册时间
2009-9-24
帖子
15
跳转到指定楼层
1
发表于 2010-9-26 23:27:35 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 chaofansea 于 2010-9-28 14:39 编辑

使用了这个脚本,但是为什么其他功能都可以实现,就是
# \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
# \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”
这两句的功能不能实现呢(即显示图片)?
还是输入的时候有要求??



还有就是好像看别人使用了\f[xx]功能显示头像,自己使用貌似没什么反应。。莫非人家是修改过脚本的?
  
好像把脚本插在main前 和直接替换Window_Message有点不一样吧?我是不懂脚本的菜鸟,所以不知道不同在哪里、、、、
新手,求助·
希望高手可以指点~~:)

~~谢谢~~~
  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————
  4. #——说明
  5. #默认为一个字一个字的方式,如果需要一次全部显示,
  6. #请在游戏中使用脚本:$game_system.typing = true
  7. # 其他在对话中可以使用的功能:

  8. # \n[1]:显示1号角色的姓名
  9. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
  10. # \name[\n[1]]:显示1号主角的姓名方框
  11. # \p[1]:对话框出现在1号事件的上方
  12. # \p[0]:主人公上方出现对话框
  13. #——————————————————使用\p功能后可以自动调整对话框大小
  14. # \>   :文字不用打字方式
  15. # \<   :文字使用打字方式
  16. # \\:显示"\"这个符号
  17. # \c[1-8]:更改颜色
  18. # \g:显示金钱窗口
  19. # \t: 显示游戏时间窗口
  20. # \v[7]:显示7号变量的值
  21. # \v[a7]:显示7号防具的名称
  22. # \v[s7]:显示7号特技的名称
  23. # \v[w7]:显示7号武器的名称
  24. # \v[i7]:显示7号道具的名称
  25. # \I   :下一行从这个位置开始
  26. # \o[123]:文字透明度改为123,模拟将死之人(汗)
  27. # \h[12]:改用12号字
  28. # \b[50]:空50象素
  29. # \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
  30. # \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”
  31. # \Lk:清除左边的图像
  32. # \Rk:清除右边的图像
  33. # \A:头像及姓名框靠左排列
  34. # \a:头像及姓名框靠右排列
  35. # \M[60]:等待60帧文字直接消失
  36. # \MS[1-8]:更改文字背景颜色
  37. # \ME:恢复文字背景颜色
  38. #颜色自定义设定范围0-255
  39. #使用方法:在文章前输入如下脚本定义颜色
  40. #          $color0 = 数值
  41. #          $color1 = 数值
  42. #          $color2 = 数值
  43. #\name参数的颜色自定义设定范围0-255
  44. #使用方法:在文章前输入如下脚本定义颜色
  45. #          $ncolor0 = 数值
  46. #          $ncolor1 = 数值
  47. #          $ncolor2 = 数值
  48. # \!   :等待玩家按回车再继续
  49. #$speed :文字的打字速度设置用的,数字越大速度越慢。

  50. #============================
  51. class Game_System
  52. attr_accessor :typing
  53. alias carol3_ini initialize
  54. def initialize
  55. carol3_ini
  56. @typing = true
  57. end
  58. end
  59. #=================================#==============================================================================
  60. # ■ Window_Message
  61. #------------------------------------------------------------------------------
  62. class Window_Message < Window_Selectable
  63.   #颜色自定义用的全局变量定义
  64.   $color0 = 255
  65.   $color1 = 255
  66.   $color2 = 255
  67.   #颜色自定义用的全局变量定义
  68.   
  69.   #说话速度设置用的全局变量
  70.   
  71.   $speed = 1
  72.   
  73. #--------------------------------------------------------------------------
  74. # ● 初始化状态
  75. #--------------------------------------------------------------------------
  76. def initialize
  77.   super(80, 304, 540, 160)
  78.   self.contents = Bitmap.new(width - 40, height - 32)
  79.   self.visible = false
  80.   self.z = 199
  81.   @fade_in = false
  82.   @fade_out = false
  83.   @contents_showing = false
  84.   @cursor_width = 0
  85. # Start
  86.   @bflag = false
  87. # End
  88.   @autoclosetime = -1
  89.   self.active = false
  90.   self.index = -1
  91.   @opacity_text_buf = Bitmap.new(32, 32)
  92. end
  93. #--------------------------------------------------------------------------
  94. # ● 释放
  95. #--------------------------------------------------------------------------
  96. def dispose
  97.   terminate_message
  98.   $game_temp.message_window_showing = false
  99.   if @input_number_window != nil
  100.     @input_number_window.dispose
  101.   end
  102.   super
  103. end
  104. #--------------------------------------------------------------------------
  105. # ● 处理信息结束
  106. #--------------------------------------------------------------------------
  107. def terminate_message
  108.   self.active = false
  109.   self.pause = false
  110.   self.index = -1
  111.   self.contents.clear
  112.   # 清除显示中标志
  113.   @contents_showing = false
  114.   # 呼叫信息调用
  115.   if $game_temp.message_proc != nil
  116.     $game_temp.message_proc.call
  117.   end
  118.   # 清除文章、选择项、输入数值的相关变量
  119.   $game_temp.message_text = nil
  120.   $game_temp.message_proc = nil
  121.   $game_temp.choice_start = 99
  122.   $game_temp.choice_max = 0
  123.   $game_temp.choice_cancel_type = 0
  124.   $game_temp.choice_proc = nil
  125.   $game_temp.num_input_start = 99
  126.   $game_temp.num_input_variable_id = 0
  127.   $game_temp.num_input_digits_max = 0
  128.   # 开放金钱窗口
  129.   if @gold_window != nil
  130.     @gold_window.dispose
  131.     @gold_window = nil
  132.   end
  133. #Start
  134.   # ピクチャ廃棄処理
  135.   begin
  136. #      if @spgra.disposed? == false
  137.       @spgra.dispose
  138. #      end
  139. #      if @backgraphic.disposed? == false
  140.       @backgraphic.dispose
  141. #      end
  142.   rescue
  143. #      print "ピクチャが読み込めていません!"
  144.   end
  145. #End
  146.   # 开放时间窗口
  147.   if @playtime_window != nil
  148.     @playtime_window.dispose
  149.     @playtime_window = nil
  150.   end
  151.   if @name_window_frame != nil
  152.     @name_window_frame.dispose
  153.     @name_window_frame = nil
  154.   end
  155.   if @name_window_text != nil
  156.     @name_window_text.dispose
  157.     @name_window_text = nil
  158.   end
  159.   if @right_picture != nil and @right_keep == true
  160.     @right_picture.dispose
  161.   end   
  162.   if @left_picture != nil and @left_keep == true
  163.     @left_picture.dispose
  164.   end
  165.   @face_bitmap = nil
  166. end
  167. def refresh
  168.   # 初期化
  169.   self.contents.clear
  170.   self.contents.font.color = normal_color
  171.   self.contents.font.size = Font.default_size
  172.   @x = @y = @max_x = @max_y = @indent = @lines = 0
  173.   @left_keep = @right_keep = false
  174.   @face_indent = 0
  175.   @opacity = 255
  176.   @cursor_width = 0
  177.   @autoclosetime = -1
  178.   @write_speed = $speed
  179.   @write_wait = 0
  180.   @mid_stop = false
  181.   face = nil
  182.   @popchar = -2
  183.   @alignment = true
  184.   if $game_temp.choice_start == 0
  185.     @x = 8
  186.   end
  187.   if $game_temp.message_text != nil
  188.     @now_text = $game_temp.message_text
  189.     #——对齐设置
  190.     if (/\\([Aa])/.match(@now_text))!=nil then
  191.       if $1 == "A"
  192.         @alignment = true
  193.       else
  194.         @alignment = false
  195.       end
  196.       @now_text.gsub!(/\\([Aa])/) { "" }
  197.     end
  198.     #——头像设置
  199.      if (/\\([Ff])\[(.+?)\]/.match(@now_text))!=nil then
  200.        @face = $2 + "_f.png"
  201.        if $1 == "f" and $game_actors[$2.to_i] != nil
  202.          face = $game_actors[$2.to_i].battler_name + "_f.png"
  203.        end
  204.        if FileTest.exist?("Graphics/Pictures/#{face}")
  205.          @face_bitmap = Bitmap.new("Graphics/Pictures/#{face}")
  206.          if @alignment
  207.            @x = @face_indent = 128
  208.            self.contents.blt(16, 16, @face_bitmap, Rect.new(0, 0, 96, 96))
  209.          else
  210.            self.contents.blt(self.contents.width - 112, 16, @face_bitmap,
  211.              Rect.new(0, 0, 96, 96))
  212.          end
  213.        else
  214.          face = nil
  215.          @face_bitmap = nil
  216.        end
  217.        @now_text.gsub!(/\\([Ff])\[(.*?)\]/) { "" }
  218.      end
  219.     #——左半身像设置
  220.     if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  221.       @face = $1 + "_h.png"
  222.       if $加密 == true
  223.         if @left_picture != nil
  224.           @left_picture.dispose
  225.         end
  226.         @left_picture = Sprite.new
  227.         @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  228.         @left_picture.y = 480-@left_picture.bitmap.height
  229.         @left_picture.x = 0
  230.         @left_picture.mirror = true
  231.         @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  232.       else         
  233.         if FileTest.exist?("Graphics/battlers/#{@face}")
  234.           if @left_picture != nil
  235.             @left_picture.dispose
  236.           end
  237.           @left_picture = Sprite.new
  238.           @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  239.           @left_picture.y = 480-@left_picture.bitmap.height
  240.           @left_picture.x = 0
  241.           @left_picture.mirror = true
  242.           @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  243.         end
  244.       end        
  245.     end
  246.     #——右半身像设置
  247.     if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  248.       @face =  $1 + "_h.png"
  249.       if $加密 == true
  250.         if @right_picture != nil
  251.           @right_picture.dispose
  252.         end
  253.         @right_picture = Sprite.new
  254.         @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  255.         @right_picture.y = 480-@right_picture.bitmap.height
  256.         @right_picture.x = 640-@right_picture.bitmap.width
  257.         @right_picture.z = 9999
  258.         @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  259.       else
  260.         if FileTest.exist?("Graphics/battlers/#{@face}")
  261.           if @right_picture != nil
  262.             @right_picture.dispose
  263.           end
  264.           @right_picture = Sprite.new
  265.           @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  266.           @right_picture.y = 480-@right_picture.bitmap.height
  267.           @right_picture.x = 640-@right_picture.bitmap.width
  268.           @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  269.         end
  270.       end
  271.     end
  272.     if (/\\[Rr]k/.match(@now_text)) != nil
  273.       @right_keep = true
  274.       @now_text.sub!(/\\[Rr]k/) { "" }
  275.     end
  276.     if (/\\[Ll]k/.match(@now_text)) != nil
  277.       @left_keep = true
  278.       @now_text.sub!(/\\[Ll]k/) { "" }
  279.     end
  280.     # 替换人物姓名
  281.     @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  282.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  283.     end
  284.     # 显示人物姓名
  285.     name_window_set = false
  286.     if (/\\[Nn][Aa][Mm][Ee](.*?)\[(.+?)\]/.match(@now_text)) != nil
  287.       name_window_set = true
  288.       name_text = $2
  289.       @now_text.sub!(/\\[Nn][Aa][Mm][Ee](.*?)\[(.*?)\]/) { "" }
  290.     end
  291.     # 文字位置的判定
  292.     if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  293.       @popchar = $1.to_i
  294.       if @popchar == -1
  295.         @x = @indent = 48
  296.         @y = 4
  297.       end
  298.       @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  299.     end
  300.    
  301.     # 开始
  302.     begin
  303.       last_text = @now_text.clone
  304.       @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  305.     end until @now_text == last_text
  306.   @now_text.gsub!(/\\\\/) { "\000" }
  307.   @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  308.   @now_text.gsub!(/\\[Gg]/) { "\002" }
  309.   @now_text.gsub!(/\\[Tt]/) { "\004" }
  310.   @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) { "\050[#{$1}]" }
  311.   @now_text.gsub!(/\\[Ii]/) { "\023" }
  312.   @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  313.   @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  314.   @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  315.   @now_text.gsub!(/\\[Dd]\[([0-9]+)\]/) { "\027[#{$1}]" }
  316.   @now_text.gsub!(/\\[!]/) { "\020" }
  317. @now_text.gsub!(/\\[>]/) { "\016" }
  318. @now_text.gsub!(/\\[<]/) { "\017" }

  319. # Start
  320. # ◎
  321.     # "\\MS" を "\052" に、 "\\ME" を "\053" に変更
  322.     @now_text.gsub!(/\\[Mm][Ss]\[([0-9]+)\]/) { "\052[#{$1}]" }
  323.     @now_text.gsub!(/\\[Mm][Ee]/) { "\053" }
  324. # ◎
  325. # End

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


  891.   #参数的颜色自定义设定范围0-255
  892.   $ncolor0 = 255
  893.   $ncolor1 = 255
  894.   $ncolor2 = 255
  895.   #参数的颜色自定义设定范围0-255
  896.   
  897. #--------------------------------------------------------------------------
  898. # ● オブジェクト初期化
  899. #--------------------------------------------------------------------------
  900. def initialize(x, y, designate_text)
  901.   super(x-16, y-16, 32 + designate_text.size * 12, 56)
  902.   self.opacity = 0
  903.   self.back_opacity = 0
  904.   self.contents = Bitmap.new(self.width - 50, self.height - 32)
  905.   w = self.contents.width
  906.   h = self.contents.height

  907.   
  908.     #颜色自定义设定范围0-255
  909.     self.contents.font.color = Color.new($ncolor0, $ncolor1, $ncolor2)
  910.     #颜色自定义设定范围0-255

  911.    
  912.    
  913. #    self.contents.font.color = text_color(color)
  914.   self.contents.draw_text(0, 0, w, h, designate_text)
  915. end
  916. #--------------------------------------------------------------------------
  917. # ● 解放
  918. #--------------------------------------------------------------------------
  919. def dispose
  920.   self.contents.clear
  921.   super
  922. end
  923. end
复制代码

点评

问题得到解答后请去认可帖认可[url]http://bbs.66rpg.com/thread-155199-1-1.html[/url]  发表于 2010-10-8 12:23

Lv1.梦旅人

梦石
0
星屑
55
在线时间
14 小时
注册时间
2009-9-24
帖子
15
2
 楼主| 发表于 2010-9-27 19:27:21 | 只看该作者
有高手可以帮忙解答不?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
243
在线时间
341 小时
注册时间
2010-9-5
帖子
70
3
发表于 2010-9-28 10:05:58 | 只看该作者
L是在左边出现图片,那个是在右边。首先Graphics/battlers/66rpg_001_h.png这里面得有相同的命名图片,才可以调用啊!出现001图片,得有一个命名为66rpg-001-h。jpg的图片。你看看有没有。没然后了。
点击即可领养:
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
14 小时
注册时间
2009-9-24
帖子
15
4
 楼主| 发表于 2010-9-28 10:25:34 | 只看该作者
本帖最后由 chaofansea 于 2010-9-28 10:31 编辑
L是在左边出现图片,那个是在右边。首先Graphics/battlers/66rpg_001_h.png这里面得有相同的命名图片,才可 ...
令狐林 发表于 2010-9-28 10:05



而且如果没有图片可以调用的话会报错吧?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
14 小时
注册时间
2009-9-24
帖子
15
5
 楼主| 发表于 2010-9-28 10:29:52 | 只看该作者
应该是PNG格式吧?
而且好像也没用。。。

1.png (2.14 KB, 下载次数: 5)

应该是这样输入的吧??

应该是这样输入的吧??

2.png (10.17 KB, 下载次数: 5)

名字没错吧?

名字没错吧?

3.png (161.45 KB, 下载次数: 4)

效果没有。。。我不知道原因、、、

效果没有。。。我不知道原因、、、
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
115 小时
注册时间
2010-5-3
帖子
346
6
发表于 2010-9-28 14:48:44 | 只看该作者
回复 chaofansea 的帖子


    告诉你吧,你这个是出现了脚本冲突,也就是你的对话脚本有部分内容被其他脚本的内容覆盖了,老实说,楼主还用了什么脚本
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
1585
在线时间
8 小时
注册时间
2010-8-12
帖子
1
7
发表于 2010-9-28 17:26:36 | 只看该作者
要用PNG的格式,把.JPG改成.PNG试试
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
14 小时
注册时间
2009-9-24
帖子
15
8
 楼主| 发表于 2010-9-28 19:28:52 | 只看该作者
回复


    告诉你吧,你这个是出现了脚本冲突,也就是你的对话脚本有部分内容被其他脚本的内容覆盖了,老 ...
反斗奇彬 发表于 2010-9-28 14:48



不会吧。好像也没有其他脚本,除非跟系统本身的脚本冲突了~~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
14 小时
注册时间
2009-9-24
帖子
15
9
 楼主| 发表于 2010-9-28 19:34:58 | 只看该作者
要用PNG的格式,把.JPG改成.PNG试试
小子大人 发表于 2010-9-28 17:26




好像也不可以。。可能是你楼上那位大哥说的脚本冲突了。。。。

评分

参与人数 1星屑 -80 收起 理由
六祈 -80 请勿连帖

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
115 小时
注册时间
2010-5-3
帖子
346
10
发表于 2010-9-29 13:20:07 | 只看该作者
不会吧。好像也没有其他脚本,除非跟系统本身的脚本冲突了~~
chaofansea 发表于 2010-9-28 19:28



要不你试试只用这个脚本,保证没有这个问题
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-27 12:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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