local ADDON_NAME = ...

------------------------------------------------------------
-- CONFIG
------------------------------------------------------------
local TEXTURE_PATH = "Interface\\AddOns\\PointerCircle\\circle-border-1024-10px.png"
local SIZE = 240


------------------------------------------------------------
-- FRAME SETUP
------------------------------------------------------------
local f = CreateFrame("Frame", "PointerCircleFrame", UIParent)
f:SetSize(SIZE, SIZE)
f:SetFrameStrata("DIALOG")
f:EnableMouse(false)

local shadow = f:CreateTexture(nil, "BACKGROUND")
shadow:SetTexture(TEXTURE_PATH)
shadow:SetSize(SIZE, SIZE)
shadow:SetVertexColor(0, 0, 0, 0.4) -- black, 50% opacity
shadow:SetPoint("CENTER", f, "CENTER", 7, -7) -- shadow is offset by 7 pixels to the right and down

local ring = f:CreateTexture(nil, "ARTWORK")
ring:SetTexture(TEXTURE_PATH)
ring:SetSize(SIZE, SIZE)
ring:SetVertexColor(1, 1, 1, 0.6) -- white
ring:SetPoint("CENTER")


------------------------------------------------------------
-- FOLLOW MOUSE
------------------------------------------------------------
local function UpdatePosition()
   local x, y = GetCursorPosition()
   local scale = UIParent:GetEffectiveScale()
   f:SetPoint("CENTER", UIParent, "BOTTOMLEFT", x / scale, y / scale)
end

f:SetScript("OnUpdate", UpdatePosition)
