Update Button and Label
This commit is contained in:
@@ -25,18 +25,30 @@ return function(name, basalt)
|
|||||||
return base
|
return base
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
getHorizontalAlign = function(self)
|
||||||
|
return textHorizontalAlign
|
||||||
|
end,
|
||||||
|
|
||||||
setHorizontalAlign = function(self, pos)
|
setHorizontalAlign = function(self, pos)
|
||||||
textHorizontalAlign = pos
|
textHorizontalAlign = pos
|
||||||
self:updateDraw()
|
self:updateDraw()
|
||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
getVerticalAlign = function(self)
|
||||||
|
return textVerticalAlign
|
||||||
|
end,
|
||||||
|
|
||||||
setVerticalAlign = function(self, pos)
|
setVerticalAlign = function(self, pos)
|
||||||
textVerticalAlign = pos
|
textVerticalAlign = pos
|
||||||
self:updateDraw()
|
self:updateDraw()
|
||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
getText = function(self)
|
||||||
|
return text
|
||||||
|
end,
|
||||||
|
|
||||||
setText = function(self, newText)
|
setText = function(self, newText)
|
||||||
text = newText
|
text = newText
|
||||||
self:updateDraw()
|
self:updateDraw()
|
||||||
|
|||||||
@@ -77,6 +77,12 @@ return function(name, basalt)
|
|||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
--- Gets the text alignment of the label.
|
||||||
|
--- @return string
|
||||||
|
getTextAlign = function(self)
|
||||||
|
return textAlign
|
||||||
|
end,
|
||||||
|
|
||||||
--- Sets the text alignment of the label.
|
--- Sets the text alignment of the label.
|
||||||
--- @param align string The alignment of the text. Can be "left", "center", or "right".
|
--- @param align string The alignment of the text. Can be "left", "center", or "right".
|
||||||
--- @return object
|
--- @return object
|
||||||
|
|||||||
@@ -475,7 +475,7 @@ return {
|
|||||||
base.setValuesByXMLData(self, data, renderContext)
|
base.setValuesByXMLData(self, data, renderContext)
|
||||||
self:updateSpecifiedValuesByXMLData(data, {
|
self:updateSpecifiedValuesByXMLData(data, {
|
||||||
"text",
|
"text",
|
||||||
"align"
|
"textAlign"
|
||||||
})
|
})
|
||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user