#==============================================================================
# ■ 标题雾效果(通过战斗雾效果修改制作)
#------------------------------------------------------------------------------
# 作者:聪仔
# 转载请保留脚本来源:本脚本来自rpg.blue
#==============================================================================
#==============================================================================
# ■ Cache
#==============================================================================
module Cache
#--------------------------------------------------------------------------
# * 获取远景图档
# filename : 文件名
#--------------------------------------------------------------------------
def self.fogs(filename)
load_bitmap("Graphics/Fogs/", filename)
end
end
#==============================================================================
# ■ Sprite_Mist
#==============================================================================
class Sprite_Mist < Sprite
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def initialize(viewport)
super(viewport)
self.bitmap = Cache.fogs("Mist")
self.blend_type = 1
self.ox = 128
self.oy = 160
self.y = Graphics.height - 128 - self.oy + rand(240)
setup
self.x = rand(Graphics.width)
@real_x = self.x << 10
end
#--------------------------------------------------------------------------
# ● 设置
#--------------------------------------------------------------------------
def setup
@vx = rand(512) + 512
self.zoom_x = (rand(600) + 700) / 1200.0
if self.zoom_x < 1.0
self.z = 2
else
self.z = 400
end
self.zoom_y = self.zoom_x
self.x = Graphics.width + (128 * self.zoom_x).to_i
@real_x = self.x << 10
end
#--------------------------------------------------------------------------
# ● 释放
#--------------------------------------------------------------------------
def dispose
self.bitmap.dispose
super
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
def update
super
@real_x -= @vx
self.x = @real_x >> 10
setup if self.x < (0 - (128 * self.zoom_x).to_i)
end
end
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# 处理标题画面的类。
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● 开始处理
#--------------------------------------------------------------------------
def start
super
load_database # 载入数据库
create_game_objects # 生成游戏对象
check_continue # 判断继续是否有效
create_title_graphic # 生成标题画面图像
create_command_window # 生成指令窗口
play_title_music # 播放标题画面音乐
create_mist
end
#--------------------------------------------------------------------------
# ● 结束处理
#--------------------------------------------------------------------------
def terminate
super
dispose_command_window
snapshot_for_background
dispose_title_graphic
dispose_mist
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
@command_window.update
update_mist
if Input.trigger?(Input::C)
case @command_window.index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
end
end
end
#--------------------------------------------------------------------------
# ● 生成雾
#--------------------------------------------------------------------------
def create_mist
@mist_sprites = []
for i in 0...25
@mist_sprites.push(Sprite_Mist.new(@viewport1))
end
end
#--------------------------------------------------------------------------
# ● 释放雾
#--------------------------------------------------------------------------
def dispose_mist
for sprite in @mist_sprites
sprite.dispose
end
end
#--------------------------------------------------------------------------
# ● 更新雾
#--------------------------------------------------------------------------
def update_mist
for sprite in @mist_sprites
sprite.update
end
end
end