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

Project1

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

[已经解决] 关于XP对话框显示头像问题

[复制链接]

Lv2.观梦者

梦石
0
星屑
706
在线时间
127 小时
注册时间
2013-2-16
帖子
428
跳转到指定楼层
1
 楼主| 发表于 2013-2-26 18:55:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
  伸手党来也!!!
  想用一个不麻烦的东西来显示对话框中的头像,记住,不要对我说“Fuki对话框”脚本,太麻烦了!

Lv1.梦旅人

梦石
0
星屑
63
在线时间
246 小时
注册时间
2012-4-4
帖子
211
2
发表于 2013-2-26 18:58:55 | 只看该作者
好像主站上有。。。
6R,好久不见。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
706
在线时间
127 小时
注册时间
2013-2-16
帖子
428
3
 楼主| 发表于 2013-2-26 19:33:44 | 只看该作者
水终结者 发表于 2013-2-26 18:58
好像主站上有。。。

找了很长事件都没找到,你截个图!
回复 支持 反对

使用道具 举报

Lv2.观梦者 (暗夜天使)

万兽

梦石
0
星屑
597
在线时间
2271 小时
注册时间
2006-11-4
帖子
4868

贵宾

4
发表于 2013-2-26 22:01:35 | 只看该作者
直接显示图片不就好了。
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
605
在线时间
194 小时
注册时间
2012-6-1
帖子
720
5
发表于 2013-2-27 02:52:21 | 只看该作者
LZ是伸手党
鉴定完毕
LZ可以试试66对话加强
死亡
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3065
在线时间
1429 小时
注册时间
2009-7-27
帖子
1448
6
发表于 2013-2-27 05:54:43 | 只看该作者
太麻烦?直接公共事件显示各个人物的头像就好了。连脚本都不用了呢

博客:我的博客
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
63
在线时间
246 小时
注册时间
2012-4-4
帖子
211
7
发表于 2013-3-1 18:12:54 | 只看该作者
1715063941 发表于 2013-2-27 02:52
LZ是伸手党
鉴定完毕
LZ可以试试66对话加强

加强好像没这个功能
6R,好久不见。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
63
在线时间
246 小时
注册时间
2012-4-4
帖子
211
8
发表于 2013-3-1 18:20:34 | 只看该作者
本帖最后由 水终结者 于 2013-3-1 18:21 编辑


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

点评

这事啥玩意呀?你确定有用,我看此脚本的标题和我说的不一样呀! 还有很麻烦!这事我最不想要的!  发表于 2013-3-1 22:24

评分

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

查看全部评分

6R,好久不见。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
63
在线时间
246 小时
注册时间
2012-4-4
帖子
211
9
发表于 2013-3-2 18:16:35 | 只看该作者
这已经是最简单的了,只要在显示文章上输入就可以了,不会在对话中显示出来,如果还觉得麻烦就直接用显示图片事件好了。

点评

图片的位置很难弄,而且很麻烦  发表于 2013-3-2 18:20
6R,好久不见。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
423 小时
注册时间
2011-3-11
帖子
299
10
发表于 2013-3-2 18:28:46 | 只看该作者
同学,如果你连显示图片坐标位置都懒得自己去调,我建议你放弃XP。VX和VA有自带显示头像。楼上给出的是最简单有效的对话框脚本,六楼给出的是最简单有效的显示头像的方法。是最适用于新手的。如果它们无法入你法眼,那么我觉得XP无法满足你。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 21:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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