#==============================================================================
# Splash Screen
#==============================================================================
# Sephiroth Spawn
# 01.08.06
# Version 2
# Modified by Harshboy/Flameguru
#--------------------------------------------------------------------------
# Call Using $scene = Scene_Intro.new([pics], splash_screen)
#==============================================================================
#==============================================================================
# ** Scene_Intro
#==============================================================================
class Scene_Intro
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(pics, splash = nil)
@pics, @splash = pics, splash
end
def setTitle(sprite,title)
@cache={} if !@cache
if @currentTitle!=title
sprite.setBitmap("Graphics/Titles/#{title}")
@currentTitle=title
end
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Loads Data System and Game System
data_system = pbLoadRxData("Data/System")
# Loads the Title.mid in Audio/BGM
pbBGMPlay(data_system.title_bgm)
# Instance Variables
@item, @speed, @o_speed, @phase = 0, 15, 20, 0
# Background Images
@sprite = IconSprite.new(0,0)
setTitle(@sprite, @pics[@item])
@sprite.opacity = 5
# Start Logo
@start = IconSprite.new(0,0)
setTitle(@start,"Start")
@start.y, @start.z, @start.opacity = 260, 10, 0 #250
# Execute transition
Graphics.transition
# Main loop
while $scene == self
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
@sprite.update
case @phase
when 0; intro_update # Into Updating
when 1; splash_update # Splash Updating
when 2; to_splash_update # From Intro To Splash Transition
when 3; to_title_update # From Splash to Title Transtion
when 4; toDeleteUpdate
end
end
# Prepare for transition
Graphics.freeze
# Dispose of Sprites
if @cache
for i in @cache.values
i.dispose
end
end
@sprite.dispose
@start.dispose
end
#--------------------------------------------------------------------------
# * Frame Update : Intro Images
#--------------------------------------------------------------------------
def intro_update
# If C is pressed
if Input.trigger?(Input::C) && @speed>=0
@phase = @splash.nil? ? 3 : 2
end
# Updates Sprite Opacity
@sprite.opacity += @speed
# Changes Direction
@speed *= -1 if @sprite.opacity >= 255
# Change Sprite
if @sprite.opacity <= 0
@item += 1
@speed *= -1
@item == @pics.size ?
@phase = @splash.nil? ? 3 : 2 :
setTitle(@sprite,@pics[@item])
end
end
#--------------------------------------------------------------------------
# * Frame Update : Splash Image
#--------------------------------------------------------------------------
def splash_update
# If C is pressed
if Input.trigger?(Input::C)
@phase = 3
end
if Input.press?(Input::DOWN) &&
Input.press?(Input::CTRL) &&
Input.press?(Input::B)
@phase=4
end
# Loads Sprite Splash Bitmap
setTitle(@sprite,@splash)
# Updates Start Logo Opacity
@start.opacity += @o_speed
# Changes Direction
@o_speed *= -1 if @start.opacity >= 255 || @start.opacity <= 0
# Updates Splash
@sprite.opacity += @speed if @sprite.opacity < 255
end
#--------------------------------------------------------------------------
# * Frame Update : Intro To Splash Transistion
#--------------------------------------------------------------------------
def to_splash_update
@sprite.opacity > 0 ? @sprite.opacity -= @speed : @phase = 1
end
#--------------------------------------------------------------------------
# * Frame Update : Splash To Title Transistion
#--------------------------------------------------------------------------
def to_title_update
# Decrease Splash Opacity
@sprite.opacity -= @speed if @sprite.opacity > 0
# Decresh Start Logo Opacity
@start.opacity -= @speed if @start.opacity > 0
# Proceed to Title Screen
if @sprite.opacity <= 0 && @start.opacity <= 0
pbBGMStop()
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartLoadScreen
end
end
def toDeleteUpdate
# Decrease Splash Opacity
@sprite.opacity -= @speed if @sprite.opacity > 0
# Decresh Start Logo Opacity
@start.opacity -= @speed if @start.opacity > 0
# Proceed to Title Screen
if @sprite.opacity <= 0 && @start.opacity <= 0
pbBGMStop()
sscene=PokemonLoadScene.new
sscreen=PokemonLoad.new(sscene)
sscreen.pbStartDeleteScreen
end
end
end