Advertisement
TroyZ

TroyZ - Press Start Button 1.1

Dec 3rd, 2013
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.08 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.1
  11. # ------------------------------------------------------------------------------
  12. # Change Logs :
  13. # 27 Mei 2013 : Version 1.0 released
  14. # 3 December 2013 : Version 1.1 released
  15. # ------------------------------------------------------------------------------
  16. # How this work :
  17. # This script allows you to create a window confirmation on the title screen
  18. # which allows the player to press start to activate the title command.
  19. # ------------------------------------------------------------------------------
  20. # How to use :
  21. # Place it between material and main. Just config the script module and you're
  22. # done.
  23. # ------------------------------------------------------------------------------
  24. # Compatibility issues :
  25. # - TroyZ - Random Title Transition : Put this script above that script.
  26. # If you found some, let me know, and bug fixes will come out soon.
  27. # ------------------------------------------------------------------------------
  28. # Who to credit :
  29. # - Allah swt. : For the chance of living that he has given to me.
  30. # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
  31. #                        I'm proud to be your follower. :)
  32. # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
  33. # - Theo Allen : the ones that helped me create this script.
  34. # ------------------------------------------------------------------------------
  35. # License :
  36. # - Free Game : Just credit those names above.
  37. # - Commercial Game : Same as free game's license.
  38. # ------------------------------------------------------------------------------
  39. $imported = {} if $imported.nil?
  40. $imported[:TroyZ_PressStartButton] = true
  41. # ------------------------------------------------------------------------------
  42. # Configuration of script start here
  43. # ------------------------------------------------------------------------------
  44. module AGUNG
  45.   module PRESS_START_BUTTON
  46.     X_POS_TEXT = 0 # X position of text
  47.     Y_POS_TEXT = 0 # Y position of text
  48.     TEXT_WIDTH = 544 # Width of text
  49.     TEXT_HEIGHT = 40 # Height of text
  50.     TEXT = "Press Start Button" # The press start button text
  51.     TEXT_ALIGNMENT = 1 # Text Alignment. 0 = Left, 1 = Center, 2 = Right
  52. #-------------------------------------------------------------------------------
  53.     X_POS_WINDOW = 0 # X position of window press start
  54.     Y_POS_WINDOW = 0 # Y position of window press start
  55.     WINDOW_OPACITY = 255 # Opacity of window press start
  56.     WINDOW_WIDTH = 544 # Width of window press start
  57.     WINDOW_HEIGHT = 60 # Height of window press start
  58. #-------------------------------------------------------------------------------
  59.     SE_OPENING = "Audio/SE/Resident Evil Start Sound Effect.mp3" # The SE to be
  60.     # played. Set it to nil if you don't want to use it
  61.     SE_VOLUME = 100 # The SE Volume
  62.     SE_PITCH = 100 # The SE Pitch
  63.   end
  64. end
  65. # ------------------------------------------------------------------------------
  66. # End of configuration
  67. # ------------------------------------------------------------------------------
  68.  
  69. # ------------------------------------------------------------------------------
  70. # You shall not pass
  71. # ------------------------------------------------------------------------------
  72. class Window_PressStartButton < Window_Base
  73.   include AGUNG::PRESS_START_BUTTON
  74.  
  75.   def initialize(x,y,width,height)
  76.     super
  77.     draw_text(X_POS_TEXT, Y_POS_TEXT, TEXT_WIDTH, TEXT_HEIGHT, TEXT, TEXT_ALIGNMENT)
  78.     self.opacity = WINDOW_OPACITY
  79.   end  
  80.  
  81.   def close_window    
  82.     self.close
  83.   end
  84. end
  85.  
  86. class Window_TitleCommand < Window_Command  
  87.   def close_window
  88.     self.close
  89.   end  
  90.   def open_window
  91.     self.open
  92.   end
  93. end
  94.  
  95. class Scene_Title < Scene_Base
  96.   include AGUNG::PRESS_START_BUTTON
  97.  
  98.   def create_command_window
  99.     Audio.se_play(SE_OPENING, SE_VOLUME, SE_PITCH) if SE_OPENING != nil
  100.     @press_start = Window_PressStartButton.new(X_POS_WINDOW, Y_POS_WINDOW, WINDOW_WIDTH, WINDOW_HEIGHT)
  101.     @title_command = Window_TitleCommand.new
  102.     @title_command.close_window    
  103.   end
  104.  
  105.   def show_title_command_x
  106.     Sound.play_ok
  107.     @press_start.close_window
  108.     @title_command.open_window
  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.  
  114.   def close_command_window
  115.     @title_command.close
  116.     update until @title_command.close?
  117.   end
  118.  
  119.   alias x_update_x    update
  120.   def update    
  121.     show_title_command_x if Input.trigger?(:C) && @title_command.open? == false    
  122.     x_update_x
  123.   end
  124. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement