Files
PathOfBuilding/Classes/LabelControl.lua
Openarl bae83782f4 Major update; nearing release
Changes:
 - Literally everything
 - Everything else too
2016-08-29 21:52:56 +10:00

19 lines
528 B
Lua

-- Path of Building
--
-- Class: Label Control
-- Simple text label.
--
local launch, main = ...
local LabelClass = common.NewClass("LabelControl", "Control", function(self, anchor, x, y, width, height, label)
self.Control(anchor, x, y, width, height)
self.label = label
self.width = function()
return DrawStringWidth(self:GetProperty("height"), "VAR", self:GetProperty("label"))
end
end)
function LabelClass:Draw()
local x, y = self:GetPos()
DrawString(x, y, "LEFT", self.height, "VAR", self:GetProperty("label"))
end