=begin
#==============================================================================
# ?? Three Image Title Screen
#------------------------------------------------------------------------------
# Ccoa - made SDK compliant by Trickster
# Version 1.0
# Date 2/17/07
# Goto RMXP.org for updates/bug reports/comment
#
# Instructions:
# 1) Add Three Images Named 1, 2, and 3 to your Graphics/Titles Folder
# 2) Edit this line 10 change the transition
# @transition_frames = 10
# To the Number of Frame the Transition lasts
#==============================================================================
=end
#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log("Three Image Title Screen", "Ccoa/Trickster", 1.0, "2.17.07")
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2, 3, 4])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?("Three Image Title Screen")
class Scene_Title
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
main_sprite # Main Sprite Initialization
main_variable # Main Variable Initialization
main_spriteset # Main Spriteset Initialization
main_window # Main Window Initialization
main_audio # Main Audio Initialization
main_transition # Main Transition Initialization
loop do # Scene Loop
main_loop # Main Loop
break if main_break? # Break If Breakloop Test
end # End Scene Loop
Graphics.freeze # Prepare for transition
main_dispose # Main Dispose
main_end # Main End
end
#--------------------------------------------------------------------------
# * Background Initialization
#--------------------------------------------------------------------------
alias_method :trick_ccoa_threeimage_title_main_sprite, :main_sprite
def main_sprite
# Load System Info
$data_system = load_data("Data/System.rxdata")
# The Usual
trick_ccoa_threeimage_title_main_sprite
# Create Back Ground Sprite
@back_sprite = Sprite.new
# Set Z
@back_sprite.z = @sprite.z - 10
# transition between images, set to 0 if none
@transition_frames = 10
# Get Change (Delta)
@delta = 255 / @transition_frames
# Setup Wait Variable
@wait = 0
end
#--------------------------------------------------------------------------
# * Main Menu Initialization
#--------------------------------------------------------------------------
alias_method :trick_ccoa_threeimage_title_main_window, :main_window
def main_window
# The Usual
trick_ccoa_threeimage_title_main_window
# Disable Command Window
@command_window.visible = false
@command_window.active = false
end
#--------------------------------------------------------------------------
# * Main Test Continue
#--------------------------------------------------------------------------
SDK.log_overwrite(:Scene_Title, :main_test_continue)
def main_test_continue
# Continue enabled determinant
# Check if at least one save file exists
# If enabled, make @continue_enabled true; if disabled, make it false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# If continue is enabled, move cursor to "Continue"
if @continue_enabled
# Set Bitmaps
@sprite.bitmap = RPG::Cache.title('2')
@back_sprite.bitmap = RPG::Cache.title('2')
# Ser Index
@index = 1
else
# Set Bitmaps
@sprite.bitmap = RPG::Cache.title('1')
@back_sprite.bitmap = RPG::Cache.title('1')
# Set Index
@index = 0
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
SDK.log_overwrite(:Scene_Title, :update)
def update
# If Wait is Greater than 0
if @wait >= 0
# If Wait is 0
if @wait == 0
# Set Bitmap and opacity
@sprite.bitmap = RPG::Cache.title((@index+1).to_s)
@sprite.opacity = 255
else
# Reduce Opacity
@sprite.opacity -= @delta
end
# Reduce Wait
@wait -= 1
# Return
return
end
# If directional buttons are pressed
if Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
# Cursor SE
$game_system.se_play($data_system.cursor_se)
# Reduce By 1 Restrict to 0-2
@index = (@index - 1) % 3
# Set Wait
@wait = @transition_frames
# Set Bitmap
@back_sprite.bitmap = RPG::Cache.title((@index+1).to_s)
end
# If directional buttons are pressed
if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
# Cursor SE
$game_system.se_play($data_system.cursor_se)
# Add 1 Restrict to 0-2
@index = (@index + 1) % 3
# Set Wait
@wait = @transition_frames
# Set Bitmap
@back_sprite.bitmap = RPG::Cache.title((@index+1).to_s)
end
# If C is Pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @index
when 0 # New game
command_new_game
when 1 # Continue
command_continue
when 2 # Shutdown
command_shutdown
end
end
end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end