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

Project1

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

[已经过期] 对话框怎么显示动画?

[复制链接]

Lv2.观梦者

故九江太守

梦石
0
星屑
573
在线时间
2161 小时
注册时间
2012-12-5
帖子
4463
跳转到指定楼层
1
发表于 2013-7-7 21:16:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
对话框显示动画怎么实现

点评

可以用任意坐标显示动画的脚本,然后就好咯  发表于 2013-7-8 20:48

Lv1.梦旅人

梦石
0
星屑
68
在线时间
585 小时
注册时间
2013-5-25
帖子
1524
2
发表于 2013-7-8 14:59:19 | 只看该作者
1.你指的是人物表情动画还是显示数据库里的动画还是对话框的动画效果
2.请上传你的脚本,如果你用了对话加强的话

点评

你会帮我回答吗……  发表于 2013-7-8 19:46
回复 支持 反对

使用道具 举报

Lv2.观梦者

故九江太守

梦石
0
星屑
573
在线时间
2161 小时
注册时间
2012-12-5
帖子
4463
3
 楼主| 发表于 2013-7-8 15:04:40 | 只看该作者
克莉丝 发表于 2013-7-8 14:59
1.你指的是人物表情动画还是显示数据库里的动画还是对话框的动画效果
2.请上传你的脚本,如果你用了对话加 ...

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



这是脚本,希望显示数据库内动画。并且循环
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1556
在线时间
626 小时
注册时间
2010-8-5
帖子
451
4
发表于 2013-8-19 09:06:23 | 只看该作者
本帖最后由 jiahui5592986 于 2013-8-19 09:11 编辑




使用方法:显示文章的时候,#+动画ID     

对话框显示动画.zip

209.94 KB, 下载次数: 67

评分

参与人数 1星屑 +30 收起 理由
你最珍贵 + 30 求整合我内个← ←

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-29 22:16

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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