Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ==============================================================================
- # ▼▼▼▼▼▼ TroyZ - Press Start Button ▼▼▼▼▼▼
- # ==============================================================================
- # Script by : Agung Prasetyo(TroyZ)
- # Contact me by : - Email agung.endisnear.xyz@gmail.com
- # - Forum RPGMakerID, username TroyZ
- # - Handphone 085756289121
- # Engine : VXAce
- # Level : Normal
- # Version : 1.1
- # ------------------------------------------------------------------------------
- # Change Logs :
- # 27 Mei 2013 : Version 1.0 released
- # 3 December 2013 : Version 1.1 released
- # ------------------------------------------------------------------------------
- # How this work :
- # This script allows you to create a window confirmation on the title screen
- # which allows the player to press start to activate the title command.
- # ------------------------------------------------------------------------------
- # How to use :
- # Place it between material and main. Just config the script module and you're
- # done.
- # ------------------------------------------------------------------------------
- # Compatibility issues :
- # - TroyZ - Random Title Transition : Put this script above that script.
- # If you found some, let me know, and bug fixes will come out soon.
- # ------------------------------------------------------------------------------
- # Who to credit :
- # - Allah swt. : For the chance of living that he has given to me.
- # - Nabi Muhammad saw. : As a leader and messenger and prophet of Muslim.
- # I'm proud to be your follower. :)
- # - Agung Prasetyo(TroyZ) : Thats me, of course, the ones that made this script. :P
- # - Theo Allen : the ones that helped me create this script.
- # ------------------------------------------------------------------------------
- # License :
- # - Free Game : Just credit those names above.
- # - Commercial Game : Same as free game's license.
- # ------------------------------------------------------------------------------
- $imported = {} if $imported.nil?
- $imported[:TroyZ_PressStartButton] = true
- # ------------------------------------------------------------------------------
- # Configuration of script start here
- # ------------------------------------------------------------------------------
- module AGUNG
- module PRESS_START_BUTTON
- X_POS_TEXT = 0 # X position of text
- Y_POS_TEXT = 0 # Y position of text
- TEXT_WIDTH = 544 # Width of text
- TEXT_HEIGHT = 40 # Height of text
- TEXT = "Press Start Button" # The press start button text
- TEXT_ALIGNMENT = 1 # Text Alignment. 0 = Left, 1 = Center, 2 = Right
- #-------------------------------------------------------------------------------
- X_POS_WINDOW = 0 # X position of window press start
- Y_POS_WINDOW = 0 # Y position of window press start
- WINDOW_OPACITY = 255 # Opacity of window press start
- WINDOW_WIDTH = 544 # Width of window press start
- WINDOW_HEIGHT = 60 # Height of window press start
- #-------------------------------------------------------------------------------
- SE_OPENING = "Audio/SE/Resident Evil Start Sound Effect.mp3" # The SE to be
- # played. Set it to nil if you don't want to use it
- SE_VOLUME = 100 # The SE Volume
- SE_PITCH = 100 # The SE Pitch
- end
- end
- # ------------------------------------------------------------------------------
- # End of configuration
- # ------------------------------------------------------------------------------
- # ------------------------------------------------------------------------------
- # You shall not pass
- # ------------------------------------------------------------------------------
- class Window_PressStartButton < Window_Base
- include AGUNG::PRESS_START_BUTTON
- def initialize(x,y,width,height)
- super
- draw_text(X_POS_TEXT, Y_POS_TEXT, TEXT_WIDTH, TEXT_HEIGHT, TEXT, TEXT_ALIGNMENT)
- self.opacity = WINDOW_OPACITY
- end
- def close_window
- self.close
- end
- end
- class Window_TitleCommand < Window_Command
- def close_window
- self.close
- end
- def open_window
- self.open
- end
- end
- class Scene_Title < Scene_Base
- include AGUNG::PRESS_START_BUTTON
- def create_command_window
- Audio.se_play(SE_OPENING, SE_VOLUME, SE_PITCH) if SE_OPENING != nil
- @press_start = Window_PressStartButton.new(X_POS_WINDOW, Y_POS_WINDOW, WINDOW_WIDTH, WINDOW_HEIGHT)
- @title_command = Window_TitleCommand.new
- @title_command.close_window
- end
- def show_title_command_x
- Sound.play_ok
- @press_start.close_window
- @title_command.open_window
- @title_command.set_handler(:new_game, method(:command_new_game))
- @title_command.set_handler(:continue, method(:command_continue))
- @title_command.set_handler(:shutdown, method(:command_shutdown))
- end
- def close_command_window
- @title_command.close
- update until @title_command.close?
- end
- alias x_update_x update
- def update
- show_title_command_x if Input.trigger?(:C) && @title_command.open? == false
- x_update_x
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement