Added support for UI to have background_images, fixed TextBlock text overdrawing

This commit is contained in:
2022-04-25 20:12:10 -05:00
parent d81df5f4e2
commit a75afaf47a
4 changed files with 96 additions and 1 deletions

View File

@@ -18,7 +18,14 @@ module CyberarmEngine
end
def render
@text.draw
# Gosu.clip_to is too expensive to always use so check if we actually need it.
if @text.width > width || @text.height > height
Gosu.clip_to(@x, @y, width, height) do
@text.draw
end
else
@text.draw
end
end
def recalculate