@btext = "#{@lines[index]}"
@btext.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
@bcontents_x = 0
loop do
c = @btext.slice!(/./m)
case c
when nil
break
when "\x01"
@btext.sub!(/\[([0-9]+)\]/, "")
self.contents.font.color = text_color($1.to_i)
next
else
self.contents.draw_text(rect.x + @bcontents_x, rect.y, 40, rect.height, c)
c_width = contents.text_size(c).width
@bcontents_x += c_width
end
end
@btext = "#{@lines[index]}"
@btext.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
@bcontents_x = 0
loop do
c = @btext.slice!(/./m)
case c
when nil
break
when "\x01"
@btext.sub!(/\[([0-9]+)\]/, "")
self.contents.font.color = text_color($1.to_i)
next
else
self.contents.draw_text(rect.x + @bcontents_x, rect.y, 40, rect.height, c)
c_width = contents.text_size(c).width
@bcontents_x += c_width
end
end