Update Button and Label

This commit is contained in:
Sabine Lim
2023-05-16 02:29:35 +10:00
parent 7a6c9480f8
commit 84b3263ff2
3 changed files with 20 additions and 2 deletions

View File

@@ -23,7 +23,11 @@ return function(name, basalt)
getBase = function(self)
return base
end,
end,
getHorizontalAlign = function(self)
return textHorizontalAlign
end,
setHorizontalAlign = function(self, pos)
textHorizontalAlign = pos
@@ -31,12 +35,20 @@ return function(name, basalt)
return self
end,
getVerticalAlign = function(self)
return textVerticalAlign
end,
setVerticalAlign = function(self, pos)
textVerticalAlign = pos
self:updateDraw()
return self
end,
getText = function(self)
return text
end,
setText = function(self, newText)
text = newText
self:updateDraw()

View File

@@ -77,6 +77,12 @@ return function(name, basalt)
return self
end,
--- Gets the text alignment of the label.
--- @return string
getTextAlign = function(self)
return textAlign
end,
--- Sets the text alignment of the label.
--- @param align string The alignment of the text. Can be "left", "center", or "right".
--- @return object

View File

@@ -475,7 +475,7 @@ return {
base.setValuesByXMLData(self, data, renderContext)
self:updateSpecifiedValuesByXMLData(data, {
"text",
"align"
"textAlign"
})
return self
end,