幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1905|回复: 7

字幕系统的问题

[复制链接]

3

主题

9

帖子

1079

积分

⑥精研

积分
1079
发表于 2004-11-14 17:49:14 | 显示全部楼层 |阅读模式
我在论坛上看到了字幕系统的代码,在游戏中用 $scene= Scene_Credit.new[?] 调用,请问括号里应该写什么? 谢谢了,拜托了!
回复

使用道具 举报

carol3 该用户已被删除
发表于 2004-11-15 15:29:54 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

0

主题

11

帖子

231

积分

③业余

积分
231
发表于 2004-11-17 16:04:52 | 显示全部楼层
2楼巡城啊
是个很N的B哦
在下有事一定请教
回复 支持 反对

使用道具 举报

3

主题

9

帖子

1079

积分

⑥精研

积分
1079
 楼主| 发表于 2004-11-18 19:50:44 | 显示全部楼层
字幕系统脚本
在main上面新建一个Scene_Credit,然后贴入下面的代码
在游戏中加入一个事件,然后加入脚本$scene= Scene_Credit.new()调用
效果很不错的
# Scene_Credit
#
# 制作人员名单
#
class Scene_Credit
  CREDIT=<<_END_
Cast
制作工具RPGmakerXP
字幕系统(完毕后自动返回地图)
如果想作为谢幕用,请修改return_scene = Scene_Map.new
为return_scene = Scene_Title.new

_END_
end
class Scene_Credit
  def initialize(return_scene = nil)
    if return_scene.nil?
      return_scene = Scene_Map.new
    end
    @return_scene = return_scene
  end
  
  def scene_start
    credit_lines = CREDIT.split(/\\n/)
    credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
    credit_lines.each_index do |i|
      line = credit_lines
      credit_bitmap.draw_text(0,i * 32,640,32,line,1)
    end
    @credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
    @credit_sprite.bitmap = credit_bitmap
    @credit_sprite.oy = -430
    @frame_index = 0
    @last_flag = false
  end
  def scene_end
    @credit_sprite.dispose
  end
  
  def last?
    return (@frame_index >= @credit_sprite.bitmap.height + 480)
  end
  
  def last
    if not @last_flag
      Audio.bgm_fade(10000)
      @last_flag = true
      @last_count = 0
    else
      @last_count += 1
    end
    if @last_count >= 300
      $scene = @return_scene
    end
  end
  
  def update
    @frame_index += 1
    return if cancel?
    last if last?
    @credit_sprite.oy += 1
  end
  def cancel?
    if Input.trigger?(Input::B)
      $scene = @return_scene
      return true
    end
    return false
  end
  def main
    scene_start
    # 过渡
    Graphics.transition
    # 主循环
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    scene_end
  end
end
# Scene_Credit

请教一下,到底该怎么用,怎么在游戏里调用!
回复 支持 反对

使用道具 举报

carol3 该用户已被删除
发表于 2004-11-18 22:22:45 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

2

主题

5

帖子

300

积分

④见习

积分
300
发表于 2004-11-19 22:29:34 | 显示全部楼层
谁能把上面那段语句解释一下吗?
我是菜鸟……看不懂
回复 支持 反对

使用道具 举报

carol3 该用户已被删除
发表于 2004-11-19 23:46:45 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

carol3 该用户已被删除
发表于 2004-11-20 00:20:24 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-8 14:18 , Processed in 0.011171 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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