Removed hardcoded screen width in VBox class.

This commit is contained in:
2025-10-05 23:34:52 -04:00
parent 2dea06f8c7
commit 719a9cd0f6
2 changed files with 5 additions and 3 deletions

View File

@@ -20,9 +20,11 @@ local VBox = make_class(Drawable, Asset)
-- Class methods
------------------------------------------------------------------------------
function VBox:_init(x, y, spacing)
function VBox:_init(x, y, w, h, spacing)
self.x = x ~= nil and x or 0
self.y = y ~= nil and y or 0
self.w = w ~= nil and w or 0
self.h = h ~= nil and h or 0
self.s = spacing ~= nil and spacing or 10
self.elements = {}
end
@@ -48,7 +50,7 @@ function VBox:load()
end
if v.float_right then
v.x = 320 - self.x - v.w
v.x = self.w - self.x - v.w
else
v.x = self.x
end