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
   
2 Pages V   1 2 >  
Start new topic
Replies (1 - 19)
ShadowKing55
post Dec 21 2008, 08:02 PM
Post #2


Level 3
Group Icon

Group: Member
Posts: 32
Type: Writer
RM Skill: Skilled




If I only have Intro-1.png will it show another blank screen?


__________________________
Need a writer for your game? PM me

Go to the top of the page
 
+Quote Post
   
amaranth
post Dec 21 2008, 08:56 PM
Post #3


Level 6
Group Icon

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




It will crash. Delete everything for splash2, change @splash_numb = 2 to @splash_numb = 1. In case @splash_numb, make sure you put splash1 under case 1, not case 2.


__________________________
Go to the top of the page
 
+Quote Post
   
ShadowKing55
post Dec 22 2008, 11:45 AM
Post #4


Level 3
Group Icon

Group: Member
Posts: 32
Type: Writer
RM Skill: Skilled




If you're not to busy, could you do it to where there is only one? I would try like you said but I know nothing of scripting.


__________________________
Need a writer for your game? PM me

Go to the top of the page
 
+Quote Post
   
amaranth
post Dec 22 2008, 11:48 AM
Post #5


Level 6
Group Icon

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




Sure. Here you go:

CODE
#------------------------------------------------------------------------
# Show one 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 = 1

# Define info about each splash screen
@sprite1 = Sprite.new
@sprite1.bitmap = RPG::Cache.picture("Intro-1")
@sprite1.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
  
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
  
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
          @sprite1.opacity = @n
      end      
      
end


end


__________________________
Go to the top of the page
 
+Quote Post
   
ShadowKing55
post Dec 22 2008, 11:56 AM
Post #6


Level 3
Group Icon

Group: Member
Posts: 32
Type: Writer
RM Skill: Skilled




tyvm ^^


__________________________
Need a writer for your game? PM me

Go to the top of the page
 
+Quote Post
   
Thelozeldaman
post Mar 4 2009, 10:42 PM
Post #7



Group Icon

Group: Member
Posts: 2
Type: Event Designer
RM Skill: Beginner




Awesome script! Can't wait to use it.


__________________________
I_Don't_Care_I_Want_To_Game_ @_@
Go to the top of the page
 
+Quote Post
   
Momo_san
post Mar 5 2009, 01:00 AM
Post #8


Level 1
Group Icon

Group: Member
Posts: 10
Type: None
RM Skill: Beginner




Want to try it for myself..
Thanx wink.gif


__________________________
Nothing impossible if you try hard enough
Go to the top of the page
 
+Quote Post
   
Redd
post Mar 6 2009, 11:18 AM
Post #9


:<
Group Icon

Group: Revolutionary
Posts: 2,314
Type: Developer
RM Skill: Advanced




Very nice. I've used this somewhere before, probably .org, but I will use it definetely!

EDIT: Shadowking55... your sig scared the shit outta me.


__________________________
Go to the top of the page
 
+Quote Post
   
Momo_san
post Mar 6 2009, 05:30 PM
Post #10


Level 1
Group Icon

Group: Member
Posts: 10
Type: None
RM Skill: Beginner




I already put in my game project,and it worked just totally fine!! laugh.gif
Than'x a lot wink.gif


__________________________
Nothing impossible if you try hard enough
Go to the top of the page
 
+Quote Post
   
DespairReigns
post May 10 2009, 04:37 PM
Post #11


Level 13
Group Icon

Group: Revolutionary
Posts: 236
Type: Artist
RM Skill: Advanced




Is there a way for it to start playing the beginning BGM while the first splash is showing?
Please and thank you XD
Go to the top of the page
 
+Quote Post
   
handy333
post Aug 26 2009, 05:53 PM
Post #12


Level 1
Group Icon

Group: Member
Posts: 12
Type: Developer
RM Skill: Advanced




Is it possible to change the x and y values of a small picture?


__________________________
Master Handy Fox
Go to the top of the page
 
+Quote Post
   
brewmeister
post Aug 27 2009, 12:39 PM
Post #13


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




slightly modified. Will center each picture. (added lines 25-26, 31-32)

CODE
#------------------------------------------------------------------------
# Show two splashscreens when your game loads
# 27Aug09 Brew Modified to Center Images
#------------------------------------------------------------------------
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
@sprite1.x = 320 - @sprite1.bitmap.width / 2
@sprite1.y = 240 - @sprite1.bitmap.height / 2

@sprite2 = Sprite.new
@sprite2.bitmap = RPG::Cache.picture("Intro-2")
@sprite2.opacity = 0
@sprite2.x = 320 - @sprite2.bitmap.width / 2
@sprite2.y = 240 - @sprite2.bitmap.height / 2

