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

Project1

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

[原创发布] RB的视频脚本教程【暂停更新,目前期数为8+4】

[复制链接]

Lv2.观梦者

梦石
0
星屑
375
在线时间
602 小时
注册时间
2014-5-8
帖子
699
1
发表于 2015-7-22 08:06:41 | 显示全部楼层
能不能教教怎么写队列系统呢?虽然有现成的,但是缺点太多,除了第一个角色,其他的角色不能判断坐标,还全是日文注释。

点评

可是XP不带  发表于 2015-7-22 11:37
VA自带。  发表于 2015-7-22 08:15
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
375
在线时间
602 小时
注册时间
2014-5-8
帖子
699
2
发表于 2015-7-26 13:42:05 | 显示全部楼层
按照你的那个逐字描绘的教程,我做出来的为什么什么字都没有呢,不知道哪一步做错了,帮忙看看呗(前面的名称窗口的头像没加,直接做的逐字描绘)
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Window_Message
  3. #------------------------------------------------------------------------------
  4. #  显示文章的信息窗口。
  5. #==============================================================================
  6.  
  7. class Window_Message < Window_Selectable
  8.   Mes_Speed = 1
  9.   #--------------------------------------------------------------------------
  10.   # ● 初始化状态
  11.   #--------------------------------------------------------------------------
  12.   def initialize
  13.     super(80, 304, 480, 160)
  14.     self.contents = Bitmap.new(width - 32, height - 32)
  15.     self.visible = false
  16.     self.z = 9998
  17.     @fade_in = false
  18.     @fade_out = false
  19.     @contents_showing = false
  20.     @cursor_width = 0
  21.     @contents_drawing = false
  22.     @x = @y = 0
  23.     @delay = 0
  24.     @text = ""
  25.     self.active = false
  26.     self.index = -1
  27.   end
  28.   #--------------------------------------------------------------------------
  29.   # ● 释放
  30.   #--------------------------------------------------------------------------
  31.   def dispose
  32.     terminate_message
  33.     $game_temp.message_window_showing = false
  34.     if @input_number_window != nil
  35.       @input_number_window.dispose
  36.     end
  37.     super
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 处理信息结束
  41.   #--------------------------------------------------------------------------
  42.   def terminate_message
  43.     self.active = false
  44.     self.pause = false
  45.     self.index = -1
  46.     self.contents.clear
  47.     # 清除显示中标志
  48.     @contents_showing = false
  49.     # 呼叫信息调用
  50.     if $game_temp.message_proc != nil
  51.       $game_temp.message_proc.call
  52.     end
  53.     # 清除文章、选择项、输入数值的相关变量
  54.     $game_temp.message_text = nil
  55.     $game_temp.message_proc = nil
  56.     $game_temp.choice_start = 99
  57.     $game_temp.choice_max = 0
  58.     $game_temp.choice_cancel_type = 0
  59.     $game_temp.choice_proc = nil
  60.     $game_temp.num_input_start = 99
  61.     $game_temp.num_input_variable_id = 0
  62.     $game_temp.num_input_digits_max = 0
  63.     # 开放金钱窗口
  64.     if @gold_window != nil
  65.       @gold_window.dispose
  66.       @gold_window = nil
  67.     end
  68.     return
  69.     @text = text.clone
  70.   end
  71.  
  72.   def draw_single_character(c)
  73.     # \\ 的情况下
  74.         if c == "\000"
  75.           # 还原为本来的文字
  76.           c = "\\"
  77.         end
  78.         # \C[n] 的情况下
  79.         if c == "\001"
  80.           # 更改文字色
  81.           text.sub!(/\[([0-9]+)\]/, "")
  82.           color = $1.to_i
  83.           if color >= 0 and color <= 7
  84.             self.contents.font.color = text_color(color)
  85.           end
  86.           # 下面的文字
  87.           next
  88.         end
  89.         # \G 的情况下
  90.         if c == "\002"
  91.           # 生成金钱窗口
  92.           if @gold_window == nil
  93.             @gold_window = Window_Gold.new
  94.             @gold_window.x = 560 - @gold_window.width
  95.             if $game_temp.in_battle
  96.               @gold_window.y = 192
  97.             else
  98.               @gold_window.y = self.y >= 128 ? 32 : 384
  99.             end
  100.             @gold_window.opacity = self.opacity
  101.             @gold_window.back_opacity = self.back_opacity
  102.           end
  103.           # 下面的文字
  104.           next
  105.         end
  106.         # 另起一行文字的情况下
  107.         if c == "\n"
  108.           # 刷新选择项及光标的高
  109.           if y >= $game_temp.choice_start
  110.             @cursor_width = [@cursor_width, x].max
  111.           end
  112.           # y 加 1
  113.           y += 1
  114.           x = 0
  115.           # 移动到选择项的下一行
  116.           if y >= $game_temp.choice_start
  117.             x = 8
  118.           end
  119.           # 下面的文字
  120.           next
  121.         end
  122.         # 描绘文字
  123.         self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
  124.         # x 为要描绘文字的加法运算
  125.         x += self.contents.text_size(c).width
  126.     end
  127.   #--------------------------------------------------------------------------
  128.   # ● 设置窗口位置与不透明度
  129.   #--------------------------------------------------------------------------
  130.   def reset_window
  131.     if $game_temp.in_battle
  132.       self.y = 16
  133.     else
  134.       case $game_system.message_position
  135.       when 0  # 上
  136.         self.y = 16
  137.       when 1  # 中
  138.         self.y = 160
  139.       when 2  # 下
  140.         self.y = 304
  141.       end
  142.     end
  143.     if $game_system.message_frame == 0
  144.       self.opacity = 255
  145.     else
  146.       self.opacity = 0
  147.     end
  148.     self.back_opacity = 160
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● 刷新画面
  152.   #--------------------------------------------------------------------------
  153.   def update
  154.     super
  155.     # 渐变的情况下
  156.     if @fade_in
  157.       self.contents_opacity += 24
  158.       if @input_number_window != nil
  159.         @input_number_window.contents_opacity += 24
  160.       end
  161.       if self.contents_opacity == 255
  162.         @fade_in = false
  163.       end
  164.       @contents_drawing = true
  165.       return
  166.     end
  167.     if @contents_drawing
  168.       if @delay > 0
  169.         @delay -= 1
  170.         return
  171.       end
  172.       if @text != nil && (c = @text.slice!(/./m)) != nil
  173.         draw_single_character(c)
  174.         @delay = Mes_Speed
  175.         return
  176.       end
  177.       # 选择项的情况
  178.       if $game_temp.choice_max > 0
  179.         @item_max = $game_temp.choice_max
  180.         self.active = true
  181.         self.index = 0
  182.       end
  183.       # 输入数值的情况
  184.       if $game_temp.num_input_variable_id > 0
  185.         digits_max = $game_temp.num_input_digits_max
  186.         number = $game_variables[$game_temp.num_input_variable_id]
  187.         @input_number_window = Window_InputNumber.new(digits_max)
  188.         @input_number_window.number = number
  189.         @input_number_window.x = self.x + 8
  190.         @input_number_window.y = self.y + $game_temp.num_input_start * 32
  191.       end
  192.       @contents_drawing = false
  193.       return
  194.     end
  195.     # 输入数值的情况下
  196.     if @input_number_window != nil
  197.       @input_number_window.update
  198.       # 确定
  199.       if Input.trigger?(Input::C)
  200.         $game_system.se_play($data_system.decision_se)
  201.         $game_variables[$game_temp.num_input_variable_id] =
  202.           @input_number_window.number
  203.         $game_map.need_refresh = true
  204.         # 释放输入数值窗口
  205.         @input_number_window.dispose
  206.         @input_number_window = nil
  207.         terminate_message
  208.       end
  209.       return
  210.     end
  211.     # 显示信息中的情况下
  212.     if @contents_showing
  213.       # 如果不是在显示选择项中就显示暂停标志
  214.       if $game_temp.choice_max == 0
  215.         self.pause = true
  216.       end
  217.       # 取消
  218.       if Input.trigger?(Input::B)
  219.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  220.           $game_system.se_play($data_system.cancel_se)
  221.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  222.           terminate_message
  223.         end
  224.       end
  225.       # 确定
  226.       if Input.trigger?(Input::C)
  227.         if $game_temp.choice_max > 0
  228.           $game_system.se_play($data_system.decision_se)
  229.           $game_temp.choice_proc.call(self.index)
  230.         end
  231.         terminate_message
  232.       end
  233.       return
  234.     end
  235.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  236.     if @fade_out == false and $game_temp.message_text != nil
  237.       @contents_showing = true
  238.       $game_temp.message_window_showing = true
  239.       reset_window
  240.  
  241.       Graphics.frame_reset
  242.       self.visible = true
  243.       self.contents_opacity = 0
  244.       if @input_number_window != nil
  245.         @input_number_window.contents_opacity = 0
  246.       end
  247.       @fade_in = true
  248.       return
  249.     end
  250.     # 没有可以显示的信息、但是窗口为可见的情况下
  251.     if self.visible
  252.       @fade_out = true
  253.       self.opacity -= 48
  254.       if self.opacity == 0
  255.         self.visible = false
  256.         @fade_out = false
  257.         $game_temp.message_window_showing = false
  258.       end
  259.       return
  260.     end
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 刷新光标矩形
  264.   #--------------------------------------------------------------------------
  265.   def update_cursor_rect
  266.     if @index >= 0
  267.       n = $game_temp.choice_start + @index
  268.       self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  269.     else
  270.       self.cursor_rect.empty
  271.     end
  272.   end
  273. end
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-4 19:43

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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