Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Super Simple Splash Screen

@Chop: very nice and cool script.
I've been looking over your script and noticed you can add as many splash screens as you want.
@sprite3 = Sprite.new
@sprite3.bitmap = RPG::Cache.picture("Intro-3")
@sprite3.opacity = 0

when 3
@sprite1.opacity = @n

and just add a picture named Intro-3 or 4 or what ever the person wants the number of splash screens to be. If I'm not mistaken. That is.
-=Edit=-
I've tested what I thought would work and it dose with a little editing to Lambchop's script.
#------------------------------------------------------------------------
# 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 = 3

# 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

@sprite3 = Sprite.new
@sprite3.bitmap = RPG::Cache.picture("Intro-3")
@sprite3.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
@sprite3.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
@sprite3.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
@sprite3.opacity = @n
when 2
@sprite2.opacity = @n
when 3
@sprite1.opacity = @n
end

end


end
This is what I did and it works great for a three splash intro.
 
@Mr. Poofy:
It's rather easy to add music to this script just add this:
Audio.bgm_play("Audio/BGM/filename", 100, 100)
This will play the music you want.
examples:
Audio.bgm_play("Audio/BGM/014-Theme03", 100, 100)
Audio.bgm_play("Audio/BGM/001-Battle01", 100, 100)
Audio.bgm_play("Audio/BGM/011-LastBoss03", 100, 100)
or anything you want it to play.

But set it here:
# Load the System database & create a new game
$data_system = load_data("Data/System.rxdata")
$game_system = Game_System.new
# Play Theme03 BGM
Audio.bgm_play("Audio/BGM/014-Theme03", 100, 100)
# Initialize some transition stuff
@show = true
@hide = false
@n = 0
@splash_numb = 3
 
*Sigh*
Here is an explination for the file formats...

JPEG(Joint Photograhic Experts Group) - JPEG Form is commonly used to display photographs and other continous-tone images in HTML documenters over the World Wide Web and other online services. They are good for displaying on webpages and sending as email attatchments because of the smaller file size. They are conpressed by eliminating image informaton within 8x8 pixel squares. File size reduction can be dramatic as higher levels of compression are used. Different images compress to different sizes depending on the detail in the original images. The Major problem with JPEG's is that they are not good for storage and reuse as they degrade rather severly, especially if resaved (and that means compressed over and over again... more loss of data) multiple times.

GIF - Graphics Interchange Format - A GIF is the graphics format of choice for most non-hotographic images on the World Wide Web. Like TIFF, PICT, or JPEG, saving in GIF format combines layers with the background. It also reduces the number of colors to a max of 256. GIFs are also commonly used for animation purposes.

PNG - Portable Network Graphics - PNG is a bitmap image format that employs lossless data compression. PNG was created to both improve upon and replace the GIF format with an image file format that does not require patent license to use.

That is the only arguable differences between any of these file formats, it is a matter of preference, none is better than the other, each has a flaw and advantage.
 
explain to me why?
Code:
@show = true
@hide = false
they're always paired together and opposite of eachother
as far as i can see, if you change:
Code:
@hide == true
to
Code:
@show == false
you can remove all
Code:
@hide = false
and
Code:
@hide = true
this seems to be working...
Code:
#==========================================================================
# Scene_Splash
#--------------------------------------------------------------------------
# Script by Iambchop
# 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
    # Play title BGM
    $game_system.bgm_play($data_system.title_bgm)
    # Initialize some transition stuff
    @show = true
    @n = 0
    @splash_numb = 2
    # Define info about each splash screen
    @sprite1 = Sprite.new
    @sprite1.bitmap = RPG::Cache.title($data_system.title_name)
    @sprite1.opacity = 0
    @sprite2 = Sprite.new
    @sprite2.bitmap = RPG::Cache.title($data_system.title_name)
    @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 C button was pressed, go to the next spash
    if Input.trigger?(Input::C)
      case @splash_numb
      when 1
        if @n > 128
          @show = false
          transition
        end
      when 2
        if @n > 128
          @show = false
          transition
        end
      end
    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 += 5
      if @n > 750
        @show = false
        @n = 255
      end
    end
    # Fade out a splashscreen and load the next one
    if @show == false
      @n -= 5
      if @n < 0
        @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
 
