Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Super Simple Splash Screen
amaranth
post Dec 21 2008, 07:07 PM
Post #1


Level 6
Group Icon

Group: Member
Posts: 78
Type: Developer
RM Skill: Masterful




I'm moving all of my scripts from rmxp.org to this site. I like it here better.

Introduction
This is a really simple splash screen for you. When you use this, two splash screens will appear when you open your game.

Steps
1. Open Main and change Scene_Title.new to Scene_Splash.new.
CODE
  $scene = Scene_Splash.new


2. Put two graphics called Intro-1.png and Intro-2.png into your project's \Graphics\Pictures folder.

(note: these graphics can also be jpgs, gifs, or bmps... it really depends upon your preference)


3. Add this Scene_Splash script above Main:
CODE
#------------------------------------------------------------------------
# Show two splashscreens when your game loads
#------------------------------------------------------------------------
class Scene_Splash
  
#--------------------------------------------------------------------------
# ● Initialize the scene
#--------------------------------------------------------------------------  
def main
  
# Load the System database & create a new game  
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new

# Initialize some transition stuff
@show = true
@hide = false
@n = 0
@splash_numb = 2

# Define info about each splash screen
@sprite1 = Sprite.new
@sprite1.bitmap = RPG::Cache.picture("Intro-1")
@sprite1.opacity = 0

@sprite2 = Sprite.new
@sprite2.bitmap = RPG::Cache.picture("Intro-2")
@sprite2.opacity = 0

# Update graphics and input
Graphics.transition
loop do
   Graphics.update
   Input.update
   update
   if $scene != self
     break
   end
end

# Discard your graphics when you leave this scene
Graphics.freeze
@sprite1.dispose
@sprite2.dispose
  
end

#--------------------------------------------------------------------------
# ● Update the contents in this scene
#--------------------------------------------------------------------------

def update
  
   # If SPACEBAR is pressed, go to to title screen
   if Input.trigger?(Input::C)
      $scene = Scene_Title.new
   end
  
   # Change the opacity of the graphics
   transition
  
   # Update graphics
   @sprite1.update
   @sprite2.update
  
end
  
#--------------------------------------------------------------
# Transition through splash screens
#--------------------------------------------------------------  
def transition
        
      # Fade in a splashscreen
      if @show == true
         @n += 2
         if @n > 255
           @hide = true
           @show = false
           @n = 255
         end
       end
      
      # Fade out a splashscreen and load the next one
      if @hide == true
         @n -= 2
         if @n < 0
           @hide = false
           @show = true
           @splash_numb -= 1
           @n = 0
         end
       end      
      
      # Choose which action to perform in this scene
      case @splash_numb      
        when 0
          $scene = Scene_Title.new
        when 1
          @sprite2.opacity = @n
        when 2
          @sprite1.opacity = @n
      end      
      
end


end


4. Play your game!


__________________________
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- amaranth   Super Simple Splash Screen   Dec 21 2008, 07:07 PM
- - ShadowKing55   If I only have Intro-1.png will it show another bl...   Dec 21 2008, 08:02 PM
- - amaranth   It will crash. Delete everything for splash2, chan...   Dec 21 2008, 08:56 PM
- - ShadowKing55   If you're not to busy, could you do it to wher...   Dec 22 2008, 11:45 AM
- - amaranth   Sure. Here you go: CODE#-------------------------...   Dec 22 2008, 11:48 AM
- - ShadowKing55   tyvm ^^   Dec 22 2008, 11:56 AM
- - Thelozeldaman   Awesome script! Can't wait to use it.   Mar 4 2009, 10:42 PM
- - Momo_san   Want to try it for myself.. Thanx   Mar 5 2009, 01:00 AM
- - Redd   Very nice. I've used this somewhere before, pr...   Mar 6 2009, 11:18 AM
- - Momo_san   I already put in my game project,and it worked jus...   Mar 6 2009, 05:30 PM
|- - DespairReigns   Is there a way for it to start playing the beginni...   May 10 2009, 04:37 PM
- - handy333   Is it possible to change the x and y values of a s...   Aug 26 2009, 05:53 PM
- - brewmeister   slightly modified. Will center each picture. (adde...   Aug 27 2009, 12:39 PM
- - Zeffa   Sick, I'll be using this script. Will give cre...   Oct 8 2009, 04:07 AM
- - dorky106   Unable to find file Data/System.rxdata can i get h...   Oct 15 2009, 08:34 AM
|- - kudozus   QUOTE (dorky106 @ Oct 15 2009, 09:34 AM) ...   Sep 3 2011, 05:18 AM
- - Seitei Son Goku   You know, I realized that the RPG Maker XP engine ...   Apr 5 2010, 10:59 PM
- - gyashinero   Is there any way to display the splash for longer?...   May 26 2010, 06:13 PM
- - Night_Runner   @> gyashinero: Welcome to the forums To put a ...   May 27 2010, 03:13 AM
- - EvillyElven   Question: Is it possible to have it play an SE or ...   Feb 3 2011, 06:16 AM
- - Night_Runner   Answer: Yes; it is possible. At the end of the sc...   Feb 6 2011, 02:37 PM
|- - EvillyElven   THANK YOU! You rule!   Feb 13 2011, 05:42 AM
- - Phantom0x0   When you say "Add Script Above Main" wha...   Jun 18 2011, 10:37 PM
- - Night_Runner   In the script editor, along the left, scroll all t...   Jun 18 2011, 10:57 PM
- - vincent329   insted of useing a pic is there anyway to show lik...   Jul 9 2011, 07:17 PM
- - Night_Runner   Data/System.rxdata is a very critical file for you...   Sep 8 2011, 11:44 PM
- - Nof56   Great Script! Easy to set up and easy to use...   Nov 7 2011, 10:14 AM
- - DoctorTodd   I'm having the same problem where it can't...   Nov 25 2011, 04:11 PM
- - Night_Runner   Would you be able to upload a demo of your game pl...   Nov 26 2011, 05:14 AM
- - DoctorTodd   QUOTE (Night_Runner @ Nov 26 2011, 06:14 ...   Nov 26 2011, 10:34 PM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 07:04 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker