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.

Full Screen & Splash Screen Combo!

Introduction

Since alot of people always ask me about these scripts, I figured I might as well post them outside of my ever so outdated Test Bed, especially since they've been 100% re-coded twice! These two scripts can be used together or seperately, the first script Full Screens your game (only if you want it to, it also has a special promt), then sends you to the next scene (you can specify in module). The second script (which I usually call after the FullScreen one) is the Splash system. There are many scripts like these, matter of fact my Splash script was inspired by DubeAlex's and also Lambchop has one too, so I'll go ahead and give her a special recognition too. The only thing that makes my scripts special is the extra care I put into making them dynamic and easy to set up!

Requirements

These scripts only require the SDK::Scene_Base (Part 1 of SDK), if need be I'll edit them for people who don't use SDK but I choose to use it so get used to it! The Splash System requires your own graphics in the "Graphics/Titles" folder. I'm sorry, I'm not a spriter, its up to you to use your own graphics dude!

Instructions

Well, both of these scripts come with their own module, the constants have descriptions so I shouldn't need to post any, but let me know if you need some help figuring out how something works. The FullScreen script is supposed to be loaded before the first scene of your game, so go into 'main' at the bottom of the script editor, and change "$scene = Scene_Title.new" to "$scene = Scene_FullScreen.new" (or Scene_Splash if you want Splash to play before title.)

To-Do's and not To-Do's

