Weird mouse behaviour
I have done the frame below and it works fine.
However I want the frame to be draggable and as far as I know I should use the code that is commented out.
But once I do that the frame get stuck to the mouse pointer all the time. What am I doing wrong?
-- initializing saved variables
aofhVisible = true
aofhGrouppercent = 85
aofhRaidpercent = 60
-- Frame functions
function AoFHeal_Function_OnLoad()
end
function AoFHeal_Function_OnEvent( event )
end
function AoFHeal_Function_OnDragStart()
aofhf:StartMoving();
end
function AoFHeal_Function_OnDragStop()
aofhf:StopMovingOrSizing();
end
function AoFHeal_Function_Update(elapsed)
end
-- Creating a frame
aofhf = CreateFrame("Frame","AofHeal_Frame_Main",UIParent)
aofhf:SetFrameStrata("LOW")
aofhf:SetWidth(160)
aofhf:SetHeight(110)
aofhf:SetBackdrop({bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
tile = true, tileSize = 32, edgeSize = 16,
insets = { left = 5, right = 5, top = 5, bottom = 5 }});
aofhftit = aofhf:CreateFontString("aofh_title","BACKGROUND",GameFontNormalSmall)
aofhftit:SetFont(STANDARD_TEXT_FONT, 20, "OUTLINE")
aofhftit:SetTextColor(1, 1, 0.2)
aofhftit:SetPoint("TOP", aofhf, "TOP", 0, 15)
aofhftit:SetText("AoF Heal")
aofhf:SetPoint("CENTER",0,0)
--aofhf:SetMovable(true)
--aofhf:EnableMouse(true)
--aofhf:SetScript("OnDragStart",AoFHeal_Function_OnDragStart())
--aofhf:SetScript("OnDragStop",AoFHeal_Function_OnDragStop())
--aofhf:SetScript("OnMouseUp",AoFHeal_Function_OnDragStop())
aofhf:Show()
|