Advertisement
TroyZ

TroyZ - Press Start Button

May 27th, 2013
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.73 KB | None | 0 0
  1. # ==============================================================================
  2. # ▼▼▼▼▼▼                    TroyZ - Press Start Button                    ▼▼▼▼▼▼
  3. # ==============================================================================
  4. # Script by : Agung Prasetyo(TroyZ)
  5. # Contact me by : - Email agung.endisnear.xyz@gmail.com
  6. #                 - Forum RPGMakerID, username TroyZ
  7. #                 - Handphone 085756289121
  8. # Engine : VXAce
  9. # Level : Normal
  10. # Version : 1.0
  11. # ------------------------------------------------------------------------------
  12. # Change Logs :
  13. # 27 Mei 2013 - Rilis script versi 1.0
  14. # ------------------------------------------------------------------------------
  15. # License : Silahkan digunakan untuk game free ataupun yang komersil. Game
  16. # free ataupun komersil, saya hanya minta nama saya ada di credit. Credit atas
  17. # nama Agung Prasetyo(TroyZ). Dan juga credit atas nama Tio Allin Subiantoro
  18. # (Theo Allen) yang sudah banyak membantu saya dalam memahami dasar pembuatan
  19. # dari script ini. Kalo mau ngedit-ngedit script ini terserah kamu, tapi jangan
  20. # sampe kamu klaim ini punya kamu ya. Kalo kamu udah ngedit script ini terus
  21. # pengen nge-publish script editan kamu, tulis seperti ini :
  22. # TroyZ - Press Start Button : Edited By Namanya Ente
  23. # ------------------------------------------------------------------------------
  24. # How to Use : Pasang saja dibawah material tapi diatas main. Kalo pake script
  25. # TroyZ - Random Title Transition, letakkan script ini diatasnya.
  26. # ------------------------------------------------------------------------------
  27. # WARNING : Sepertinya script ini akan ada masalah kompatibilitas dengan script
  28. # title screen yang lain, soalnya disini method start dan close_command_window saya
  29. # overwrite. Tapi, untuk meminimalkan masalah kompatibilitas, cobalah untuk
  30. # meletakkan script ini diatas dari script-script lain yang berhubungan
  31. # dengan title screen. Kalau ada masalah kompatibilitas dengan script ini
  32. # segera hubungi saya.
  33. # ------------------------------------------------------------------------------
  34. # Dengan script ini, kamu bisa memasang sebuah jendela konfirmasi pada title
  35. # screen yang mengharuskan pemain menekan tombol Start untuk masuk ke menu title.
  36. # Biasanya Press Start Button kayak gini banyak di game-game konsol, dan sekarang
  37. # kamu bisa menghadirkannya di RPG Maker VX Ace.
  38. $imported = {} if $imported.nil?
  39. $imported[:TroyZ_PressStartButton] = true
  40.  
  41. module X_Press_Start_Button_X
  42.   X_POS_TULISAN_PRESS_START = 0 # Posisi X dari tulisan press start button
  43.   Y_POS_TULISAN_PRESS_START = 0 # Posisi Y dari tulisan press start button
  44.   LEBAR_TULISAN_PRESS_START = 544 # Lebar tulisan press start button
  45.   TINGGI_TULISAN_PRESS_START = 40 # Tinggi tulisan press start button
  46.   TULISAN_PRESS_START = "Press Start Button" # Tulisan press start button yang
  47.                                              # akan muncul dilayar
  48.   ALIGNMENT_TULISAN_PRESS_START = 1 # Alignment tulisan press start button
  49.                                     # 0 = Kiri
  50.                                     # 1 = Tengah
  51.                                     # 2 = Kanan
  52.   X_WINDOW_PRESS_START = 0 # Posisi X jendela press start button
  53.   Y_WINDOW_PRESS_START = 0 # Posisi Y jendela press start button
  54.   LEBAR_WINDOW_PRESS_START = 544 # Lebar jendela press start button
  55.   TINGGI_WINDOW_PRESS_START = 60 # Tinggi jendela press start button
  56. end
  57. # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  58. # BATAS KONFIGURASI. DILARANG MELEWATI GARIS INI
  59. # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  60. class Window_PressStartButton < Window_Base
  61.   def initialize(x,y,width,height)
  62.     super
  63.   end  
  64.   def x_nulis_press_start_button_x
  65.     draw_text(X_Press_Start_Button_X::X_POS_TULISAN_PRESS_START,
  66.               X_Press_Start_Button_X::Y_POS_TULISAN_PRESS_START,
  67.               X_Press_Start_Button_X::LEBAR_TULISAN_PRESS_START,
  68.               X_Press_Start_Button_X::TINGGI_TULISAN_PRESS_START,
  69.               X_Press_Start_Button_X::TULISAN_PRESS_START,
  70.               X_Press_Start_Button_X::ALIGNMENT_TULISAN_PRESS_START)
  71.   end  
  72.   def x_ilangin_press_start_button_x    
  73.     self.close
  74.   end
  75. end
  76.  
  77. class Window_TitleCommand < Window_Command  
  78.   def x_ilangin_title_command_x
  79.     self.close
  80.   end  
  81.   def x_muncul_title_command_x
  82.     self.open
  83.   end
  84. end
  85.  
  86. class Scene_Title < Scene_Base
  87.   def start
  88.     super
  89.     SceneManager.clear
  90.     Graphics.freeze
  91.     create_background
  92.     create_foreground
  93.     x_bikin_semua_window_x
  94.     play_title_music
  95.   end  
  96.   def x_bikin_semua_window_x
  97.     @press_start = Window_PressStartButton.new(X_Press_Start_Button_X::X_WINDOW_PRESS_START,
  98.                                                X_Press_Start_Button_X::Y_WINDOW_PRESS_START,
  99.                                                X_Press_Start_Button_X::LEBAR_WINDOW_PRESS_START,
  100.                                                X_Press_Start_Button_X::TINGGI_WINDOW_PRESS_START)
  101.     @press_start.x_nulis_press_start_button_x
  102.     @title_command = Window_TitleCommand.new
  103.     @title_command.x_ilangin_title_command_x    
  104.   end  
  105.   def x_munculin_title_command_x
  106.     Sound.play_ok
  107.     @press_start.x_ilangin_press_start_button_x
  108.     @title_command.x_muncul_title_command_x
  109.     @title_command.set_handler(:new_game, method(:command_new_game))
  110.     @title_command.set_handler(:continue, method(:command_continue))
  111.     @title_command.set_handler(:shutdown, method(:command_shutdown))
  112.   end
  113.   def close_command_window
  114.     @title_command.close
  115.     update until @title_command.close?
  116.   end  
  117.   alias x_update_x    update
  118.   def update    
  119.     x_munculin_title_command_x if Input.trigger?(:C) && @title_command.open? == false
  120.     x_update_x
  121.   end
  122. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement