Advertisement
DaxSoft

dsi title

Oct 26th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.32 KB | None | 0 0
  1. =begin
  2.     Default title screen to DSi System
  3.     &beta
  4. =end
  5. Ligni.register(:dsi_title, "dax", 0.1, [[:dsi, "dax"]]) {
  6.     # [Scene_Title]
  7.     class Scene_Title < Scene_Base
  8.         # [main]
  9.         def start
  10.             $game_system.default_background = DS::SETUP[:TITLE][:BACKGROUND_DOWN]
  11.             super
  12.             SceneManager.clear
  13.             Graphics.freeze
  14.             create_background
  15.             create_logo
  16.             create_option
  17.             play_title_music
  18.             @phrase = Sprite.new([DS.screen.width, 18])
  19.             Ligni::Position[@phrase, :center]
  20.             @phrase.z = DS.screen.z + 10
  21.             @phrase.y += 4
  22.             @phrase.bitmap.font.size = 14
  23.             @phrase.bitmap.draw_text_rect(DS::VERSION, 1)
  24.         end
  25.  
  26.         # [background]
  27.         def create_background
  28.             @background_up = Sprite.new("S: #{DS::SETUP[:TITLE][:BACKGROUND_UP]}")
  29.         end
  30.  
  31.         # [logo]
  32.         def create_logo
  33.             @logo = Sprite.new("S: #{DS::SETUP[:TITLE][:LOGO]}")
  34.             @logo.z = DS.screen.z + 1
  35.         end
  36.  
  37.         # [option]
  38.         def create_option
  39.             @command_window = Window_TitleCommand.new
  40.             @command_window.set_handler(:new_game, method(:command_new_game))
  41.             @command_window.set_handler(:continue, method(:command_continue))
  42.             @command_window.set_handler(:shutdown, method(:command_shutdown))
  43.             @command_window.y = DS.screen.height + ( (DS.screen.height - @command_window.height) / 2 )
  44.             @command_window.z = DS.screen.z + 1
  45.         end
  46.  
  47.         # [terminate]s
  48.         def terminate
  49.             super
  50.             SceneManager.snapshot_for_background
  51.             [@background_up, @logo, @phrase].each(&:dispose)
  52.         end
  53.  
  54.         #--------------------------------------------------------------------------
  55.         # * Fechamento da janela de comando
  56.         #--------------------------------------------------------------------------
  57.         def close_command_window
  58.             @command_window.close
  59.             update until @command_window.close?
  60.         end
  61.         #--------------------------------------------------------------------------
  62.         # * Comando [Novo Jogo]
  63.         #--------------------------------------------------------------------------
  64.         def command_new_game
  65.             DataManager.setup_new_game
  66.             close_command_window
  67.             fadeout_all
  68.             $game_map.autoplay
  69.             SceneManager.goto(Scene_Map)
  70.         end
  71.         #--------------------------------------------------------------------------
  72.         # * Comando [Continuar]
  73.         #--------------------------------------------------------------------------
  74.         def command_continue
  75.             close_command_window
  76.             SceneManager.call(Scene_DSLoad)
  77.         end
  78.         #--------------------------------------------------------------------------
  79.         # * Comando [Sair]
  80.         #--------------------------------------------------------------------------
  81.         def command_shutdown
  82.             close_command_window
  83.             fadeout_all
  84.             SceneManager.exit
  85.         end
  86.  
  87.         # [music]
  88.         def play_title_music
  89.             $data_system.title_bgm.play
  90.             RPG::BGS.stop
  91.             RPG::ME.stop
  92.         end
  93.     end
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement