this is what the code looks like right now
Code:
local GUICordsFrame = CreateFrame('Button', "GUICordsFrame", UIParent)
GUICordsFrame:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, 0)
GUICordsFrame:SetHeight(11)
GUICordsFrame:SetWidth(80)
GUICordsFrame:RegisterForClicks('LeftButtonUp', 'RightButtonUp')
local GUICordsFrameBG = GUICordsFrame:CreateTexture(nil, "BACKGROUND")
GUICordsFrameBG:SetTexture(0, 0, 0, .8)
GUICordsFrameBG:SetAllPoints(GUICordsFrame)
local GUICordsFrameText = GUICordsFrame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
GUICordsFrameText:SetPoint("CENTER", GUICordsFrame, "CENTER", 0, 1)
GUICordsFrameText:SetTextColor(1, 1, 1, 1)
GUICordsFrameText:SetFont("Fonts\\FRIZQT__.TTF", 10, "NORMAL")
GUICordsFrameText:SetJustifyH("CENTER")
local UpdateInterval = 0.3
local TimeSinceLastUpdate = 0
local x,y
GUICordsFrame:SetScript("OnUpdate", function(self, elapsed)
TimeSinceLastUpdate = TimeSinceLastUpdate + elapsed
while (TimeSinceLastUpdate > UpdateInterval) do
x,y = GetPlayerMapPosition("player")
GUICordsFrameText:SetFormattedText("%.2f %.2f", 100*x, 100*y)
TimeSinceLastUpdate = TimeSinceLastUpdate - UpdateInterval
end
end)