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

Project1

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

关于对话框

 关闭 [复制链接]

Lv1.梦旅人

┿动サ漫FANS

梦石
0
星屑
50
在线时间
2 小时
注册时间
2007-7-6
帖子
508
跳转到指定楼层
1
发表于 2008-6-9 05:04:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我想做个游戏
我看上了 幻の飞鱼 做的那个R剧    痕  
里面那个对话框 看起来很实用
但是我复制过来 把图片弄过来 试下 为什么我这边看不到图片呢
此贴于 2008-6-8 21:21:47 被版主havealook提醒,请楼主看到后对本贴做出回应。
版务信息:本贴由楼主自主结贴~
[fly][/fly]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-29
帖子
826
2
发表于 2008-6-9 05:06:24 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
27 小时
注册时间
2008-2-13
帖子
1740
3
发表于 2008-6-9 05:07:55 | 只看该作者
http://rpg.blue/web/htm/news726.htm
http://rpg.blue/web/htm/news347.htm
http://rpg.blue/web/htm/news197.htm
http://rpg.blue/web/htm/news963.htm

不清楚LZ要哪个
好吧,果然换个签名就没人认识我了。我承认我被时间埋没了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

┿动サ漫FANS

梦石
0
星屑
50
在线时间
2 小时
注册时间
2007-7-6
帖子
508
4
 楼主| 发表于 2008-6-9 05:28:29 | 只看该作者
图片
像这样的
[fly][/fly]
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
27 小时
注册时间
2008-2-13
帖子
1740
5
发表于 2008-6-9 05:31:16 | 只看该作者
看不到图片 - -
请看3L我给的连接
好吧,果然换个签名就没人认识我了。我承认我被时间埋没了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
27 小时
注册时间
2008-2-13
帖子
1740
6
发表于 2008-6-9 06:01:10 | 只看该作者
就是这个:http://rpg.blue/web/htm/news963.htm
把那个的Windowskin里面的文件复制到自己游戏的Windowskin,并设置窗口外观就行了
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
好吧,果然换个签名就没人认识我了。我承认我被时间埋没了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

┿动サ漫FANS

梦石
0
星屑
50
在线时间
2 小时
注册时间
2007-7-6
帖子
508
7
 楼主| 发表于 2008-6-9 06:20:25 | 只看该作者
