Black_Mage icon

Center Aligned Title Screen's Option Text Script

Black_Mage | PRO | 07/05/22 06:25:52 PM UTC (Edited) | 0 ⭐ | 475 👁️ | Never ⏰ | []
Ruby |

1.22 KB

|

None

|

0 👍

/

0 👎

#==============================================================================
# Center Aligned Title Screen's Option Text Script by Black Mage.
# For: RPG Maker VX Ace
# Version: 1.0
#
# License: CC-BY 3.0
# https://burningwizard.wordpress.com/
#==============================================================================
 
#==============================================================================
# Changelog
#==============================================================================
# Version 1.0
#   - Initial version.
#==============================================================================
 
#------------------------------------------------------------------------------
# * Beyond this is the sacred land of code. You need programming qualification
#   to delve deeper, or it'll cause many unnecessary problems. Proceed at your
#   own risk.
#------------------------------------------------------------------------------
 
class Window_TitleCommand < Window_Command
  def item_rect_for_text(index)
    rect = item_rect(index)
    max_chc_wdth = text_size(command_name(index)).width
    center = (self.width - max_chc_wdth - (padding*2)) / 2
    rect.x = center; rect.width -= 8; rect
  end
end

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