overlay = Bitmap(GetFrame(0))
overlay.Width:Set(100)
overlay.Height:Set(50)
overlay.etaText = UIUtil.CreateText(overlay, 'ETA', 10, UIUtil.bodyFont)
overlay.etaText:SetColor('white')
overlay.etaText:SetDropShadow(true)
overlay:SetNeedsFrameUpdate(true)
overlay.OnFrame = function(self, delta)
local unit = GetSelectedUnits()
if unit then
overlay.pos = unit[1]:GetPosition()
local worldView = import('/lua/ui/game/worldview.lua').viewLeft
local pos = worldView:Project(overlay.pos)
LayoutHelpers.AtLeftTopIn(overlay, worldView, pos.x - overlay.Width() / 2, pos.y - overlay.Height() / 2 + 1)
LayoutHelpers.AtCenterIn(overlay.etaText, overlay, 15, 0)
overlay.etaText:SetText('Why is it shaking ?')
else
overlay.etaText:SetText('')
end
end
Statistics: Posted by Franck83 — 28 Jul 2018, 16:56