FullScreen

  • [#] Create the ability to know if the game is Full Screen or not
    [#] Upgrade the method so you can specify FullScreen.toggle(true/false)

Splash System

  • [#] I donno, you tell me ;)

The Scripts

Code:
#===============================================================================
# ** Full Screen Script
#-------------------------------------------------------------------------------
# Written by  : Kain Nobel
# Version     : 2.5
# Last Update : 09.02.2008
# Created On  : 06.30.2008
#===============================================================================
# * Description    :
#-----------------------------------------------------------------------------
#   This script will ask you before your game begins if you'd like to
#   go fullscreen, or it'll automatically full screen the game for you
#   without a prompt.
#===============================================================================
# * Instructions   :
#-------------------------------------------------------------------------------
#   Place below SDK and above 'main'. This script needs to be loaded before
#   Scene_Title, so we'll go into 'main' and change this line...
#
#   $scene = Scene_Title.new        => $scene = Scene_FullScreen.new
#
#   Then, you can specify a Next Scene, or leave blank and it'll default to
#   Scene_Title after the sequence is done.
#===============================================================================

#-------------------------------------------------------------------------------
# * SDK Log
#-------------------------------------------------------------------------------
SDK.log('System.FullScreen', 'Kain Nobel', 2.5, '11.27.2008')
SDK.check_requirements(2.0, [1])
#-------------------------------------------------------------------------------
# * SDK Enable Test - BEGIN
#-------------------------------------------------------------------------------
if SDK.enabled?('System.FullScreen')

#===============================================================================
# ** FullScreen
#-------------------------------------------------------------------------------
#   This module handles generic FullScreen script options.
#===============================================================================

module FullScreen
  #-----------------------------------------------------------------------------
  # * GameMode
  #    0.) Enabled in Game.exe & Playtest
  #    1.) Enabled only in Game.exe
  #    2.) Enabled only in Playtest
  #    ?.) Any other setting, its not enabled at all
  #-----------------------------------------------------------------------------
  GameMode     = 1
  #-----------------------------------------------------------------------------
  # * Automatic FullScreen w/o promt?
  #-----------------------------------------------------------------------------
  Automatic    = true
  #-----------------------------------------------------------------------------
  # * Next Scene after FullScreen
  #-----------------------------------------------------------------------------
  Next_Scene  = 'Scene_Splash'
  #-----------------------------------------------------------------------------
  # * The question string asking player if they want fullscreen.
  #-----------------------------------------------------------------------------
  Question    = "Would you like to toggle Full Screen mode?"
  #-----------------------------------------------------------------------------
  # * FullScreen.toggle
  #-----------------------------------------------------------------------------
  def self.toggle
    # If you don't use the Aleworks::API library, then uncomment this line
    # and replace-all "Aleworks::API::Keybd_Event" => "@keybd_event"
    
    #@keybd_event ||= Win32API.new('user32', 'keybd_event', 'LLLL', '')
    
    Aleworks::API::Keybd_Event.call(18,0,0,0)
    Aleworks::API::Keybd_Event.call(13,0,0,0)
    Aleworks::API::Keybd_Event.call(13,0,2,0)
    Aleworks::API::Keybd_Event.call(18,0,2,0)
    return
  end
end

#===============================================================================
# ** Window_FullScreen
#-------------------------------------------------------------------------------
#   This window asks if you want to go FullScreen before your game starts
#===============================================================================

class Window_FullScreen < Window_Base
  #-----------------------------------------------------------------------------
  # * Object Initialization
  #-----------------------------------------------------------------------------
  def initialize
    super(0, 128, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    refresh
  end
  #-----------------------------------------------------------------------------
  # * Refresh Method
  #-----------------------------------------------------------------------------
  def refresh
    self.contents.clear
    cw = contents.text_size(FullScreen::Question).width + 32
    self.width = cw
    self.contents = Bitmap.new(self.width - 32, self.height - 32)
    self.x = (320 - (self.width / 2))
    self.contents.draw_text(0, 0, self.width, 32, FullScreen::Question)
  end
end

#===============================================================================
# ** Scene_FullScreen
#-------------------------------------------------------------------------------
#   This scene asks if you want to go FullScreen before your game starts
#===============================================================================

class Scene_FullScreen < SDK::Scene_Base
  #-----------------------------------------------------------------------------
  # * Included Modules
  #-----------------------------------------------------------------------------
  include FullScreen
  #-----------------------------------------------------------------------------
  # * Main
  #-----------------------------------------------------------------------------
  def main
    if Automatic || skip_to_next_scene?
      unless skip_to_next_scene?
        FullScreen.toggle
      end
      next_scene
      return
    end
    super
  end
  #-----------------------------------------------------------------------------
  # * Main To Next Scene?
  #-----------------------------------------------------------------------------
  def skip_to_next_scene?
    return !($DEBUG ? [0,2].include?(GameMode) : [0,1].include?(GameMode))
  end
  #-----------------------------------------------------------------------------
  # * Main Variable
  #-----------------------------------------------------------------------------
  def main_variable
    (Scene_Title.new).main_database
    super
  end
  #-----------------------------------------------------------------------------
  # * Main Window
  #-----------------------------------------------------------------------------
  def main_window
    @window           = Window_FullScreen.new
    @command          = Window_Command.new(96, ["Yes", "No"])
    @command.x        = @window.width + @window.x - 128
    @command.y        = @window.height + @window.y - 16
    @command.visible  = true
    @command.active   = true
    @command.opacity  = 0
    super
  end
  #-----------------------------------------------------------------------------
  # * Update Method
  #-----------------------------------------------------------------------------
  def update
    if @command.active
      update_command
      return
    end
    super
  end
  #-----------------------------------------------------------------------------
  # * Update Command
  #-----------------------------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
      update_command_cancel
      return
    elsif Input.trigger?(Input::C)
      update_command_decision
      return
    end
  end
  #-----------------------------------------------------------------------------
  # * Update Command : Cancel
  #-----------------------------------------------------------------------------
  def update_command_cancel
    $game_system.se_play($data_system.cancel_se)
    next_scene
  end
  #-----------------------------------------------------------------------------
  # * Update Command : Decision
  #-----------------------------------------------------------------------------
  def update_command_decision
    $game_system.se_play($data_system.decision_se)
    if @command.index == 0
      FullScreen.toggle
    end
    next_scene
  end
  #-----------------------------------------------------------------------------
  # * Next Scene
  #-----------------------------------------------------------------------------
  def next_scene
    begin  ; eval "$scene = #{Next_Scene}.new"
    rescue ; $scene = Scene_Title.new
    end
  end
end

#-------------------------------------------------------------------------------
# * SDK Enabled Test - ELSE
#-------------------------------------------------------------------------------
end
Code:
#===============================================================================
# ** Splash Screen Script
#-------------------------------------------------------------------------------
# Written by  : Kain Nobel
# Version     : 2.5
# Last Update : 11.27.2008
# Created On  : 06.30.2008
#===============================================================================

#-------------------------------------------------------------------------------
# * SDK Log
#-------------------------------------------------------------------------------
SDK.log('System.SplashScreen', 'Kain Nobel', 2.5, '11.27.2008')
SDK.check_requirements(2.0, [1])
#-------------------------------------------------------------------------------
# * SDK Enabled Test - BEGIN
#-------------------------------------------------------------------------------
if SDK.enabled?('System.SplashScreen')

#===============================================================================
# ** SplashSettings
#-------------------------------------------------------------------------------
#   ...
#===============================================================================

module SplashSettings
  #-----------------------------------------------------------------------------
  # * Create Game System and Database (if nil)
  #-----------------------------------------------------------------------------
  $game_system ||= Game_System.new
  $data_system ||= load_data("Data/System.rxdata")
  #-----------------------------------------------------------------------------
  # * GameMode
  #    0.) Enabled in Game.exe & Playtest
  #    1.) Enabled only in Game.exe
  #    2.) Enabled only in Playtest
  #    ?.) Any other setting, its not enabled at all
  #-----------------------------------------------------------------------------
  GameMode     = 0
  #-----------------------------------------------------------------------------
  # * Skip_Enabled = true/false
  #-----------------------------------------------------------------------------
  Skip_Enabled = true
  #-----------------------------------------------------------------------------
  # * Next_Scene = 'Scene_???' (String)
  #-----------------------------------------------------------------------------
  Next_Scene = 'Scene_Title'
  #-----------------------------------------------------------------------------
  # * BGM = RPG::AudioFile.new(*args)
  #-----------------------------------------------------------------------------
  BGM = "Audio/BGM/x001-Battle01"
  #-----------------------------------------------------------------------------
  # * BGS = RPG::AudioFile.new(*args)
  #-----------------------------------------------------------------------------
  BGS = RPG::AudioFile.new("Audio/BGS/001-Wind01")
  #-----------------------------------------------------------------------------
  # * SubDir = "Splash/"
  #-----------------------------------------------------------------------------
  SubDir  = ""
  #-----------------------------------------------------------------------------
  # * Bitmaps = [filename (String), ...]
  #-----------------------------------------------------------------------------
  Bitmaps = ["Splash01", "Splash02","Splash01", "Splash02","Splash01", "Splash02"]
  #-----------------------------------------------------------------------------
  # * FadeTime = {order (Numeric) => duration (Numeric), ...}
  #-----------------------------------------------------------------------------
  SpeedFadeIn = {}
  SpeedFadeIn.default = 5
  #-----------------------------------------------------------------------------
  # * SpeedFadeOut = {order (Numeric) => duration (Numeric), ...}
  #-----------------------------------------------------------------------------
  SpeedFadeOut = {}
  SpeedFadeOut.default = 5
  #-----------------------------------------------------------------------------
  # * Stretch_BLT  = {order (Numeric) => true/false, ...}
  #-----------------------------------------------------------------------------
  Stretch_BLT = {}
  Stretch_BLT.default = false
end

#===============================================================================
# ** Scene_Splash
#-------------------------------------------------------------------------------
#   This scene deals with splash screen processing.
#===============================================================================

class Scene_Splash < SDK::Scene_Base
  #-----------------------------------------------------------------------------
  # * Included Modules
  #-----------------------------------------------------------------------------
  include SplashSettings
  #-----------------------------------------------------------------------------
  # * Main
  #-----------------------------------------------------------------------------
  def main
    if skip_to_next_scene?
      next_scene
      return
    end
    super
  end
  #-----------------------------------------------------------------------------
  # * Main To Next Scene?
  #-----------------------------------------------------------------------------
  def skip_to_next_scene?
    return !($DEBUG ? [0,2].include?(GameMode) : [0,1].include?(GameMode))
  end
  #-----------------------------------------------------------------------------
  # * Main Variable
  #-----------------------------------------------------------------------------
  def main_variable
    super
    @index = 0
    @delay = 0
    @reverse = false
  end
  #-----------------------------------------------------------------------------
  # * Main Sprite
  #-----------------------------------------------------------------------------
  def main_sprite
    super
    @screens = Array.new
    for i in 0...Bitmaps.size
      vp = Viewport.new(0, 0, 640, 480)
      @screens << Sprite.new(vp)
      @screens[i].bitmap = Bitmap.new(vp.rect.width, vp.rect.height)
      subdir = ((SubDir.include?("/") && !SubDir == "") ? SubDir : "#{SubDir}/")
      begin   ; b = RPG::Cache.title("#{subdir}#{Bitmaps[i]}")
      rescue  ; b = RPG::Cache.title($data_system.title_name)
      end
      cx = (Stretch_BLT[i] ?   0 : (320 - b.width  / 2))
      cy = (Stretch_BLT[i] ?   0 : (240 - b.height / 2))
      cw = (Stretch_BLT[i] ? 640 : b.width)
      ch = (Stretch_BLT[i] ? 480 : b.height)
      src_rect = Rect.new(0, 0, b.width, b.height)
      dest_rect = Rect.new(cx, cy, cw, ch)
      @screens[i].bitmap.stretch_blt(dest_rect, b, src_rect)
      @screens[i].visible = true
      @screens[i].opacity = 0
    end
  end
  #-----------------------------------------------------------------------------
  # * Main Audio
  #-----------------------------------------------------------------------------
  def main_audio
    super
    case BGM.class.to_s
    when "RPG::AudioFile"
      Audio.bgm_play(BGM.name, BGM.volume, BGM.pitch)
    when "String"
      bgm = (BGM.include?("Audio/BGM/") ? BGM : "Audio/BGM/#{BGM}")
      Audio.bgm_play(bgm, 100, 100)
    when "Array"
      n = (BGM.size > 0 ? BGM[0] : "")
      v = (BGM.size > 1 ? BGM[1] : 100)
      p = (BGM.size > 2 ? BGM[2] : 100)
      n = (n.include?("Audio/BGM/") ? n : "Audio/BGM/#{n}")
      Audio.bgm_play(n, v, p)
    when "NilClass"
      $game_system.bgm_play($data_system.title_bgm)
    end
    case BGS.class.to_s
    when "RPG::AudioFile"
      Audio.bgs_play(BGS.name, BGS.volume, BGS.pitch)
    when "String"
      bgs = (BGS.include?("Audio/BGS/") ? BGS : "Audio/BGS/#{BGS}")
      Audio.bgs_play(bgs, 100, 100)
    when "Array"
      n = (BGS.size > 0 ? BGS[0] : "")
      v = (BGS.size > 1 ? BGS[1] : 100)
      p = (BGS.size > 2 ? BGS[2] : 100)
      n = (n.include?("Audio/BGS/") ? n : "Audio/BGS/#{n}")
      Audio.bgs_play(n, v, p)
    end
  end
  #-----------------------------------------------------------------------------
  # * Update
  #-----------------------------------------------------------------------------
  def update
    super
    if Input.trigger?(Input::B) && Skip_Enabled
      next_scene
      return
    elsif Input.trigger?(Input::C) && Skip_Enabled
      @reverse = true
      return
    end
    @delay += (@reverse ? -SpeedFadeOut[@index] : SpeedFadeIn[@index])
    begin  ; @screens[@index].opacity = @delay
    rescue ; next_scene
    end
    if @delay >= 255
      @reverse = true
      @delay = 255
    elsif @delay <= 0
      @reverse = false
      @delay = 0
      @index += 1
    end
  end
  #-----------------------------------------------------------------------------
  # * Next Scene
  #-----------------------------------------------------------------------------
  def next_scene
    begin  ; eval "$scene = #{Next_Scene}.new"
    rescue ; $scene = Scene_Title.new
    end
  end
end

#-------------------------------------------------------------------------------
# * SDK Enabled Test - END
#-------------------------------------------------------------------------------
end


FullScreen System FAQ

These FAQs aren't intended to scare you off, these systems are as extremely dynamic as they are easy to use! Out of all my scripts, I get the most PM questions about these silly ass scripts, so I figured I'd compile them all here for everybody's convenience.

A.) Well, its quite simple, theres a few out just like this one which they all do the same shit. Quite simply, you can have it promt at game start "Do you want to go FullScreen?" or you can automatically full screen the game. You can also disable/enable this script and skip it during playtest.
A.) Game Mode specifies if it is played 0.) In Game.exe and Playtest, 1.) Only in Game.exe, 2.) Only in Playtest
A.) Yes, of course you can skip the prompt. Just set FullScreen::Automatic = true
A.) Read "What does Game Mode do?"
A.) Yup, just use FullScreen.toggle
A.) ...You don't. I asked in RGSS Support, I'm sure its something simple with API.
A.) Hm... not yet, I'm looking into it, I know some people want/need this.

Splash System FAQ

A.) It is a scene that plays a series of splash screens (and optional audio), which fade in and out then take you to the next scene.
A.) You simply go into the last script, 'main' and change...

$scene = Scene_Title.new

to...

$scene = Scene_Splash.new
A.) Well, if you're playing in PlayTest mode, it is possible that you only have the script setup for Game.exe or it is disabled. Go into the settings module, and make sure that GameMode is either 0 (for Game and Playtest), or 1 (For Game only) or 2 (for Playtest only). Any other setting, the scene will be skipped entirely reguardless.
A.) Elementary my dear Watson! ($scene = Scene_Splash.new)
A.) Sure, why not! If you're wanting to make a brand new splash sequence, or change its playback set it up in a call script box...

Code:
SplashSystem::Skip_Enabled = true
a = ["Image01", "Image02", "Image03", "Image04"]
SplashSystem::Bitmaps = a
a = {0 => 5, 2 => 5}
a.default = 2
SplashSystem::SpeedFadeIn = a
a = {0 => 6, 2 => 6}
a.default = 3
SplashSystem::SpeedFadeOut = a
$scene = Scene_Splash.new
A.) You shouldn't have any problems modifying the constants through call scripts, except for the fact of the limited size of the box. Perhaps if you tried to modify them in another script you'd have trouble, but nah a call script should work just fine for modifying constants. Just check the spoiler above this one and see how you could shorten the call script.
A.) Nope, you can have an array of however many images you want to play, its up to you... the only limit is how many your computer can handle loading... If you have 100 different 640 x 480 images you want to play with it you're fucking crazy, but I'd assume so long as you don't kill your computer in the process, GO FOR IT :thumb:
A.) Yes, by default I specified it'd be in "Graphics\Titles\Splash\". It reads from RPG::Cache.title() around line 123 or so, change that to RPG::Cache.??? whatever, and change SubDir to "" or whatever folder you want from within that cache.
A.) Well... did you make sure SplashSystem::Next_Scene == 'Scene_Map' ? Or, better yet, is your Next_Scene a string? And also, is it a valid scene that exists in your scripts? So long as those conditions are met, it should send you to whatever scene you want, but if anything goes wrong in trying to process that scene then yes its supposed to send you to Scene_Title, by default.
A.) Again, be sure to check your GameMode setting... if it is anything besides 0, 2 it won't play in Testplay... anything besides 0, 1 won't play in Game. Either change the setting directly in the module, or change it from the call script, it works. Also, don't forget to change SplashSystem::Next_Scene to "Scene_Map" if thats where you're calling the scene from.
A.) Hah, thats simple! Its set up like...

