adjustSize() args optional, text font set to 14 by default

This commit is contained in:
Fox 2016-01-22 09:01:28 -08:00
parent 2cf8a656ee
commit ab26c62e85
2 changed files with 10 additions and 2 deletions

View File

@ -105,7 +105,15 @@ end
function element:adjustSize(x, y)
local X, Y = self:getSize()
self:setSize(X + x, Y + y)
if x then
X = X + x
end
if y then
Y = Y + y
end
self:setSize(X, Y)
return self
end

View File

@ -9,7 +9,7 @@ local text = class("pop.text", element)
function text:initialize(pop, parent, text, color)
element.initialize(self, pop, parent)
self.font = lg.newFont()
self.font = lg.newFont(14)
self:setText(text or "")
self.color = color or {255, 255, 255, 255}
end