mirror of
https://github.com/TangentFoxy/Pop.Box.git
synced 2024-12-15 12:44:20 +00:00
adjustSize() args optional, text font set to 14 by default
This commit is contained in:
parent
2cf8a656ee
commit
ab26c62e85
@ -105,7 +105,15 @@ end
|
|||||||
|
|
||||||
function element:adjustSize(x, y)
|
function element:adjustSize(x, y)
|
||||||
local X, Y = self:getSize()
|
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
|
return self
|
||||||
end
|
end
|
||||||
|
@ -9,7 +9,7 @@ local text = class("pop.text", element)
|
|||||||
function text:initialize(pop, parent, text, color)
|
function text:initialize(pop, parent, text, color)
|
||||||
element.initialize(self, pop, parent)
|
element.initialize(self, pop, parent)
|
||||||
|
|
||||||
self.font = lg.newFont()
|
self.font = lg.newFont(14)
|
||||||
self:setText(text or "")
|
self:setText(text or "")
|
||||||
self.color = color or {255, 255, 255, 255}
|
self.color = color or {255, 255, 255, 255}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user