#==============================================================================
# ** Logo V1.01 by SUPERNOVA Games
#
# 标题画面 V1.01 by SUPERNOVA Games
#==============================================================================
#
# How to use:
# 1.Add this script above Main.
# 2.Put your own logo picture in Graphics/System/.
# 3.Put your own logo music in Audio/ME/.
# 4.Change LOGO_PICTURE & LOGO_MUSIC's filename as
# your music and pictre's name.
# 5. Set logo's fadein/fadeout speed and the waiting time between fadein/fadeout as your wish.
# 6..In game press Input B to skip logo.
#
# 如何使用:
# 1.将此脚本插入Main脚本之前。
# 2.将Logo图片放入“Graphics/System/”文件夹。
# 3.将Logo音乐放入“Audio/ME/”文件夹。
# 4将LOGO_MUSIC和LOGO_PICTURE名称修改为Logo图片和Logo音乐文件名。
# 5.将LOGO_SPEED数值设定为你要淡入淡出的速度,将LOGO_WAIT数值设定为淡入淡出间隔的帧数。
# 6.在游戏中可按取消键跳过标题画面。
#==============================================================================
module SUPERNOVA
LOGO_MUSIC = "Logo" #logo music
LOGO_PICTURE = "Logo" #logo image
LOGO_SPEED = 50 #fadein/fadeout speed
LOGO_WAIT = 100 #waiting time between fadein/fadeout
end
#==============================================================================
# ** SceneManager
#==============================================================================
module SceneManager
#--------------------------------------------------------------------------
# * Clear Call Stack
#--------------------------------------------------------------------------
def self.clear
$Logo = false
@stack.clear
end
end
#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
if $Logo == true or $TEST
SceneManager.clear
Graphics.freeze
create_background
create_foreground
create_command_window
play_title_music
else
SceneManager.call(Scene_Logo)
end
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
if $Logo == true or $TEST
SceneManager.snapshot_for_background
dispose_background
dispose_foreground
end
end
end
#==============================================================================
# ** Scene_Logo
#==============================================================================
class Scene_Logo < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
Audio.me_play("Audio/ME/" + SUPERNOVA::LOGO_MUSIC, 100, 100)
create_logo_graphic
@logo_fadein = true
@logo_fadeout = false
@logo_quick_exit = false
@wait_count = 0
@logo_speed = SUPERNOVA::LOGO_SPEED
@logo_wait = SUPERNOVA::LOGO_WAIT
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
$Logo = true
dispose_logo_graphic
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
@wait_count += 1
update_logo_wait
if @logo_fadein == true
update_logo_fadein
end
if @logo_fadeout == true
update_logo_fadeout
end
if @logo_quick_exit == true
update_quick_exit
end
if Input.trigger?(Input::B)
@logo_quick_exit = true
end
end
#--------------------------------------------------------------------------
# * Update Logo Fadein
#--------------------------------------------------------------------------
def update_logo_fadein
@logo.opacity += @logo_speed if @logo.opacity < 255
end
#--------------------------------------------------------------------------
# * Update Logo Fadeout
#--------------------------------------------------------------------------
def update_logo_fadeout
@logo.opacity -= @logo_speed if @logo.opacity > 0
if @logo.opacity == 0
Audio.me_stop
Audio.se_stop
SceneManager.call(Scene_Title)
return
end
end
#--------------------------------------------------------------------------
# * Update Quick Exit
#--------------------------------------------------------------------------
def update_quick_exit
if @logo_quick_exit == true
@logo.opacity -= 20 if @logo.opacity > 0
if @logo.opacity == 0
Audio.me_stop
Audio.se_stop
SceneManager.call(Scene_Title)
return
end
end
end
#--------------------------------------------------------------------------
# * Update Logo Wait
#--------------------------------------------------------------------------
def update_logo_wait
if @logo_quick_exit == true
@logo_fadein = false
@logo_fadeout = false
else
@logo_fadein = true if @wait_count <= @logo_wait + 255/@logo_speed
@logo_fadeout = false if @wait_count <= @logo_wait + 255/@logo_speed
@logo_fadein = false if @wait_count > @logo_wait + 255/@logo_speed
@logo_fadeout = true if @wait_count > @logo_wait + 255/@logo_speed
end
end
#--------------------------------------------------------------------------
# * Create Logo Graphic
#--------------------------------------------------------------------------
def create_logo_graphic
@logo = Sprite.new
@logo.bitmap = Cache.system(SUPERNOVA::LOGO_PICTURE)
@logo.opacity = 0
end
#--------------------------------------------------------------------------
# * Dispose Logo Graphic
#--------------------------------------------------------------------------
def dispose_logo_graphic
@logo.bitmap.dispose
end
end