Guest User

Pixelbyte Engine - Simple Splash Screen

a guest
Jan 31st, 2015
268
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     #===============================================================================
  2.     # Pixelbyte Engine : Simple Splash Screen
  3.     #===============================================================================
  4.     # Coded by : Ultim
  5.     #===============================================================================
  6.     #========================DESCRIPTION & TERMS OF USE============================#
  7.     # This script adds a simple splash image before the title screen
  8.     #===============================================================================
  9.     # Free for Commercial & Non-Commercial use.As long as I'm credited.
  10.     #===============================================================================
  11.      
  12.     #===============================================================================
  13.     # Good ol' SceneManager
  14.     #===============================================================================
  15.     module SceneManager
  16.     #===============================================================================
  17.     # Get First Scene Class
  18.     #===============================================================================
  19.     def self.first_scene_class
  20.       $BTEST ? Scene_Battle : U1GSplash
  21.     end
  22.     end
  23.      
  24.      
  25.     module U1GSS
  26.     #===============================================================================
  27.     # Errrr...."Customizable" Section
  28.     #===============================================================================
  29.     SplashImage = "" # The Image that'll serve as a splash image
  30.     SoundEffect = "" # The SE when displaying the splash screen
  31.      
  32.     end
  33.     #===============================================================================
  34.     # End "Customizable" Section
  35.     #===============================================================================
  36.     class U1GSplash < Scene_Base
  37.     #--------------------------------------------------------------------------
  38.     # Start Processing
  39.     #--------------------------------------------------------------------------
  40.     def start
  41.       super
  42.       SceneManager.clear
  43.       Graphics.freeze
  44.       RPG::BGS.stop
  45.       RPG::BGM.stop
  46.       RPG::SE.new(U1GSS::SoundEffect, 100, 100).play
  47.       create_splash
  48.     end
  49.     #--------------------------------------------------------------------------
  50.     # Termination !
  51.     #--------------------------------------------------------------------------
  52.       def terminate
  53.         super
  54.         dispose_splash
  55.       end
  56.     #--------------------------------------------------------------------------
  57.     # Create Splash Image
  58.     #--------------------------------------------------------------------------
  59.     def create_splash
  60.       @splash = Sprite.new
  61.       @splash.bitmap = Cache.system(U1GSS::SplashImage)
  62.     end
  63.     #--------------------------------------------------------------------------
  64.     # Dispose of Splash Image
  65.     #--------------------------------------------------------------------------
  66.     def dispose_splash
  67.       @splash.bitmap.dispose
  68.       @splash.dispose
  69.     end
  70.     #--------------------------------------------------------------------------
  71.     # Frame Update
  72.     #--------------------------------------------------------------------------
  73.     def update
  74.       super
  75.       SceneManager.goto(Scene_Title)
  76.       Graphics.wait(120)
  77.       Graphics.fadeout(60)
  78.     end
  79.     end
RAW Paste Data