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

Project1

 找回密码
 注册会员
搜索
查看: 12858|回复: 27

滚动字幕(从XP移植)

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
539
发表于 2008-2-8 05:30:36 | 显示全部楼层 |阅读模式

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

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

x
调试好的^使用时候用一个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
复制代码

横版卷轴ARPG制作中... 系统80% 素材95% 剧情1%.... 有脚本问题随时吼我- -(被T出)

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
539
 楼主| 发表于 2008-2-8 19:03:30 | 显示全部楼层
怎么没人顶啊?(配合使用640*480脚本可能会好点.)
横版卷轴ARPG制作中... 系统80% 素材95% 剧情1%.... 有脚本问题随时吼我- -(被T出)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
539
 楼主| 发表于 2008-2-12 05:14:48 | 显示全部楼层
还是没人顶..算了..自己顶下.如果有左右不对称可以自己调哈
横版卷轴ARPG制作中... 系统80% 素材95% 剧情1%.... 有脚本问题随时吼我- -(被T出)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2 小时
注册时间
2006-3-1
帖子
126
发表于 2008-2-12 06:03:51 | 显示全部楼层
可怜哦。没人顶。我帮你,。。。。。
不过VX格式不是640*480的
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
539
 楼主| 发表于 2008-2-13 04:46:53 | 显示全部楼层
- -汗那...针对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
复制代码
横版卷轴ARPG制作中... 系统80% 素材95% 剧情1%.... 有脚本问题随时吼我- -(被T出)
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-1-27
帖子
122
发表于 2008-2-13 05:23:42 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
539
 楼主| 发表于 2008-2-13 05:37:07 | 显示全部楼层
贴完了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
5 小时
注册时间
2007-12-18
帖子
66
发表于 2008-2-13 21:46:02 | 显示全部楼层
天才呀,各位都是天才呀
我的博客http://blog.sina.com.cn/tsukinomieloko里面有我自己做的游戏的图片
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-23
帖子
539
 楼主| 发表于 2008-2-18 21:47:08 | 显示全部楼层
我要抗议..66..为什么不把这个版块放到论坛页面上去..
横版卷轴ARPG制作中... 系统80% 素材95% 剧情1%.... 有脚本问题随时吼我- -(被T出)
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (暗夜天使)

名侦探小柯

梦石
0
星屑
3251
在线时间
3616 小时
注册时间
2006-9-6
帖子
37398

开拓者贵宾第3届短篇游戏大赛主流游戏组亚军第5届短篇游戏比赛亚军

发表于 2008-2-18 21:54:13 | 显示全部楼层
以下引用CIS狂人于2008-2-18 13:47:08的发言:

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

是雷子开的……

的确很冷……

点评

这个...怎么用啊  发表于 2010-8-2 22:29
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-19 08:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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