local Constraints = require "lib.simple_ui.core.constraints" local SingleChildElement = require "lib.simple_ui.core.single_child_element" --- @class ScreenArea : SingleChildElement local element = setmetatable({}, SingleChildElement) element.__index = element element.type = "ScreenArea" function element:layout() local screenW, screenH = love.graphics.getWidth(), love.graphics.getHeight() self.constraints = Constraints { maxWidth = screenW, maxHeight = screenH } self.size = Vec3 { screenW, screenH } if not self.child then return end self.child.constraints = Constraints { maxWidth = screenW, maxHeight = screenH, } self.child:layout() self.child.offset = Vec3 {} end --- @return ScreenArea --- @param values {child: UIElement?} function element:new(values) return SingleChildElement.new(self, values) end return element