1
0
mirror of https://github.com/kepler155c/opus synced 2024-09-28 23:10:41 +00:00
opus/sys/apis/ui/components/Text.lua

21 lines
427 B
Lua
Raw Normal View History

2019-02-06 04:03:57 +00:00
local class = require('class')
local UI = require('ui')
local Util = require('util')
UI.Text = class(UI.Window)
UI.Text.defaults = {
UIElement = 'Text',
value = '',
height = 1,
}
function UI.Text:setParent()
if not self.width and not self.ex then
self.width = #tostring(self.value)
end
UI.Window.setParent(self)
end
function UI.Text:draw()
2019-03-06 16:48:09 +00:00
self:write(1, 1, Util.widthify(self.value, self.width, self.align))
2019-02-06 04:03:57 +00:00
end