Container child elements that are not visible are no longer drawn

This commit is contained in:
2021-12-24 17:00:02 -06:00
parent c35d587419
commit c8734ae98b
2 changed files with 10 additions and 1 deletions

View File

@@ -129,6 +129,9 @@ module CyberarmEngine
child.reposition # TODO: Implement top,bottom,left,center, and right positioning
Stats.increment(:gui_recalculations_last_frame, 1)
child.element_visible = child.x >= @x - child.width && child.x <= @x + width &&
child.y >= @y - child.height && child.y <= @y + height
end
update_background