Ultimate Splash Scene 3.1.2

Ultimate Splash Scene
Version: 3.1.2
By: XeroVolume


Update Log Spoiler
Friday, June 11, 2010

Version Update (3.1 to 3.1.2)


- Added two lines of code to ensure the splash bitmaps are disposed of properly

*NOTE* - This update is important to ensure that image bitmaps are not lingering around during your game and wasting memory. Therefore, please ensure that you are using the most current updated version.


Thursday, June 03, 2010

Version Update (3.0 to 3.1)


- Fixed a small bug with final splash to title spacing.
- Edited one line of code which allowed me to remove the now unnecessary Battle Test method.
- ($Btest now calls Scene_Title.new which runs the default Battle Test method.)
- Added "Plug-n-Play" Edition


Introduction


If you're looking for a simple to use and highly customizable introductory splash screen, you've found it!

A splash screen is an image that is displayed before the title screen, which is often used to introduce the company or team behind the making of the game. Here are a few examples:

Sample Splash Screens Spoiler
Image Image Image
Image Image Image

You get the idea.


A splash screen adds professionalism to your game!


Features

I don't call it "Ultimate" for nothing. This thing is packed with fully customizable options - but don't worry, it is still extremely simple to use and easy to understand! Everything you could want from a splash screen can be found right here!

  • Simple integration into any project!
  • By default, displays two splash screens before showing the title screen.
  • Easily add or remove as many splash screens as you like!
  • Automatically centers undersized images. No need to ensure standard title screen size!
  • Each splash screen is completely customizable.
  • You decide how long each splash screen takes to fade in, display, and fade out.
  • Supports Audio BGM, also fully customizable!
  • Easily add or remove BGM for each splash screen separately.
  • Easily set BGM fade out time for each splash screen separately.
  • Supports RPG Maker XP BGM library, or easily add your own audio!
  • Allow or disallow splash screen to be skipped with action button.
  • Easily disable the splash screen if you need to.
  • Script is fully commented and easy to understand!

New! Plug-n-Play Edition released!

Download the Demo below to see all of the features in action!

Demo

Ultimate Splash Scene 3.1.2

Ultimate Splash Scene 3.1.2 Plug-n-Play Edition

Script

