|
发表于 2007-9-13 22:37:51
|
显示全部楼层
我自己发现了多了个dispose我就觉得不妥。。。可能还有错。。。[s:5]现在太迷糊了,错误百出。。。
class Window_CG< Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(-16, -16, 672, 512)
self.contents = Bitmap.new(width - 32, height - 32)
self.index = 1
@sprite = Sprite.new
@sprite.bitmap = Bitmap.new("Graphics/CG/1.jpg")
@sprite.x =0
@sprite.y = 0
$game_temp.map_bgm = $game_system.playing_bgm
opening_bgm=RPG::AudioFile.new("开场CG.mp3", 100, 100)
$game_system.bgm_play(opening_bgm)
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
@sprite.bitmap = Bitmap.new("Graphics/CG/1 ("+ self.index.to_s +").jpg")
Graphics.update
@sprite.bitmap.dispose
end
end
class Scene_CG
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
@cg = Window_CG.new
# 执行过渡
Graphics.transition
# 主循环
loop do
@cg.index += 1
if @cg.index > 369
$scene = Scene_Title.new
end
for i in 0...5
@cg.update
# 刷新输入信息
Input.update
# 刷新画面
if Input.trigger?(Input::C)
$scene = Scene_Title.new
end
# 如果切换画面就中断循环
if $scene != self
break
end
end
end
# 准备过渡
Graphics.freeze
@cg = Window_CG.dispose
end
end |
|