lib/cyberarm_engine/text.rb in cyberarm_engine-0.17.1 vs lib/cyberarm_engine/text.rb in cyberarm_engine-0.18.0
- old
+ new
@@ -63,10 +63,19 @@
end
font
end
+ def swap_font(size, font_name = @font)
+ if @size != size || @font != font_name
+ @size = size
+ @font = font_name
+
+ @textobject = check_cache(size, font_name)
+ end
+ end
+
def text=(string)
@rendered_shadow = nil
@text = string
end
@@ -138,9 +147,10 @@
@textobject.send(method, @text, _x - @shadow_size, _y + @shadow_size, @z, @factor_x, @factor_y, white, :add)
@textobject.send(method, @text, _x + @shadow_size, _y, @z, @factor_x, @factor_y, white, :add)
@textobject.send(method, @text, _x + @shadow_size, _y + @shadow_size, @z, @factor_x, @factor_y, white, :add)
end
+
@rendered_shadow.draw(@x - @shadow_size, @y - @shadow_size, @z, @factor_x, @factor_y, shadow_color)
end
@textobject.send(method, @text, @x, @y, @z, @factor_x, @factor_y, @color, @mode)
end