赞 | 342 |
VIP | 10 |
好人卡 | 8 |
积分 | 262 |
经验 | 235776 |
最后登录 | 2024-9-23 |
在线时间 | 2387 小时 |
Lv5.捕梦者 (版主) 遠航の猫咪
- 梦石
- 3
- 星屑
- 23207
- 在线时间
- 2387 小时
- 注册时间
- 2005-10-15
- 帖子
- 1166
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
用法:
插入到Main前面
游戏调用:
事件脚本: $scene=Scene_Opening.new(返回场景)
例: $scene=Scene_Opening.new(Scene_Title.new)
若省略参数的话为默认场景
设定:
CREDIT常量:要显示的文字,这里拿星球大战作示范了
其他见脚本注释
- #——————————————————————————————————————
- # Scene_Opening 开场字幕 by SailCat
- #——————————————————————————————————————
- #——使用注意:默认会返回地图,如果需要返回开头,请将本脚本中的
- #return_scene = Scene_Map.new改为return_scene = Scene_Title.new
- class Scene_Opening
- CREDIT=<<_END_
- Star Wars
- EPISODE IV
- A New Hope
- It is a period of civil war. Rebel
- spaceships, striking from a hidden
- base, have won their first victory
- against the evil Galactic Empire.
- During the battle, Rebel spies
- managed to steal secret plans to
- the Empire's ultimate weapon, the
- DEATH STAR, an armored space
- station with enough power to
- destroy an entire planet.
- Pursued by the Empire's sinister
- agents, Princess Leia races home
- aboard her starship,custodian of
- the stolen plans that can save her
- people and restore freedom to the
- galaxy....
- _END_
- end
- class Scene_Opening
- def initialize(return_scene = nil)
- @sprite = Sprite.new
- back_bitmap = Bitmap.new("Graphics/Panoramas/003-StarlitSky01.jpg")
- @sprite.bitmap = Bitmap.new(640, 480)
- @sprite.bitmap.stretch_blt(Rect.new(0, 0, 640, 480), back_bitmap,
- Rect.new(0, 0, back_bitmap.width, back_bitmap.height))
- @sprite.x = 0
- @sprite.y = 0
- @wait_count = 0
- Graphics.freeze
- Graphics.transition(20)
- $game_temp.map_bgm = $game_system.playing_bgm
- # 如果要播放音乐的话更改以下两行(文件名)并去掉注释
- #opening_bgm=RPG::AudioFile.new("Audio/BGM/Star Wars.mid", 100, 100)
- #$game_system.bgm_play(opening_bgm)
- if return_scene.nil?
- return_scene = Scene_Map.new
- $game_temp.transition_processing = true
- $game_temp.transition_name = ""
- end
- @return_scene = return_scene
- end
-
- def scene_start
- credit_lines = CREDIT.split(/\n/)
- @credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
- # 这里更改描绘字体 美观起见请用等宽字体
- @credit_bitmap.font.name = ["Courier New", "黑体"]
- @credit_bitmap.font.size = 24
- @credit_bitmap.font.bold = true
- credit_lines.each_index do |i|
- line = credit_lines[i]
- @credit_bitmap.draw_text(0,i * 32,640,32,line,1)
- end
- @credit_sprite = Sprite.new(Viewport.new(0,240,640,240))
- @credit_sprite.bitmap = Bitmap.new(960,240)
- @credit_sprite.ox = 160
- @frame_index = 0
- @last_flag = false
- end
- def scene_end
- @credit_sprite.dispose
- @sprite.dispose
- $game_system.bgm_stop
- $game_system.bgm_play($game_temp.map_bgm)
- end
-
- def last?
- return (@frame_index >= @credit_bitmap.height + 240)
- end
-
- def last
- if not @last_flag
- @last_flag = true
- @last_count = 0
- Audio.bgm_fade(5000)
- else
- @last_count += 1
- end
- if @last_count >= 100
- $scene = @return_scene
- end
- end
-
- def update
- if @wait_count > 0
- @wait_count -= 1
- return
- end
- @frame_index += 1
- return if cancel?
- last if last?
- update_bitmap
- @wait_count = 2
- end
- def cancel?
- if Input.trigger?(Input::B)
- $scene = @return_scene
- return true
- end
- return false
- end
-
- # 刷新文字梯形
- def update_bitmap
- @credit_sprite.bitmap.clear
- for i in 0..240
- if i + @frame_index >= 240
- @credit_sprite.bitmap.stretch_blt(Rect.new(240-i, i, 480+i*2, 1),
- @credit_bitmap, Rect.new(0, @frame_index+i-240, 640, 1))
- end
- end
- 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
复制代码
[本贴由 柳柳 于 2005-10-28 6:20:56 最后编辑] |
|