Create a new class above Main called Scene_Splash (I like to put it just below Scene_Title) and paste the following code into it:
(For the Plug-n-Play Edition, please download the Demo)

  1. #==============================================================================
  2. # ** Scene_Splash (Ultimate Splash Scene 3.1.2)
  3. #    By: XeroVolume
  4. #    Date: Thursday, June 10, 2010
  5. #------------------------------------------------------------------------------
  6. #  Special Thanks: Brewmeister for help with the original counter!
  7. #------------------------------------------------------------------------------
  8. #  This class performs Splash screen processing
  9. #==============================================================================
  10.  
  11. class Scene_Splash
  12.   #----------------------------------------------------------------------------
  13.   # * Object Initialization
  14.   #----------------------------------------------------------------------------
  15.   def initialize
  16.     #--------------------------------------------------------------------------
  17.     #  The following variables can be customized to fit your preferences
  18.     #--------------------------------------------------------------------------
  19.     # Allow splash screen during playtest? (true = allow / false = do not allow)
  20.     @playtest = true
  21.     # Allow skip to title with SPACE or C? (true = allow / false = do not allow)
  22.     @skip = true
  23.     # Set the total amount of splash screens to be displayed (Default = 2)
  24.     @amount = 2
  25.     # Set amount of frames between each splash screen (Default = 51)
  26.     @space = 51
  27.     # Set amount of frames between final splash and title (Default = 0)
  28.     @title_space = 0
  29.     #--------------------------------------------------------------------------
  30.     #  Audio Options
  31.     #--------------------------------------------------------------------------
  32.     # Allow SE when skipping to title? (true = allow / false = do not allow)
  33.     @skip_se_allow = true
  34.     # Allow BGM for splash screen 1? (true = allow / false = do not allow)
  35.     @bgm1_allow = true
  36.     # Allow BGM for splash screen 2? (true = allow / false = do not allow)
  37.     @bgm2_allow =  true
  38.     # Set BGM for splash screen 1 (Default = 061-Slow04)
  39.     @bgm1 = '061-Slow04'
  40.     # Set BGM for splash screen 2 (Default = 062-Slow05)
  41.     @bgm2 = '062-Slow05'
  42.     # Set SE for skip to title function (Default = 003-System03)
  43.     @skip_se = '003-System03'
  44.     # Set fade out time (in seconds) for splash screen 1 audio (Default = 2.5)
  45.     @bgm1_out = 2.5
  46.     # Set fade out time (in seconds) for splash screen 2 audio (Default = 2.5)
  47.     @bgm2_out = 2.5
  48.     #--------------------------------------------------------------------------
  49.     #  Splash Screen 1 Options
  50.     #--------------------------------------------------------------------------
  51.     # Set file to be used for splash screen 1
  52.     @splash1 = '001-Splash01'
  53.     # Set amount of frames it takes for splash 1 to fade in (Default = 51)
  54.     @in_time1 = 51
  55.     # Set amount of frames that splash screen 1 stays opaque (Default = 102)
  56.     @pause_time1 = 102
  57.     # Set amount of frames it takes for splash 1 to fade out (Default = 51)
  58.     @out_time1 = 51
  59.     #--------------------------------------------------------------------------
  60.     #  Splash Screen 2 Options
  61.     #--------------------------------------------------------------------------
  62.     # Set file to be used for splash screen 2
  63.     @splash2 = '002-Splash02'
  64.     # Set amount of frames it takes for splash 2 to fade in (Default = 51)
  65.     @in_time2 = 51
  66.     # Set amount of frames that splash screen 2 stays opaque (Default = 102)
  67.     @pause_time2 = 102
  68.     # Set amount of frames it takes for splash 2 to fade out (Default = 51)
  69.     @out_time2 = 51
  70.     #------------------------------------------------------------------------
  71.     #  The following variables should not be adjusted
  72.     #------------------------------------------------------------------------
  73.     # Create loop counter (Must start at zero)
  74.     @counter = 0
  75.     # Set initial splash screen opacity (Must start at 0.0)
  76.     @fade = 0.0
  77.     # Calculate splash 1 fade in speed
  78.     @in_speed1 = (255.0 / @in_time1)
  79.     # Calculate splash 1 fade out speed
  80.     @out_speed1 = (255.0 / @out_time1)
  81.     # Calculate splash 2 fade in speed
  82.     @in_speed2 = (255.0 / @in_time2)
  83.     # Calculate splash 2 fade out speed
  84.     @out_speed2 = (255.0 / @out_time2)
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # * Main Processing
  88.   #--------------------------------------------------------------------------
  89.   def main
  90.     # Check for Battle Test
  91.     if $BTEST
  92.       # Switch to Title Screen
  93.       $scene = Scene_Title.new
  94.     end
  95.     # Check for Play Test
  96.     if $DEBUG && @playtest == false
  97.       # Switch to Title Screen
  98.       $scene = Scene_Title.new
  99.     end
  100.     # Load the System database & create a new game
  101.     $data_system = load_data("Data/System.rxdata")
  102.     $game_system = Game_System.new
  103.     # Create splash screen 1 graphic
  104.     @sprite1 = Sprite.new
  105.     @sprite1.bitmap = RPG::Cache.title(@splash1)
  106.     # Adjust sprite properties
  107.     @sprite1.ox = @sprite1.bitmap.width / 2
  108.     @sprite1.oy = @sprite1.bitmap.height / 2
  109.     # Center sprite on screen
  110.     @sprite1.x = 320
  111.     @sprite1.y = 240
  112.     # Set initial opacity
  113.     @sprite1.opacity = 0
  114.     # Create splash screen 2 graphic
  115.     @sprite2 = Sprite.new
  116.     @sprite2.bitmap = RPG::Cache.title(@splash2)
  117.     # Adjust sprite properties
  118.     @sprite2.ox = @sprite2.bitmap.width / 2
  119.     @sprite2.oy = @sprite2.bitmap.height / 2
  120.     # Center sprite on screen
  121.     @sprite2.x = 320
  122.     @sprite2.y = 240
  123.     # Set initial opacity
  124.     @sprite2.opacity = 0
  125.     # Stop playing ME and BGS
  126.     Audio.me_stop
  127.     Audio.bgs_stop
  128.     # Execute transition
  129.     Graphics.transition
  130.     # Main loop
  131.     loop do
  132.       # Update game screen
  133.       Graphics.update
  134.       # Update input information
  135.       Input.update
  136.       # Frame update
  137.       update
  138.       # Abort loop if screen is changed
  139.       if $scene != self
  140.         break
  141.       end
  142.       # Update loop counter
  143.       @counter += 1
  144.     end
  145.     # Prepare for transition
  146.     Graphics.freeze
  147.     # Dispose of Splash Screen graphics
  148.     @sprite1.dispose
  149.     @sprite1.bitmap.dispose
  150.     @sprite2.dispose
  151.     @sprite2.bitmap.dispose
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # * Frame update
  155.   #--------------------------------------------------------------------------
  156.   def update
  157.     # If C button was pressed
  158.     if Input.trigger?(Input::C) && @skip == true
  159.       if @skip_se_allow == true
  160.         # Play decision SE
  161.         $game_system.se_play(RPG::AudioFile.new(@skip_se))
  162.       end
  163.       # Switch to title screen
  164.       $scene = Scene_Title.new
  165.     end
  166.     # Fade Cycle
  167.     fade_cycle
  168.     # Update Graphics
  169.     @sprite1.update
  170.     @sprite2.update
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # * Fade Cycle
  174.   #--------------------------------------------------------------------------
  175.   def fade_cycle
  176.     # Determinent (Based on amount of splash screens remaining)
  177.     case @amount
  178.     # When 2 splash screens remain
  179.     when 2
  180.       # Check for audio
  181.       if @counter == 1 && @bgm1_allow == true
  182.         $game_system.bgm_play(RPG::AudioFile.new(@bgm1))
  183.       end
  184.       # Set splash screen 1's opacity level equal to @fade variable's value
  185.       @sprite1.opacity = @fade
  186.       # Fade in
  187.       if @counter <= @in_time1
  188.         @fade += @in_speed1
  189.       end
  190.       # Pause splash screen 1
  191.       if @counter >= @in_time1 + @pause_time1
  192.         # Fade out graphics
  193.         @fade -= @out_speed1
  194.       end
  195.       # Fade out BGM
  196.       if @counter == @in_time1 + @pause_time1
  197.         Audio.bgm_fade(@bgm1_out * 1000)
  198.       end
  199.       # Space between splash screens
  200.       if @counter >= @in_time1 + @out_time1 + @pause_time1 + @space
  201.         # Update splash screen amount
  202.         @amount -= 1
  203.         # Reset loop counter
  204.         @counter = 0
  205.         # Reset opacity variable
  206.         @fade = 0
  207.       end
  208.     # When 1 splash screen remains
  209.     when 1
  210.       # Check for audio
  211.       if @counter == 1 && @bgm2_allow == true
  212.         $game_system.bgm_play(RPG::AudioFile.new(@bgm2))
  213.       end
  214.       # Set splash screen 2's opacity level equal to @fade variable's value
  215.       @sprite2.opacity = @fade
  216.       # Fade in
  217.       if @counter <= @in_time2
  218.         @fade += @in_speed2
  219.       end
  220.       # Pause splash screen 2
  221.       if @counter >= @in_time2 + @pause_time2
  222.         # Fade out graphics
  223.         @fade -= @out_speed2
  224.       end
  225.       # Fade out BGM
  226.       if @counter == @in_time2 + @pause_time2
  227.         Audio.bgm_fade(@bgm2_out * 1000)
  228.       end
  229.       # Space between splash screens
  230.       if @counter >= @in_time2 + @out_time2 + @pause_time2 + @space
  231.         # Update splash screen amount
  232.         @amount -= 1
  233.       end
  234.       # When 0 splash screens remain
  235.     when 0
  236.       # Switch to Title Screen
  237.       $scene = Scene_Title.new
  238.     end
  239.   end
  240. end