但是怎么弄他那效果啊
他那下面有个黑蓝的框框 那可不是WINDOWS哦
那是一张图片
我把 他那R剧 脚本发给你看
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. #——说明

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  277.     @now_text.gsub!(/\\[>]/) { "\016" }
  278.     @now_text.gsub!(/\\[<]/) { "\017" }
  279.     @now_text.gsub!(/\\[!]/) { "\020" }
  280.     @now_text.gsub!(/\\[~]/) { "\021" }
  281.    
  282.     @now_text.gsub!(/\\[Ii]/) { "\023" }
  283.     @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  284.     @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  285.     @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  286.     @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }
  287.     if @popchar >= -1
  288.       @text_save = @now_text.clone
  289.       @max_x = 0
  290.       @max_y = 4
  291.       for i in 0..3
  292.         line = @now_text.split(/\n/)[3-i]
  293.         @max_y -= 1 if line == nil and @max_y <= 4-i
  294.         next if line == nil
  295.         contents.font.size = Size
  296.         cx = contents.text_size(line).width
  297.         @max_x = cx if cx > @max_x
  298.       end
  299.       if @right_picture != nil and !@right_picture.disposed?
  300.         self.width = @max_x + 48 + @face_indent + @right_picture.bitmap.width
  301.       else
  302.         self.width = @max_x + 48 + @face_indent
  303.       end
  304.       if $game_temp.num_input_variable_id > 0
  305.         self.height = (@max_y - 1) * 20 + 96 + 8
  306.       else
  307.         self.height = (@max_y - 1) * 20 + 64
  308.       end
  309.     else
  310.       @max_x = self.width - 32 - @face_indent
  311.     end
  312.     reset_window
  313.       if name_window_set
  314.         off_x = 0
  315.         off_y = -40
  316.         space = 2
  317.         x = self.x + off_x - space / 2
  318.         y = self.y + off_y - space / 2
  319.         w = self.contents.text_size(name_text).width + 26 + space
  320.         h = 40 + space
  321.         x = self.x + off_x + 4
  322.         y = self.y + off_y
  323.         if name_text == Player_Name1
  324.           name_text = $game_actors[1].name
  325.         elsif name_text == Player_Name2
  326.           name_text = "弘子"
  327.         elsif name_text == Player_Name3
  328.           name_text = "清儿"
  329.         end
  330.         @name_window_text = Air_Text.new(self.x + @face_indent+4+8, self.y+16, name_text)
  331.         @name_window_text.z = self.z + 2
  332.         @bar = Sprite.new
  333.         @bar.bitmap = Bitmap.new(self.width,self.height)
  334.         @bar.x = self.x
  335.         @bar.y = self.y
  336.         @bar.z = self.z + 2
  337.         @bar.bitmap.fill_rect(8,16,self.width-16,24,Color.new(120,180,250,80))
  338.       end
  339.     end
  340.     reset_window
  341.     if $game_temp.choice_max > 0
  342.       @item_max = $game_temp.choice_max
  343.       self.active = true
  344.       self.index = 0
  345.     end
  346.     if $game_temp.num_input_variable_id > 0
  347.       digits_max = $game_temp.num_input_digits_max
  348.       number = $game_variables[$game_temp.num_input_variable_id]
  349.       @input_number_window = Window_InputNumber.new(digits_max)
  350.       @input_number_window.number = number
  351.       @input_number_window.x = self.x + @face_indent
  352.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  353.     end
  354.   end
  355.   #--------------------------------------------------------------------------
  356.   # ● 更新
  357.   #--------------------------------------------------------------------------
  358.   def update
  359.     super
  360.     if @fade_in
  361.       self.contents_opacity += 24
  362.       if @input_number_window != nil
  363.         @input_number_window.contents_opacity += 24
  364.       end
  365.       if self.contents_opacity == 255
  366.         @fade_in = false
  367.       end
  368.       return
  369.     end
  370.     @now_text = nil if @now_text == ""
  371.     if @now_text != nil and @mid_stop == false
  372.       if @write_wait > 0
  373.         @write_wait -= 1
  374.         return
  375.       end
  376.       text_not_skip = $game_system.typing
  377.       while true
  378.         @max_x = @x if @max_x < @x
  379.         @max_y = @y if @max_y < @y
  380.         if (c = @now_text.slice!(/./m)) != nil
  381.           if c == "\000"
  382.             c = "\\"
  383.           end
  384.           if c == "\001"
  385.             @now_text.sub!(/\[([0-9]+)\]/, "")
  386.             color = $1.to_i
  387.             if color >= 0 and color <= 7
  388.               self.contents.font.color = text_color(color)
  389.             end
  390.             c = ""
  391.           end
  392.           if c == "\002"
  393.             if @gold_window == nil and @popchar <= -1
  394.               @gold_window = Window_Gold.new
  395.               @gold_window.x = 560 - @gold_window.width
  396.               if $game_temp.in_battle
  397.                 @gold_window.y = 192
  398.               else
  399.                 @gold_window.y = self.y >= 128 ? 32 : 384
  400.               end
  401.               @gold_window.opacity = self.opacity
  402.               @gold_window.back_opacity = self.back_opacity
  403.             end
  404.             c = ""
  405.           end
  406.           if c == "\003"
  407.             @now_text.sub!(/\[([0-9]+)\]/, "")
  408.             speed = $1.to_i
  409.             if speed >= 0 and speed <= 19
  410.               @write_speed = speed
  411.             end
  412.             c = ""
  413.           end
  414.           if c == "\004"
  415.             @now_text.sub!(/\[(.*?)\]/, "")
  416.             buftxt = $1.dup.to_s
  417.             if buftxt.match(/\//) == nil and buftxt != "" then
  418.               $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  419.             else
  420.               $game_system.soundname_on_speak = buftxt.dup
  421.             end
  422.             c = ""
  423.           elsif c == "\004"
  424.             c = ""
  425.           end
  426.           if c == "\005"
  427.             @write_wait += 20
  428.             c = ""
  429.           end
  430.           if c == "\006"
  431.             @write_wait += 90
  432.             c = ""
  433.           end
  434.           if c == "\016"
  435.             text_not_skip = false
  436.             c = ""
  437.           end
  438.           if c == "\017"
  439.             text_not_skip = true
  440.             c = ""
  441.           end
  442.           if c == "\020"
  443.             @mid_stop = true
  444.             c = ""
  445.           end
  446.           if c == "\021"
  447.             terminate_message
  448.             return
  449.           end
  450.           if c == "\023"
  451.             @indent = @x
  452.             c = ""
  453.           end
  454.           if c == "\024"
  455.             @now_text.sub!(/\[([0-9]+)\]/, "")
  456.             @opacity = $1.to_i
  457.             c = ""
  458.           end
  459.           if c == "\025"
  460.             @now_text.sub!(/\[([0-9]+)\]/, "")
  461.             self.contents.font.size = [[$1.to_i, 6].max, 32].min
  462.             c = ""
  463.           end
  464.           if c == "\026"
  465.             @now_text.sub!(/\[([0-9]+)\]/, "")
  466.             @x += $1.to_i
  467.             c = ""
  468.           end
  469.           if c == "\027"
  470.             @now_text.sub!(/\[(.*?)\]/, "")
  471.             @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  472.             if $game_system.soundname_on_speak != ""
  473.               Audio.se_play($game_system.soundname_on_speak)
  474.             end
  475.             c = ""
  476.           end
  477.           if c == "\030"
  478.             @now_text.sub!(/\[(.*?)\]/, "")
  479.             self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  480.            if $game_system.soundname_on_speak != ""
  481.               Audio.se_play($game_system.soundname_on_speak)
  482.             end
  483.             @x += 24
  484.             c = ""
  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.             self.contents.font.size = Size
  501.             @x += opacity_draw_text(self.contents, @x, 8+@y * line_height + (line_height - self.contents.font.size), c, @opacity)
  502.             if $game_system.soundname_on_speak != "" then
  503.             Audio.se_play($game_system.soundname_on_speak)
  504.             end
  505.           end
  506.           if Input.press?(Input::B)
  507.             text_not_skip = false
  508.           end
  509.         else
  510.           text_not_skip = true
  511.           break
  512.         end
  513.         # 終了判定
  514.         if text_not_skip
  515.           break
  516.         end
  517.       end
  518.       @write_wait += @write_speed
  519.       return
  520.     end
  521.     if @input_number_window != nil
  522.       @input_number_window.update
  523.       # 決定
  524.       if Input.trigger?(Input::C)
  525.         $game_system.se_play($data_system.decision_se)
  526.         $game_variables[$game_temp.num_input_variable_id] =
  527.         @input_number_window.number
  528.         $game_map.need_refresh = true
  529.         @input_number_window.dispose
  530.         @input_number_window = nil
  531.         terminate_message
  532.       end
  533.       return
  534.     end
  535.     if @contents_showing
  536.       if $game_temp.choice_max == 0
  537.         self.pause = true
  538.       end
  539.       # 取消
  540.       if Input.trigger?(Input::B)
  541.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  542.           $game_system.se_play($data_system.cancel_se)
  543.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  544.           terminate_message
  545.         end
  546.       end
  547.       # 決定
  548.       if Input.trigger?(Input::C)
  549.         if $game_temp.choice_max > 0
  550.           $game_system.se_play($data_system.decision_se)
  551.           $game_temp.choice_proc.call(self.index)
  552.         end
  553.         if @mid_stop
  554.           @mid_stop = false
  555.           return
  556.         else
  557.           terminate_message
  558.         end
  559.       end
  560.       return
  561.     end
  562.     if @fade_out == false and $game_temp.message_text != nil
  563.       @contents_showing = true
  564.       $game_temp.message_window_showing = true
  565.       refresh
  566.       Graphics.frame_reset
  567.       self.visible = true
  568.       self.contents_opacity = 0
  569.     if @input_number_window != nil
  570.       @input_number_window.contents_opacity = 0
  571.     end
  572.       @fade_in = true
  573.       return
  574.     end
  575.     if self.visible
  576.       @fade_out = true
  577.       self.opacity -= 48
  578.       if self.opacity == 0
  579.         self.visible = false
  580.         @fade_out = false
  581.         $game_temp.message_window_showing = false
  582.       end
  583.       return
  584.     end
  585.   end
  586.   #--------------------------------------------------------------------------
  587.   # ● 获得字符
  588.   #--------------------------------------------------------------------------
  589.   def get_character(parameter)
  590.     case parameter
  591.     when 0
  592.       return $game_player
  593.     else
  594.       events = $game_map.events
  595.       return events == nil ? nil : events[parameter]
  596.     end
  597.   end
  598.   #--------------------------------------------------------------------------
  599.   # ● ウィンドウの位置と不透明度の設定
  600.   #--------------------------------------------------------------------------
  601.   def reset_window
  602.       self.x = 0
  603.       self.y = 320
  604.       self.width = 640
  605.       self.height = 160
  606.         if @left_picture != nil and !@left_picture.disposed?
  607.           @left_picture.x = self.x+8
  608.           @left_picture.y = 480 - @left_picture.bitmap.height - 8
  609.           @left_picture.z += self.z
  610.         end
  611.         if @right_picture != nil and !@right_picture.disposed?
  612.           @right_picture.x = self.x+self.width-@right_picture.bitmap.width-8
  613.           @right_picture.y = 480 - @right_picture.bitmap.height - 8
  614.           @right_picture.z += self.z
  615.         end

  616.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  617.     if @face_file != nil
  618.       self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  619.     end
  620.     if @popchar == -2
  621.       self.opacity = 255
  622.       self.back_opacity = 0
  623.     elsif $game_system.message_frame == 0
  624.       self.opacity = 255
  625.       self.back_opacity = 200
  626.     else
  627.       self.opacity = 0
  628.       self.back_opacity = 200
  629.     end
  630.     if @popchar == -1
  631.       self.x = 120
  632.       self.y = 163
  633.       @back_picture.y = self.y
  634.       self.width = 640
  635.       self.height = 160
  636.     end
  637.       self.opacity = 0
  638.       self.back_opacity = 0
  639.   end
  640.   #--------------------------------------------------------------------------
  641.   # ● line_height
  642.   #--------------------------------------------------------------------------
  643.   # 返回値:行高
  644.   #--------------------------------------------------------------------------
  645.   def line_height
  646.     return 20
  647.     if self.contents.font.size >= 20 and self.contents.font.size <= 24
  648.       return 20
  649.     else
  650.       return self.contents.font.size * 15 / 10
  651.     end
  652.   end
  653.   #--------------------------------------------------------------------------
  654.   # ● 透過文字描画
  655.   #--------------------------------------------------------------------------
  656.   # target :描画対象。Bitmapクラスを指定。
  657.   # x :x座標
  658.   # y :y座標
  659.   # str  :描画文字列
  660.   # opacity:透過率(0~255)
  661.   # 返回値 :文字幅(@x増加値)。
  662.   #--------------------------------------------------------------------------
  663.   def opacity_draw_text(target, x, y, str,opacity)
  664.     height = target.font.size
  665.     width = target.text_size(str).width
  666.     opacity = [[opacity, 0].max, 255].min
  667.     if opacity == 255
  668.       target.draw_text(x, y, width, height, str)
  669.       return width
  670.     else
  671.       if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  672.         @opacity_text_buf.dispose
  673.         @opacity_text_buf = Bitmap.new(width, height)
  674.       else
  675.         @opacity_text_buf.clear
  676.       end
  677.       @opacity_text_buf.font.size = target.font.size
  678.       @opacity_text_buf.draw_text(0, 0, width, height, str)
  679.       target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  680.     return width
  681.     end
  682.   end
  683.   def ruby_draw_text(target, x, y, str,opacity)
  684.     sizeback = target.font.size
  685.     target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  686.     rubysize = [rubysize, 6].max
  687.    
  688.     opacity = [[opacity, 0].max, 255].min
  689.     split_s = str.split(/,/)
  690.    
  691.     split_s[0] == nil ? split_s[0] = "" : nil
  692.     split_s[1] == nil ? split_s[1] = "" : nil
  693.    
  694.     height = sizeback + rubysize
  695.     width = target.text_size(split_s[0]).width
  696.    
  697.     target.font.size = rubysize
  698.     ruby_width = target.text_size(split_s[1]).width
  699.     target.font.size = sizeback
  700.    
  701.     buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  702.    
  703.     width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  704.    
  705.     if opacity == 255
  706.       target.font.size = rubysize
  707.       target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  708.       target.font.size = sizeback
  709.       target.draw_text(x, y, width, target.font.size, split_s[0])
  710.       return width
  711.     else
  712.       if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  713.         @opacity_text_buf.dispose
  714.         @opacity_text_buf = Bitmap.new(buf_width, height)
  715.       else
  716.         @opacity_text_buf.clear
  717.       end
  718.       @opacity_text_buf.font.size = rubysize
  719.       @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  720.       @opacity_text_buf.font.size = sizeback
  721.       @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  722.       if sub_x >= 0
  723.         target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  724.       else
  725.         target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  726.       end
  727.       return width
  728.     end
  729.   end
  730.   #--------------------------------------------------------------------------
  731.   # ● \V 变换
  732.   #--------------------------------------------------------------------------
  733.   def convart_value(option, index)
  734.     option == nil ? option = "" : nil
  735.     option.downcase!
  736.     case option
  737.       when "i"
  738.         unless $data_items[index].name == nil
  739.           r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  740.         end
  741.       when "w"
  742.         unless $data_weapons[index].name == nil
  743.           r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  744.         end
  745.       when "a"
  746.         unless $data_armors[index].name == nil
  747.           r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  748.         end
  749.       when "s"
  750.         unless $data_skills[index].name == nil
  751.           r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  752.         end
  753.       else
  754.       r = $game_variables[index]
  755.     end
  756.     r == nil ? r = "" : nil
  757.     return r
  758.   end
  759.   #--------------------------------------------------------------------------
  760.   # ● 解放
  761.   #--------------------------------------------------------------------------
  762.   def dispose
  763.     terminate_message
  764.     if @gaiji_cache != nil
  765.       unless @gaiji_cache.disposed?
  766.         @gaiji_cache.dispose
  767.       end
  768.     end
  769.     unless @opacity_text_buf.disposed?
  770.       @opacity_text_buf.dispose
  771.     end
  772.     $game_temp.message_window_showing = false
  773.     if @input_number_window != nil
  774.       @input_number_window.dispose
  775.     end
  776.     super
  777.   end
  778.   #--------------------------------------------------------------------------
  779.   # ● 矩形更新
  780.   #--------------------------------------------------------------------------
  781.   def update_cursor_rect
  782.     if @index >= 0
  783.       n = $game_temp.choice_start + @index
  784.       self.cursor_rect.set(4 + @indent + @face_indent, n * 20 + 10, @cursor_width, 20)
  785.     else
  786.       self.cursor_rect.empty
  787.     end
  788.   end
  789. end
  790. #==============================================================================
  791. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  792. #==============================================================================
  793. class Window_Frame < Window_Base
  794.   #--------------------------------------------------------------------------
  795.   # ● オブジェクト初期化
  796.   #--------------------------------------------------------------------------
  797.   def initialize(x, y, width, height)
  798.     super(x, y, width, height)
  799.     self.contents = nil
  800.     self.back_opacity = 200
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # ● 解放
  804.   #--------------------------------------------------------------------------
  805.   def dispose
  806.     super
  807.     end
  808.   end
  809. #==============================================================================
  810. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  811. #==============================================================================
  812. class Air_Text < Window_Base
  813.   #--------------------------------------------------------------------------
  814.   # ● オブジェクト初期化
  815.   #--------------------------------------------------------------------------
  816.   def initialize(x, y, designate_text)
  817.     super(x-16, y-16, 32 + designate_text.size * 12, 56)
  818.     self.opacity = 0
  819.     self.back_opacity = 0
  820.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  821.     self.contents.font.size = 20
  822.     w = self.contents.width
  823.     h = self.contents.height
  824.     self.contents.draw_text(0, 0, w, h, designate_text)
  825.   end
  826.   #--------------------------------------------------------------------------
  827.   # ● 解放
  828.   #--------------------------------------------------------------------------
  829.   def dispose
  830.     self.contents.clear
  831.     super
  832.   end
  833. end

  834. #==============================================================================
  835. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  836. #==============================================================================
复制代码
[fly][/fly]
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
39951
在线时间
5806 小时
注册时间
2006-11-10
帖子
6680
8
发表于 2008-6-9 09:05:41 | 只看该作者
= =貌似这个效果很容易实现的说...

更改对话框消失...显示图片。OK.....
回复 支持 反对

使用道具 举报

Lv1.梦旅人

┿动サ漫FANS

梦石
0
星屑
50
在线时间
2 小时
注册时间
2007-7-6
帖子
508
9
 楼主| 发表于 2008-6-9 09:25:39 | 只看该作者
有道理
但是我才想到一个不用脚本的方法
可以弄头像
那就是………
[fly][/fly]
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-8-3 18:17

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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