Selwyn;119120 said:
Sorry, but no. RMXP doesn't support gif files.
Nice script though. :)
Yes it does... it doesn't support animated GIFs though, which is what has been bought by Compuserve. Animated GIFs will get reduced to their first frame, while you can normally use non-animated GIFs according to my knowledge.
 
used some array functions on it to make it more flexible.

now you only have to edit/extend
Code:
    @splash[0] = Sprite.new
    @splash[0].bitmap = RPG::Cache.title($data_system.title_name)
    @splash[0].opacity = 0
    @splash[1] = Sprite.new
    @splash[1].bitmap = RPG::Cache.title($data_system.title_name)
    @splash[1].opacity = 0
and all other things will be calcuated automagically
Code:
#============================================================================
# Scene_Splash
#----------------------------------------------------------------------------
# Script by Iambchop & alexanderpas
# Show splashscreen(s) 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
    # Play title BGM
    $game_system.bgm_play($data_system.title_bgm)
    # Initialize some transition stuff
    @show = true
    @n = 0
    @splash = []
    # Define info about each splash screen
    @splash[0] = Sprite.new
    @splash[0].bitmap = RPG::Cache.title($data_system.title_name)
    @splash[0].opacity = 0
    @splash[1] = Sprite.new
    @splash[1].bitmap = RPG::Cache.title($data_system.title_name)
    @splash[1].opacity = 0
    # copy the length of the array into another variable
    # so progress can be followed trough it
    @splash_numb = @splash.size
    # 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
    for i in 0...(@splash.size)
      @splash[i].dispose
    end
  end
  #--------------------------------------------------------------------------
  # Update the contents in this scene
  #--------------------------------------------------------------------------
  def update
    # If C button was pressed, go to to title screen
    if Input.trigger?(Input::C)
      if (@splash_numb != 0 && @n > 128)
        @show = false
        transition
      end
    end
    # Change the opacity of the graphics
    transition
    # Update graphics
    for i in 0...@splash.size
      @splash[i].update
    end
  end
  #--------------------------------------------------------------------------
  # Transition through splash screens
  #--------------------------------------------------------------------------
  def transition
    # Fade in a splashscreen
    if @show == true
      @n += 5
      if @n > 750
        @show = false
        @n = 255
      end
    end
    # Fade out a splashscreen and load the next one
    if @show == false
      @n -= 5
      if @n < 0
        @show = true
        @splash_numb -= 1
        @n = 0
      end
    end
    # Choose which action to perform in this scene
    if (@splash_numb != 0)
      @splash[(@splash.size - @splash_numb)].opacity = @n
    else
      $scene = Scene_Title.new
    end
  end
end
btw: i added myself to the script credits too ;) you'll see why if you read the code.

yes, you still need to call Scene_Splash from main
 
lambchop;58556 said:
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[/FONT] to Scene_Splash.new[/FONT].
Code:
  $scene = Scene_Splash.new

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

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


3. Add this Scene_Splash[/FONT] 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!


I give you props on this. It works nicely and it's awesome. :yes:
 
My biggest prob, is that i have a normal scene_title that loads on the Start, continute, QUIT screen. The splash rules, but it superimposes itself on my normal scene_title picture.. So a splash image-1 will load by fading in, ONTOP of my normal scene title script, then fade out, leaving 2 images superimposed on each other. Any way, to hide my normal title if scene splash is loading, then make it visible again once the series of scene splashes are gone.
 

Jason

Awesome Bro

Ze Straw try this, It's untested but should allow you to use 4 screens.
Code:
#------------------------------------------------------------------------
# Show two splashscreens when your game loads
#------------------------------------------------------------------------
class Scene_Splash
  
 #--------------------------------------------------------------------------
 # â—
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top