Expand to see the code.


Instructions

One of the many great things about the Ultimate Splash Scene is that it is simple to install, and can be set up in less than a few minutes. Whether you are just starting a new project, or you have a full blown game nearly ready to be released, integration couldn't be easier. Before we get started, if you haven't already done so, please download the demo to obtain a copy of the script.

Detailed Instructions (Beginner Users) Spoiler
The first thing you need to do is create your splash screen images. They must be named like so:

001-Splash01
002-Splash02

The images must be placed in the "Titles" folder.

Now, open your project. Once you have done so, press F11 to open the Script Editor (or click Tools > Script Editor). Now look on the left side of the Script Editor where you will see a list of classes. Scroll down to the very bottom and click on “Main”. On the right side of the Script Editor you will now see the Main method. The default lines 10 and 11 should look like this:

# Make scene object (title screen)
$scene = Scene_Title.new

(If your main method has been altered, lines 10 and 11 could look different.) Either way, find the above mentioned lines and change them to this:

# Make scene object (splash screen)
$scene = Scene_Splash.new

This tells your main method to call the splash scene first, instead of the title scene.

(Note: Editing "main" is unnecessary when using the Plug-n-Play Edition, which may not be compatible with other Plug-n-Play scripts. If you are experiencing problems with this edition, try using the latest non-Plug-n-Play version available.)