Stretch_BLT = {0 => true, 2 => true}
Stretch_BLT.default = false

The hash's key numbers represent each image's index within the Bitmaps array, its up to you to track index. Remember, the first image would be at index 0.
A.) That means if YOU misnamed YOUR files in the setup, it'd rescue with the Title background instead. We wouldn't want families releasing their games and misnaming ONE splash screen before compressing and uploading projects, now would we?
A.) Simple, it should be right around line 124...

rescue  ; b = RPG::Cache.title($data_system.title_name)

Change it to...

rescue ; b = Bitmap.new(32, 32)

FullScreen + SplashScreen System FAQ

Its pretty simple, I'll show you an example setup...

Step 1 : The Basics

[#] Go into 'main' in the bottom of your script editor
[#] Find the line "$scene = Scene_???.new" (most likely, Scene_Title.new)
[#] If you want FullScreen to play first, do ($scene = Scene_FullScreen.new)
[#] If you want Splash to play first, do ($scene = Scene_Splash.new)

Step 2 : $scene = Next_Scene

[#] Read Step 1 : The Basics
[#] In the FullScreen/SplashSystem modules, find "Next_Scene ="
[#] If going to FullScreen, do (Next_Scene = "Scene_FullScreen")
[#] If going to Splash, do (Next_Scene = "Scene_Splash")
[#] If Skipping Straight to Title, do (Next_Scene = nil) or (Next_Scene = "Scene_Title")
[#] These systems were made around the same time, general setup is the same

Step 3 : Done

[#] Yup, you should be finished, have fun :thumb:
A.) Yes, I'll make a VX version for you don't worry!
 

Nachos

Sponsor

That black thing that appears a the begging of game which says "EA games" "Square enix" "wankstain (squirt)  games"
 
Can't you just make a picture function in VX that when the title scene dose the main function it calls it up? Just ask in. Might look in to this myself but seems like you got it covered. Nice job man can't wait for the VX version! :smoke:
 

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