Statistics: Posted by ArtVC — 11 May 2020, 16:35
uid = "ecbf6277-24e3-437a-b968-EcoManager-v7"
\EM\modules\mexes.lua
overlay.OnFrame = function(self, delta)
if not unit:IsDead() then
local worldView = import('/lua/ui/game/worldview.lua').viewLeft
local pos = worldView:Project(unit:GetPosition())
if pos.x >=0 or pos.y >=0 then
LayoutHelpers.AtLeftTopIn(overlay, worldView, pos.x - overlay.Width() / 2, pos.y - overlay.Height() / 2 + 1)
else
overlay.destroy = true
overlay:Hide()
--LOG('Bad position: ('..pos.x..'/'..pos.y..')')
end
else
overlay.destroy = true
overlay:Hide()
end
end
Statistics: Posted by Ejsstiil — 28 Jan 2017, 21:55
Statistics: Posted by ladderff — 08 Nov 2016, 15:28
function CreateMexOverlay(unit)
--local worldView = import('/lua/ui/game/worldview.lua').viewLeft
local overlay = Bitmap(GetFrame(0))
local id = unit:GetEntityId()
overlay.id = unit:GetEntityId()
overlay.destroy = false
overlay:SetSolidColor('black')
overlay.Width:Set(10)
overlay.Height:Set(10)
overlay.OnFrame = function(self, delta)
if not unit:IsDead() then
local worldView = import('/lua/ui/game/worldview.lua').viewLeft
local pos = worldView:Project(unit:GetPosition())
if pos.x <=0 or pos.y <=0 then
LOG('Bad position: ('..pos.x..'/'..pos.y..')')
end
LayoutHelpers.AtLeftTopIn(overlay, worldView, pos.x - overlay.Width() / 2, pos.y - overlay.Height() / 2 + 1)
else
overlay.destroy = true
overlay:Hide()
end
end
overlay.text = UIUtil.CreateText(overlay, '0', 10, UIUtil.bodyFont)
overlay.text:SetColor('green')
overlay.text:SetDropShadow(true)
LayoutHelpers.AtCenterIn(overlay.text, overlay, 0, 0)
overlay:SetNeedsFrameUpdate(true)
return overlay
end
Statistics: Posted by yorick — 02 Jan 2016, 17:34
Statistics: Posted by Dragonfire — 17 Sep 2015, 22:49
Statistics: Posted by yorick — 17 Sep 2015, 21:36
Statistics: Posted by Dragonfire — 17 Sep 2015, 18:24