Advertisement
FlipelyFlip

Delayed Title Screen Window

Jun 27th, 2025
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.57 KB | None | 0 0
  1. #==============================================================================
  2. # ** Scene_Title
  3. #------------------------------------------------------------------------------
  4. #  This class performs the title screen processing.
  5. #==============================================================================
  6.  
  7. class Scene_Title < Scene_Base
  8.   #--------------------------------------------------------------------------
  9.   # * Create Command Window
  10.   #--------------------------------------------------------------------------
  11.   alias :delayed_command create_command_window
  12.   def create_command_window
  13.     delayed_command
  14.     @command_window.active = false
  15.     @command_window.opacity = 0
  16.     @command_window.back_opacity = 0
  17.     @command_window.contents_opacity = 0
  18.   end
  19.  
  20.   #--------------------------------------------------------------------------
  21.   # * Frame Update
  22.   #--------------------------------------------------------------------------
  23.   alias :delayed_title :update
  24.   def update
  25.     delayed_title
  26.     wait(10) if @command_window.opacity == 0
  27.     while @command_window.opacity < 255
  28.       @command_window.back_opacity = @command_window.contents_opacity = @command_window.opacity += 5
  29.       wait(1)
  30.     end
  31.     @command_window.active = true if @command_window.opacity == 255 && !@command_window.active
  32.   end
  33.  
  34.   #--------------------------------------------------------------------------
  35.   # * Waits x frames
  36.   #--------------------------------------------------------------------------
  37.   def wait(duration)
  38.     duration.times { update_basic }
  39.   end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement