Project1
标题:
关于程序问题,跪求高人帮忙解决
[打印本页]
作者:
xxfxxf888
时间:
2012-12-3 19:08
标题:
关于程序问题,跪求高人帮忙解决
本帖最后由 hcm 于 2012-12-17 12:48 编辑
各位前辈亲们:
使用了《星球大战》字幕,(程序出处
http://www.66rpg.com/articles/3135
)可是老是提示出错,跪求各位高人帮忙解决,谢谢了
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#——————————————————————————————————————
# 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)
[url=home.php?mod=space&uid=114926]@sprite[/url] = 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
@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
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1