Black_Mage

Center Aligned Title Screen's Option Text Script

Jul 5th, 2022 (edited)
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.22 KB | None | 0 0
  1. #==============================================================================
  2. # Center Aligned Title Screen's Option Text Script by Black Mage.
  3. # For: RPG Maker VX Ace
  4. # Version: 1.0
  5. #
  6. # License: CC-BY 3.0
  7. # https://burningwizard.wordpress.com/
  8. #==============================================================================
  9.  
  10. #==============================================================================
  11. # Changelog
  12. #==============================================================================
  13. # Version 1.0
  14. #   - Initial version.
  15. #==============================================================================
  16.  
  17. #------------------------------------------------------------------------------
  18. # * Beyond this is the sacred land of code. You need programming qualification
  19. #   to delve deeper, or it'll cause many unnecessary problems. Proceed at your
  20. #   own risk.
  21. #------------------------------------------------------------------------------
  22.  
  23. class Window_TitleCommand < Window_Command
  24.   def item_rect_for_text(index)
  25.     rect = item_rect(index)
  26.     max_chc_wdth = text_size(command_name(index)).width
  27.     center = (self.width - max_chc_wdth - (padding*2)) / 2
  28.     rect.x = center; rect.width -= 8; rect
  29.   end
  30. end
Add Comment
Please, Sign In to add comment