Originally Posted by OverCraft
I want to make a frame that has a OnEnter/OnLeave Script with a funciton to make a frame bigger and print more info on it, and at the same time be able to keep moving the character camera op top of the frame with the right mouse click as the frame doesn't exist.
|
Blizzard added that functionality awhile ago:
Lua Code:
local f = CreateFrame("Frame",nil,UIParent)
f.tex = f:CreateTexture()
f.tex:SetAllPoints(f)
f.tex:SetColorTexture(0.5, 0.2, 1 , 0.5)
f:SetSize(300,200)
f:SetPoint("CENTER")
f:SetScript ("OnEnter", function(self) print("OnEnter") end)
f:SetScript ("OnLeave", function(self) print("OnLeave") end)
f:EnableMouse(false)
f:SetMouseMotionEnabled(true)
The order of the last four lines is important. Setting a script dealing with the mouse automatically enables the mouse. So set your OnEnter/OnLeave scripts, then disable the mouse, and finally enable motion scripts only.