So I needed this functionality for the current project I'm working on (see: Vortex Voyager).
Here it is, go crazy:
module Gosu
class Font
def draw_with_linebreaks(text, x, y, z, factor_x = 1, factor_y = 1, color = 0xffffffff, mode = :default, y_padding=0)
text.split("\n").each_with_index() do |line, i|
self.draw(line, x, y+(i*(self.height+y_padding)), z, factor_x, factor_y, color, mode)
end
end
end
end
Loading...