1
0
mirror of https://github.com/kepler155c/opus synced 2024-11-15 21:24:49 +00:00
opus/sys/apis/ui/components/VerticalMeter.lua

19 lines
463 B
Lua
Raw Normal View History

2019-02-06 04:03:57 +00:00
local class = require('class')
local UI = require('ui')
local colors = _G.colors
UI.VerticalMeter = class(UI.Window)
UI.VerticalMeter.defaults = {
UIElement = 'VerticalMeter',
backgroundColor = colors.gray,
meterColor = colors.lime,
width = 1,
value = 0,
}
function UI.VerticalMeter:draw()
local height = self.height - math.ceil(self.value / 100 * self.height)
self:clear()
self:clearArea(1, height + 1, self.width, self.height, self.meterColor)
end