Project1

标题: 关于滚动字幕的问题 [打印本页]

作者: ACMREN    时间: 2010-11-14 14:38
标题: 关于滚动字幕的问题
为啥我调用了滚动字幕的脚本之后,就一直是黑屏,没有任何字幕出现?
作者: 大虫    时间: 2010-11-14 19:41
  1. #脚本功能:字幕系统
  2. #使用方法:main之前建立一个类,全选后粘贴。将脚本中的人名替换为自己要写的内容。
  3. #使用的时候在事件中使用脚本$scene = Scene_Credit.new,播放完之后返回开头画面。
  4. #如果想播放完之后返回地图,$scene = Scene_Credit.new(Scene_Map)
  5. #效果:谢幕字幕
  6. #版权:未知,有任何版权纠纷,本站不负任何责任。

  7. # Scene_Credit
  8. #
  9. # 制作人员名单
  10. #

  11. class Scene_Credit
  12.   CREDIT=<<_END_

  13. 这里填内容
  14. _END_
  15. end

  16. class Scene_Credit

  17.   def initialize(return_scene = nil)
  18.     if return_scene.nil?
  19.       return_scene = Scene_Title.new
  20.     end
  21.     @return_scene = return_scene
  22.   end
  23.   
  24.   def scene_start
  25.     credit_lines = CREDIT.split(/\n/)
  26.     credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
  27.     credit_lines.each_index do |i|
  28.       line = credit_lines [ i ]
  29.       credit_bitmap.draw_text(0,i * 32,640,32,line,1)
  30.     end
  31.     @credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
  32.     @credit_sprite.bitmap = credit_bitmap
  33.     @credit_sprite.oy = -430
  34.     @frame_index = 0
  35.     @last_flag = false
  36.   end

  37.   def scene_end
  38.     @credit_sprite.dispose
  39.   end
  40.   
  41.   def last?
  42.     return (@frame_index >= @credit_sprite.bitmap.height + 480)
  43.   end
  44.   
  45.   def last
  46.     if not @last_flag
  47.       Audio.bgm_fade(10000)
  48.       @last_flag = true
  49.       @last_count = 0
  50.     else
  51.       @last_count += 1
  52.     end
  53.     if @last_count >= 300
  54.       $scene = @return_scene
  55.     end
  56.   end
  57.   
  58.   def update
  59.     @frame_index += 1
  60.     return if cancel?
  61.     last if last?
  62.     @credit_sprite.oy += 1
  63.   end

  64.   def cancel?
  65.     if Input.trigger?(Input::B)
  66.       $scene = @return_scene
  67.       return true
  68.     end
  69.     return false
  70.   end

  71.   def main
  72.     scene_start
  73.     # 过渡
  74.     Graphics.transition
  75.     # 主循环
  76.     loop do
  77.       Graphics.update
  78.       Input.update
  79.       update
  80.       if $scene != self
  81.         break
  82.       end
  83.     end
  84.     # 准备过渡
  85.     Graphics.freeze
  86.     scene_end
  87.   end
  88. end

复制代码
完毕
作者: 沙之爱罗    时间: 2010-11-15 06:49
因为你根本没打字,所以一直黑屏了




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1