# 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


__________________________
Go to the top of the page
 
+Quote Post
   
Zeffa
post Oct 8 2009, 04:07 AM
Post #14


Level 8
Group Icon

Group: Revolutionary
Posts: 130
Type: Artist
RM Skill: Intermediate




Sick, I'll be using this script. Will give credit in... Well... The credits.

Thanks again!


__________________________
Illustrator/GraphicDesigner, if you want somert... Like an illustration or a logo? Just ask! (Nothing too crazy though) ;)
For the love, the art, the game, the metal and the sex... And thanks for the freebies.


Out Now!
Awaiting reviews and feedback.

Current Project: Exodus: Escape Fort Bullwark
Engine: RMXP
Completion: Chapter One, 100%
Release Date: Out now, Winter 2009
Download Link: Via MediaFire

Exodus Full Game Thread
Exodus Forum Topic
Exodus Screen Gallery
Go to the top of the page
 
+Quote Post
   
dorky106
post Oct 15 2009, 08:34 AM
Post #15


Level 11
Group Icon

Group: Revolutionary
Posts: 183
Type: Developer
RM Skill: Beginner




Unable to find file Data/System.rxdata
can i get help with this?

This post has been edited by dorky106: Oct 15 2009, 08:43 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Seitei Son Goku
post Apr 5 2010, 10:59 PM
Post #16


Level 1
Group Icon

Group: Member
Posts: 13
Type: Writer
RM Skill: Intermediate




You know, I realized that the RPG Maker XP engine did not have a default method of an opening. You can't have a game without some type of opening showing the personal symbol or signature of the game creator! But this script solved all of that! Much obliged! cool.gif

This post has been edited by Seitei Son Goku: Apr 5 2010, 11:01 PM


__________________________
If you need help or tips with your games storyline, character texts, or even the build of your credits, PM or Email me!

QUOTE
No one person can do everything, but everyone can do something...
Go to the top of the page
 
+Quote Post
   
gyashinero
post May 26 2010, 06:13 PM
Post #17



Group Icon

Group: Member
Posts: 1
Type: Developer
RM Skill: Skilled




Is there any way to display the splash for longer? It just kind of fades out as soon as it appears.


__________________________
MY GAMES

INSOMNIAC - A modern action-horror game with voice acting. (In development)
Go to the top of the page
 
+Quote Post
   
Night_Runner
post May 27 2010, 03:13 AM
Post #18


Level 50
Group Icon

Group: +Gold Member
Posts: 1,528
Type: Scripter
RM Skill: Undisclosed




@> gyashinero: Welcome to the forums smile.gif To put a pause in, somewhere about the middle of the code there's a snippet that reads:
CODE
      # Fade in a splashscreen
      if @show == true
         @n += 2
         if @n > 255
           @hide = true
           @show = false
           @n = 255
         end
       end


Change that to read:

CODE
      # Fade in a splashscreen
      if @show == true
         @n += 2
         if @n > 255
           # This is at full opacity, so we'll put a pause in!
           for i in 0..40      # For 40 frames
             Graphics.update    # Update the grahics (basically a pause)
           end
           @hide = true
           @show = false
           @n = 255
         end
       end


If you prefer to work in seconds instead of frames, change the 40 to 3 * Graphics.frame_rate which'll make it last 3 seconds smile.gif


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   
EvillyElven
post Feb 3 2011, 06:16 AM
Post #19



Group Icon

Group: Member
Posts: 2
Type: Mapper
RM Skill: Intermediate




Question: Is it possible to have it play an SE or ME for each title?
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Feb 6 2011, 02:37 PM
Post #20


Level 50
Group Icon

Group: +Gold Member
Posts: 1,528
Type: Scripter
RM Skill: Undisclosed




Answer: Yes; it is possible.

At the end of the script you'll find the code:
CODE
      # 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

What you can do is edit this to read as follows:
CODE
      # Choose which action to perform in this scene
      case @splash_numb      
        when 0
          $scene = Scene_Title.new
          Audio.me_stop
        when 1
          @sprite2.opacity = @n
          Audio.me_play("Audio/ME/Intro2Melody", 100, 100) if @n == 2 and @show
        when 2
          @sprite1.opacity = @n
          Audio.me_play("Audio/ME/Intro1Melody", 100, 100) if @n == 2 and @show
      end


Where "Audio/ME/Intro2Melody" is the melody you're trying to play, the first 100 is the volume, and the second 100 is the pitch smile.gif


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
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: 25th May 2013 - 11:48 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker