Project1

标题: 滚动字幕(从XP移植) [打印本页]

作者: CIS狂人    时间: 2008-2-8 05:30
标题: 滚动字幕(从XP移植)
调试好的^使用时候用一个640*480的TIT.PNG放在下面.不用多说了吧.
  1. #——使用注意:默认会返回地图,如果需要返回开头,请将本脚本中的
  2. #return_scene = Scene_Map.new改为return_scene = Scene_Title.new

  3. class Scene_Credit
  4.   CREDIT=<<_END_
  5. #这里输入字幕内容

  6. _END_
  7. end

  8. class Scene_Credit

  9.   def initialize(return_scene = nil)
  10.     @sprite = Sprite.new
  11.     @sprite.bitmap = Bitmap.new("Graphics/Pictures/tit")
  12.     @sprite.x = 0
  13.     @sprite.y = 0
  14.     if return_scene.nil?
  15.       return_scene = Scene_Title.new
  16.     end
  17.     @return_scene = return_scene
  18.   end
  19.   
  20.   def scene_start
  21.     credit_lines = CREDIT.split(/\n/)
  22.     credit_bitmap = Bitmap.new(576,32 * credit_lines.size)
  23.     credit_lines.each_index do |i|
  24.       line = credit_lines[i]
  25.       credit_bitmap.draw_text(0,i * 32,576,32,line,1)
  26.     end
  27.     @credit_sprite = Sprite.new(Viewport.new(0,50,576,432))
  28.     @credit_sprite.bitmap = credit_bitmap
  29.     @credit_sprite.oy = -430
  30.     @frame_index = 0
  31.     @last_flag = false
  32.   end

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

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

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

640*480的脚本
- -汗那...针对640*480脚本的才在这里

  1. #——使用注意:默认会返回地图,如果需要返回开头,请将本脚本中的
  2. #return_scene = Scene_Map.new改为return_scene = Scene_Title.new

  3. class Scene_Credit
  4.   CREDIT=<<_END_
  5. #输入内容

  6. _END_
  7. end

  8. class Scene_Credit

  9.   def initialize(return_scene = nil)
  10.     @sprite = Sprite.new
  11.     @sprite.bitmap = Bitmap.new("Graphics/Pictures/tit")
  12.     @sprite.x = 0
  13.     @sprite.y = 0
  14.     if return_scene.nil?
  15.       return_scene = Scene_Map.new
  16.     end
  17.     @return_scene = return_scene
  18.   end
  19.   
  20.   def scene_start
  21.     credit_lines = CREDIT.split(/\n/)
  22.     credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
  23.     credit_lines.each_index do |i|
  24.       line = credit_lines[i]
  25.       credit_bitmap.draw_text(0,i * 32,640,32,line,1)
  26.     end
  27.     @credit_sprite = Sprite.new(Viewport.new(0,50,640,480))
  28.     @credit_sprite.bitmap = credit_bitmap
  29.     @credit_sprite.oy = -430
  30.     @frame_index = 0
  31.     @last_flag = false
  32.   end

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

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

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


作者: CIS狂人    时间: 2008-2-8 19:03
怎么没人顶啊?(配合使用640*480脚本可能会好点.)
作者: CIS狂人    时间: 2008-2-12 05:14
还是没人顶..算了..自己顶下.如果有左右不对称可以自己调哈
作者: 冰风情火    时间: 2008-2-12 06:03
可怜哦。没人顶。我帮你,。。。。。
不过VX格式不是640*480的
作者: CIS狂人    时间: 2008-2-13 04:46
- -汗那...针对640*480脚本的才在这里
  1. #——使用注意:默认会返回地图,如果需要返回开头,请将本脚本中的
  2. #return_scene = Scene_Map.new改为return_scene = Scene_Title.new

  3. class Scene_Credit
  4.   CREDIT=<<_END_
  5. #输入内容

  6. _END_
  7. end

  8. class Scene_Credit

  9.   def initialize(return_scene = nil)
  10.     @sprite = Sprite.new
  11.     @sprite.bitmap = Bitmap.new("Graphics/Pictures/tit")
  12.     @sprite.x = 0
  13.     @sprite.y = 0
  14.     if return_scene.nil?
  15.       return_scene = Scene_Map.new
  16.     end
  17.     @return_scene = return_scene
  18.   end
  19.   
  20.   def scene_start
  21.     credit_lines = CREDIT.split(/\n/)
  22.     credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
  23.     credit_lines.each_index do |i|
  24.       line = credit_lines[i]
  25.       credit_bitmap.draw_text(0,i * 32,640,32,line,1)
  26.     end
  27.     @credit_sprite = Sprite.new(Viewport.new(0,50,640,480))
  28.     @credit_sprite.bitmap = credit_bitmap
  29.     @credit_sprite.oy = -430
  30.     @frame_index = 0
  31.     @last_flag = false
  32.   end

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

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

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

作者: zmgy    时间: 2008-2-13 05:23
提示: 作者被禁止或删除 内容自动屏蔽
作者: CIS狂人    时间: 2008-2-13 05:37
贴完了
作者: mieloko    时间: 2008-2-13 21:46
天才呀,各位都是天才呀
作者: CIS狂人    时间: 2008-2-18 21:47
我要抗议..66..为什么不把这个版块放到论坛页面上去..
作者: 越前リョーマ    时间: 2008-2-18 21:54
以下引用CIS狂人于2008-2-18 13:47:08的发言:

我要抗议..66..为什么不把这个版块放到论坛页面上去..

是雷子开的……

的确很冷……
作者: 粉红梦    时间: 2008-2-24 23:54
提示: 作者被禁止或删除 内容自动屏蔽
作者: 精灵使者    时间: 2008-2-25 02:54
$Scene = Scene_Credit.new
作者: 粉红梦    时间: 2008-3-3 01:40
提示: 作者被禁止或删除 内容自动屏蔽
作者: 风雪优游    时间: 2008-3-7 23:27
发布完毕,VIP+2
作者: 王逸尘    时间: 2008-5-2 19:37
提示: 作者被禁止或删除 内容自动屏蔽
作者: 精灵使者    时间: 2008-5-3 01:58
CREDIT=<<_END_
#这里输入字幕内容

_END_
end
这个的范围内输入就行。回车会自动换行。
作者: 5693744    时间: 2008-5-8 22:47
感觉有个范例会更好`
作者: 278772543    时间: 2008-5-12 02:03
提示: 作者被禁止或删除 内容自动屏蔽
作者: 偶尔杀人越货    时间: 2008-5-16 21:26
话说vx区这两天出了不少精品,坚决地顶一个!!!
作者: CIS狂人    时间: 2008-8-13 05:05
640*480脚本是大神的脚本..........
现在大家都吸大神.........
作者: 偶尔杀人越货    时间: 2008-8-21 05:51
什么啊,640*480自己就能改,麻烦点而已
作者: 越前リョーマ    时间: 2008-8-21 06:32
有这个就不用用图片了…… = =
作者: larbi    时间: 2008-8-22 19:14
我用不來,為什么...........
作者: CIS狂人    时间: 2008-8-23 02:43
那是因为你没有看我的注释.
作者: ㄆ相    时间: 2008-8-23 20:46
提示: 作者被禁止或删除 内容自动屏蔽
作者: 雪流星    时间: 2008-8-23 20:51
http://rpg.blue/viewthread.php?tid=74540&page=3

顺便去看一下版规
http://rpg.blue/viewthread.php?tid=77690
作者: 优木木    时间: 2009-4-19 21:12
提示: 作者被禁止或删除 内容自动屏蔽
作者: 优木木    时间: 2009-4-19 22:22
提示: 作者被禁止或删除 内容自动屏蔽




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