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

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!
 
I don't know why you suggest using GIF images ... they are much bigger in filesize than i.e. JPEGs and also support only 256 colors. I'd suggest using JPEGs for fullscreen images ...
You should also change the to-tile-input processing so that the screen fades to black before it switches to title, this way it looks off.

Besides that, it looks nice and clean ... keep up the simple-yet-effective work, I like that kind of script :D
 
@BlueScope
Sometimes GIFs are smaller, sometimes JPGs are smaller.

For pictures that have 256 colors or less, GIF is great and will save you tons of space. JPG is good for photo-quality pictures. I like GIFs because when there aren't enough colors, you get a uniform pixelated effect. With JPGs, you can save them as 100%, which is very expensive to space, or enjoy a distorted image with squiggly marks around the edges.

To be quite honest though, I think PNG is the best format. The 8-bit and 24-bit feature can do everything a GIF and JPG can do, and the size is about the same.
 
Of course GIF is better for low-color images, but there might be people reaing this that don't even know GIF is restricted to 256, therefore convert there images and wonder why they look like NES graphics *lol* It's very uncommon in 'experienced' forums like these, but you never know and should at least point out that you don't have to use GIFs, because your text poins to exactly that for people that don't know how scripts work.
 

Zoom

Member

BlueScope said:
Of course GIF is better for low-color images, but there might be people reaing this that don't even know GIF is restricted to 256, therefore convert there images and wonder why they look like NES graphics *lol*
The NES was only capable of displaying 54 colors or so. Also, the Genesis could only display 64 except under certain tricks, and the SNES could display 256 but drew from a palette of 32768 colors; thus the comparisons to GIF don't work well with console systems.
 
I like PNG for being able to retain the crispness of my title screen, but it's pretty massive in file size compared to a jpeg. But jpeg is just so much lower quality unless you let it be fairly large. I think I'll have to try changing it to a gif and see how well that converts.
 
@bchop: Nice :P

@Zoom: I didn't knew that (besides the SNES palette thingy, which is quite obvious if you ripped graphics from it like hell :P ), but I simply tried to said that they might wonder why their graphics look worse than before after converting to GIF.
 
I was asked about this earlier...

This line controls how long a splash screen displays:
@n > 255

This line controls how quickly a splash screen loads:
@n += 2

This line controls how quickly a splash screen goes away:
@n -= 2

Hope this helps!
 
What'd help more (hence I got the other thing before you posted :P ) is this:
BlueScope said:
You should also change the to-tile-input processing so that the screen fades to black before it switches to title, this way it looks off.
It'd be better, too, if you would be transferred to the second splash screen instead of directly to the title screen ^_^
 
True, but my goal was to create a nice, simple base for everyone. Something that would make it easier for everyone to modify and make much cooler. :)
 
In other words, it's fine with you if I give it a try? ^_^ I'll get on this as soon as I finish my other scripting work, then I'll call back... :D
 
This would be very nice for a game that you would sell. I wouldn't every really use this because I'm not really fully into making games because im a icon maker. But yeah, this would be pretty cool to use.
 
Well, even free games have developers that might to put their names and logos at the beginning... I'm a prove for this :P

@bchop: I'll give it a try now, but only 'til 0 AM (one hour for me)... wish me luck :D
 
Im not really into putting that at the begining of a free game because either way youll have a credit screen (hopefully, if you dont your an idiot).
 
Code:
#==============================================================================
# Scene_Splash
#--------------------------------------------------------------------------
# Script by Iambchop
#==============================================================================

class Scene_Splash
  #--------------------------------------------------------------------------
  def main
    $data_system = load_data("Data/System.rxdata")
    $game_system = Game_System.new
    @show = true
    @hide = false
    @n = 0
    @splash_numb = 2
    @sprite1 = Sprite.new
    @sprite1.bitmap = RPG::Cache.title("Splash01")
    @sprite1.opacity = 0
    @sprite2 = Sprite.new
    @sprite2.bitmap = RPG::Cache.title("Splash02")
    @sprite2.opacity = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update 
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @sprite1.dispose
    @sprite2.dispose
  end
  #--------------------------------------------------------------------------
  def update
    if Input.trigger?(Input::C)
      case @splash_numb
      when
        @show = false
        @hide = true
        transition
      when 2
        @show = false
        @hide = true
        transition
      end
    end
    transition
    @sprite1.update
    @sprite2.update
  end
  #--------------------------------------------------------------  
  def transition
    if @show == true
      @n += 5
      if @n > 750
        @hide = true
        @show = false
        @n = 255
      end
    end
    if @hide == true
      @n -= 5
      if @n < 0
        @hide = false
        @show = true
        @splash_numb -= 1
        @n = 0
      end
    end
    case @splash_numb
    when 0
      $scene = Scene_Title.new
    when 1
      @sprite2.opacity = @n
    when 2
      @sprite1.opacity = @n
    end
  end
  #-------------------------------------------------------------------------- 
end
It was actually quite simple, but I needed a bit of time to figure I need to @show=false to get it to work... beware to give credit :P

@gorechild: Yeah, but that doesn't mean I don't need a splash screen... the credits appear at the end of the game, a splash screen appears at every start of the game, so it's viewed more often and therefore, the creator gets more popularity because every player of the game reads his name... and gaining popularity can be a purpose of a free game, can't it?
 
@chucker: You will if you play around with the C-key (Enter/C)... there's also a newer version which I'm even more satisfied with... I developed this one with my game's progress...

Code:
#==============================================================================
# Scene_Splash
#--------------------------------------------------------------------------
# Script by Iambchop
#==============================================================================

class Scene_Splash
  #--------------------------------------------------------------------------
  def main
    $data_system = load_data("Data/System.rxdata")
    $game_system = Game_System.new
    @show = true
    @hide = false
    @n = 0
    @splash_numb = 2
    @sprite1 = Sprite.new
    @sprite1.bitmap = RPG::Cache.title("Splash01")
    @sprite1.opacity = 0
    @sprite2 = Sprite.new
    @sprite2.bitmap = RPG::Cache.title("Splash02")
    @sprite2.opacity = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @sprite1.dispose
    @sprite2.dispose
  end
  #--------------------------------------------------------------------------
  def update
    if Input.trigger?(Input::C)
      case @splash_numb
      when 1
        if @n > 128
          @show = false
          @hide = true
          transition
        end
      when 2
        if @n > 128
          @show = false
          @hide = true
          transition
        end
      end
    end
    transition
    @sprite1.update
    @sprite2.update
  end
  #--------------------------------------------------------------  
  def transition
    if @show == true
      @n += 5
      if @n > 750
        @hide = true
        @show = false
        @n = 255
      end
    end
    if @hide == true
      @n -= 5
      if @n < 0
        @hide = false
        @show = true
        @splash_numb -= 1
        @n = 0
      end
    end
    case @splash_numb
    when 0
      $scene = Scene_Title.new
    when 1
      @sprite2.opacity = @n
    when 2
      @sprite1.opacity = @n
    end
  end
  #-------------------------------------------------------------------------- 
end

Again, don't credit me, but bchop ^_^
 

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