MarioSuperStar
Member
If it is possible, how can I do that?
I have tried to use the "\n" method, but it just replaces it with a blank and the string still shows
in one line.
Solved.
Oh, really? I thought split uses a regular expression pattern... oops ^^"MarioSuperStar":2nclhlw1 said:I had to put "\n" instead of the backslashes, but it worked.
class Bitmap
#-------------------------------------------------------------------------
def draw_wrap_text(x, y, width, height, text, lineheight)
strings = text.split
strings.each do |string|
word = string + ' '
word_width = text_size(word).width
x, y = 0, y + lineheight if x + word_width > width
self.draw_text(x, y, word_width, height, word)
x += word_width
end
end
#-------------------------------------------------------------------------
end