Advertisement
nio_kasgami

animated title screen wip

Dec 16th, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.21 KB | None | 0 0
  1. #===============================================================================
  2. # The Last Oni Title Screen
  3. #===============================================================================
  4.  
  5. module Title_screen
  6.  
  7. #===============================================================================
  8.  # Logo customization
  9. #===============================================================================
  10.   Logo_Enable = false
  11.  
  12.  
  13. #==============================================================================
  14.   Filename = [
  15.  
  16.   Logo_Background = "",
  17.  
  18.   Main_Background = ""
  19.  
  20.   ]
  21. end
  22.  
  23.  
  24. class Scene_Title
  25.   include Title_screen
  26.  
  27.   #--------------------------------------------------------------------------
  28.   # * Overwrite start
  29.   #--------------------------------------------------------------------------
  30.   def start
  31.     super
  32.     execute_logo if Logo_Enable
  33.     create_sprites
  34.     create_command_window
  35.     play_title_music
  36.   end
  37.  
  38.  
  39.   def execute_logo
  40.     create_back
  41.     create_logo rescue nil
  42.     play_Me rescue nil
  43.     create_character rescue nil
  44.     execute_voice rescue nil
  45.   end
  46.  
  47.   def create_back
  48.     @logo_background = Plane.new
  49.     @logo_background.bitmap = Cache.title1(Filename[0].to_s)
  50.   end
  51.  
  52.  
  53.  
  54.   def create_sprites
  55.     create_main_background
  56.     create_title rescue nil
  57.     create_particles rescue nil
  58.   end
  59.  
  60.  
  61.   def create_main_background
  62.     @logo_background = Plane.new
  63.     @logo_background.bitmap = Cache.title1(Filename[1].to_s)
  64.   end
  65.  
  66.  
  67.  
  68.  ##############################################################################
  69.  def transition_speed
  70.     return 20
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # * Termination Processing
  74.   #--------------------------------------------------------------------------
  75.   def terminate
  76.     super
  77.     SceneManager.snapshot_for_background
  78.  
  79.   end
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.   #--------------------------------------------------------------------------
  87.   # * Move Sprite to Screen Center
  88.   #--------------------------------------------------------------------------
  89.   def center_sprite(sprite)
  90.     sprite.ox = sprite.bitmap.width / 2
  91.     sprite.oy = sprite.bitmap.height / 2
  92.     sprite.x = Graphics.width / 2
  93.     sprite.y = Graphics.height / 2
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # * Create Command Window
  97.   #--------------------------------------------------------------------------
  98.   def create_command_window
  99.     @command_window = Window_TitleCommand.new
  100.     @command_window.set_handler(:new_game, method(:command_new_game))
  101.     @command_window.set_handler(:continue, method(:command_continue))
  102.     @command_window.set_handler(:shutdown, method(:command_shutdown))
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # * Close Command Window
  106.   #--------------------------------------------------------------------------
  107.   def close_command_window
  108.     @command_window.close
  109.     update until @command_window.close?
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   # * [New Game] Command
  113.   #--------------------------------------------------------------------------
  114.   def command_new_game
  115.     DataManager.setup_new_game
  116.     close_command_window
  117.     fadeout_all
  118.     $game_map.autoplay
  119.     SceneManager.goto(Scene_Map)
  120.   end
  121.   #--------------------------------------------------------------------------
  122.   # * [Continue] Command
  123.   #--------------------------------------------------------------------------
  124.   def command_continue
  125.     close_command_window
  126.     SceneManager.call(Scene_Load)
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # * [Shut Down] Command
  130.   #--------------------------------------------------------------------------
  131.   def command_shutdown
  132.     close_command_window
  133.     fadeout_all
  134.     SceneManager.exit
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # * Play Title Screen Music
  138.   #--------------------------------------------------------------------------
  139.   def play_title_music
  140.     $data_system.title_bgm.play
  141.     RPG::BGS.stop
  142.     RPG::ME.stop
  143.   end
  144. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement