Removed hardcoded screen width in VBox class.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user