Fixing textbox width issue

This commit is contained in:
Michael Shirt 2016-10-29 18:47:54 -06:00
parent 2a03b10d7c
commit 01b4e7e2a0

View file

@ -119,12 +119,13 @@ class Window_Message < Window_Selectable
spacewidth = self.contents.text_size(' ').width
text.split("\n").each do |line|
line.split(' ').each do |word|
if word.start_with?('\003')
#ignore new facepics
next
end
# Get width of this word and insert a newline if it goes out of bounds
width = self.contents.text_size(word.gsub(/(\000\[[0-9]+\]|\001|\002)/, '')).width
if word.include?("\003")
#ignore new facepics
width = 0
end
if x + width > maxwidth
@text << "\n"
x = 0