Project1
标题:
[发布][应求脚本]仿"星球大战"字幕
[打印本页]
作者:
SailCat
时间:
2005-10-27 09:46
标题:
[发布][应求脚本]仿"星球大战"字幕
用法:
插入到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 最后编辑]
作者:
SailCat
时间:
2005-10-27 09:46
标题:
[发布][应求脚本]仿"星球大战"字幕
用法:
插入到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 最后编辑]
作者:
夕俊
时间:
2005-10-27 14:15
提示:
作者被禁止或删除 内容自动屏蔽
作者:
bluefool
时间:
2005-10-27 19:00
sailcat还真是敬业的好版主啊........
表太累了{/wx}{/wx}{/wx}
作者:
orochi2k
时间:
2005-10-28 01:04
楼上很可疑哦....
作者:
忧郁
时间:
2005-10-28 02:08
效率好高啊.......CAT姐偶崇拜死你了!
作者:
小鼻涕
时间:
2005-10-28 03:45
提示:
作者被禁止或删除 内容自动屏蔽
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1