Added support for future borderless window option, added initial support for label word wrapping (needs more work), fixed toggle button checkmark not displaying due to changes in Label

This commit is contained in:
2020-12-14 15:39:16 -06:00
parent 2d57d62bc2
commit d3ff7c1fc1
7 changed files with 116 additions and 58 deletions

View File

@@ -115,22 +115,23 @@ module CyberarmEngine
if @shadow && !ARGV.join.include?("--no-shadow")
shadow_alpha = @color.alpha <= 30 ? @color.alpha : @shadow_alpha
shadow_color = @shadow_color ? @shadow_color : Gosu::Color.rgba(@color.red, @color.green, @color.blue, shadow_alpha)
white = Gosu::Color::WHITE
_x = @shadow_size
_y = @shadow_size
@rendered_shadow ||= Gosu.render((self.width+(shadow_size*2)).ceil, (self.height+(@shadow_size*2)).ceil) do
@textobject.send(method, @text, _x-@shadow_size, _y, @z)
@textobject.send(method, @text, _x-@shadow_size, _y-@shadow_size, @z)
@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)
@textobject.send(method, @text, _x, _y-@shadow_size, @z, @factor_x)
@textobject.send(method, @text, _x+@shadow_size, _y-@shadow_size, @z)
@textobject.send(method, @text, _x, _y-@shadow_size, @z, @factor_x, @factor_y, white, :add)
@textobject.send(method, @text, _x+@shadow_size, _y-@shadow_size, @z, @factor_x, @factor_y, white, :add)
@textobject.send(method, @text, _x, _y+@shadow_size, @z)
@textobject.send(method, @text, _x-@shadow_size, _y+@shadow_size, @z)
@textobject.send(method, @text, _x, _y+@shadow_size, @z, @factor_x, @factor_y, white, :add)
@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)
@textobject.send(method, @text, _x+@shadow_size, _y+@shadow_size, @z)
@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