(Note: If you have a custom script (that you need in addition to the splash screens) that skips the title screen in some way, then the Ultimate Splash Scene may need to be tweaked slightly. You can PM me directly, or post a "Help with Ultimate Splash Scene" Thread in the RPG Maker XP > Script Support section. I will be more than happy to assist you.

Next you will need to open the demo, and then open the Script Editor like before. Scroll down the list of classes until you see the class labeled “Scene_Splash”, just below “Scene_Title”. Right-Click on “Scene_Splash” and select “Copy” from the drop-down menu. Now, go back to your project's Script Editor and Right-Click on the class just below “Scene_Title”. (It will most likely be “Scene_Map”.) Select “Paste” from the drop-down menu. This will insert a new class just below “Scene_Title” called “Scene_Splash”.

Congratulations! You have installed the Ultimate Splash Scene into your project! Close the Script Editor and run a playtest to see what it looks like, and to decide what you would like to customize.

For further assistance, and a detailed explanation of each customizable variable, full documentation is provided with the Demo.


Quick Instructions (Advanced Users) Spoiler
1. Put script above main
2. Edit main to call Scene_Splash.new instead of Scene_Title.new (unnecessary when using the Plug-n-Play Edition)
3. Put splash screen images in the "Titles" folder in the following format:

001-Splash01
002-Splash02

4. Enjoy the Ultimate Splash Scene!


Compatibility

As far as I know, this script shouldn't interfere with any other script (other than splash screens of course 😀). If you run into any kind of problem, you can PM me.

The Plug-n-Play Edition may not be compatible with other Plug-n-Play scripts. If you are experiencing problems with this edition, try using the latest non-Plug-n-Play version available.

Credits and Thanks

Thanks to Brewmeister for the counter idea, and helping me get it to work!

Author's Notes

This script is heavily commented, as I believe scripts should be. You should be able to figure out what's going on quite easily. Feel free to revise and improve upon this script as much as you like. Let me know what you come up with!

Terms and Conditions

I would love to know if you decide to use this script in your game! Just give me a mention in your credits!
Version Update (3.0 to 3.1)
Looks good. Formatting & documentation is great!

You need to update the instructions in this thread. (Change "Scene_Title" to "Scene_Splash"), and you used a non-RTP bgm but didn't include it.

You initialize @splash_bgs & @splash_se but don't use them. You also stopped me & bgs, which most likely wouldn't be playing since this is the first scene in the game. (Unless the scene will be called later in the game, for example from the Scene_Gameover scene.)

You could use a variable for fade time so an inexperienced user of the script can set that time as well.

A possible enhancement would be handling non-standard size images. I coincidentally grabbed a couple of images that were half scale (320 x 240) when I play tested & they display in the upper-left corner. (either center or scale the images)

I probably would have reconsidered the title. There is already a script with the exact same name, and the "Super Simple" phrase was coined by Lambchop. There's no Trademark, so technically it's OK, but it makes it look like you are trying to step on her script to get people to use yours instead.

Welcome to the wonderful world of programming.
Thanks for the tips Brewmeister! Proper formatting and documentation was my first priority from the start. BTW, you've been a great help to me on this project. I took pretty much ALL of your advise and incorporated it into my script, plus some!

  • Instructions have been updated
  • Script now uses RTP BGM
  • Variable fade time for each splash separately.
  • Script now handles non-standard size images automatically
  • Changed the name from "Super Simple Splash" to "Ultimate Splash Scene".

Version update! I made quite a leap from 2.0 to 3.0! A lot has changed in this update, so I decided to change the name as well! My new Ultimate Splash Scene is fully customizable, yet still "super simple" to use. I'm quite certain that anything you could want from a Splash Screen Script can be found right here!

The Plug-n-Play Edition has been released!
Version Update (3.1 to 3.1.2)

- Added two lines of code to ensure the splash bitmaps are disposed of properly

*NOTE* - This update is important to ensure that image bitmaps are not lingering around during your game and wasting memory. Therefore, please ensure that you are using the most current updated version.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=70858