09-30-2005, 01:00 PM
Introduction & Splash Scene - Last Updated : 01.08.05
by SephirothSpawn
by SephirothSpawn
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given.
No support is given.
Demo:
Introduction___Splash_Scene.zip (Size: 1.33 MB / Downloads: 1)
Description
It displays pictures before the Title menu, then, if you want, it will display a final picture with "Press Start" (or whatever you choose) flashing at the bottom.
Instructions
Make Sure your pictures are in your Titles folder, with all names known.
Then, go into Main and replace the line:
Code:
$scene = Scene_Title.new
with this:
Code:
$scene = Scene_Intro.new( [x], y)
Now Just replace x and y.
Change x to the pictures names and the order they will appear.
For instance: 3 Pictures named : "Pic 1", "Pic 2", "Pic 3" so your code would now be:
Code:
$scene = Scene_Title.new( ["Pic 1", "Pic 2", "Pic 3"], y)
Now, if you dont want a splash screen, just delete the ", y". But lets say you want one to display a picture named "Splash", just change it now to:
Code:
$scene = Scene_Title.new( ["Pic 1", "Pic 2", "Pic 3"], "Splash")
Now just put this code above Scene_Title.
Code:
#==============================================================================
# Introduction & Splash Scene
#==============================================================================
# SephirothSpawn
# 01.08.06
# Version 2
#--------------------------------------------------------------------------
# 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
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Loads Data System and Game System to Play BGM
data_system = load_data("Data/System.rxdata")
game_system = Game_System.new
game_system.bgm_play(data_system.title_bgm)
# Instance Variables
@item, @speed, @o_speed, @phase = 0, 5, 5, 0
# Background Images
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title(@pics[@item])
@sprite.opacity = 5
# Start Logo
@start = Sprite.new
@start.bitmap = RPG::Cache.title("Start")
@start.y, @start.z, @start.opacity = 416, 10, 0
# Execute transition
Graphics.transition
# Main loop
while $scene == self
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame 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
end
end
# Prepare for transition
Graphics.freeze
# Dispose of Sprites
@sprite.dispose
@start.dispose
end
#--------------------------------------------------------------------------
# * Frame Update : Intro Images
#--------------------------------------------------------------------------
def intro_update
# If C is pressed
if Input.trigger?(Input::C)
@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 :
@sprite.bitmap = RPG::Cache.title(@pics[@item])
end
end
#--------------------------------------------------------------------------
# * Frame Update : Splash Image
#--------------------------------------------------------------------------
def splash_update
# If C is pressed
if Input.trigger?(Input::C)
@phase = 3
end
# Loads Sprite Splash Bitmap
@sprite.bitmap = RPG::Cache.title(@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
$scene = Scene_Title.new if @sprite.opacity <= 0 && @start.opacity <= 0
end
end
If you would like the Title Screen To Fade in, go into Scene_Title and find the lines:
Code:
Graphics.transition
and make it:
Code:
Graphics.transition(x)
Just Change the x into (I Believe) the number of frames to fade in.(Larger # with make a slower transition)
You also need a picture (640*64 resolution) in your Titles folder as well. Heres an example:
(missing image)
Just Import That to your titles folder and set the Black Part to transparent.
That Should be it. If Need be, I will post a demo.