WorldFrame:SetMinResize(178, 100)
--WorldFrame:SetClampedToScreen(true)
local C = CreateFrame("Frame", nil, WorldFrame)
C:SetClampedToScreen(true)
C:SetFrameStrata("Fullscreen_Dialog")
C:SetPoint("Center", WorldFrame, "Center", 0, 0)
C:SetSize(12, 12)
C:SetFrameLevel(20)
C:EnableMouse(true)
C.texture = C:CreateTexture(nil, "Overlay")
C.texture:SetAllPoints(C)
C.texture:SetTexture("Interface\\Addons\\ZPerl_RaidHelper\\Images\\XPerl_MoveCursor")
C:SetScript("OnMouseDown", function(self, button)
if button == "LeftButton" then
WorldFrame:SetMovable(true)
WorldFrame:StartMoving()
end
end)
C:SetScript("OnMouseUp", function(self, button)
WorldFrame:StopMovingOrSizing()
WorldFrame:SetMovable(false)
end)
local BR = CreateFrame("Frame", nil, WorldFrame)
BR:SetClampedToScreen(true)
BR:SetFrameStrata("Fullscreen_Dialog")
BR:SetPoint("BottomRight", WorldFrame, "BottomRight", 0, 0)
BR:SetSize(12, 12)
BR:SetFrameLevel(20)
BR:EnableMouse(true)
BR.texture = BR:CreateTexture(nil, "Overlay")
BR.texture:SetAllPoints(BR)
BR.texture:SetTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Up")
BR:SetScript("OnEnter", function(self)
BR.texture:SetTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Highlight")
end)
BR:SetScript("OnLeave", function(self)
BR.texture:SetTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Up")
end)
BR:SetScript("OnMouseDown", function(self, button)
if button == "LeftButton" then
WorldFrame:SetResizable(true)
WorldFrame:StartSizing("BottomRight")
end
BR.texture:SetTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Down")
end)
BR:SetScript("OnMouseUp", function(self, button)
WorldFrame:StopMovingOrSizing()
WorldFrame:SetResizable(false)
end)
local TL = CreateFrame("Frame", nil, WorldFrame)
TL:SetClampedToScreen(true)
TL:SetFrameStrata("Fullscreen_Dialog")
TL:SetPoint("TopLeft", WorldFrame, "TopLeft", 0, 0)
TL:SetSize(12, 12)
TL:SetFrameLevel(20)
TL:EnableMouse(true)
TL.texture = TL:CreateTexture(nil, "Overlay")
local ULx, ULy, LLx, LLy, URx, URy, LRx, LRy = TL.texture:GetTexCoord()
TL.texture:SetTexCoord(LRx, LRy, URx, URy, LLx, LLy, ULx, ULy)
TL.texture:SetAllPoints(TL)
TL.texture:SetTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Up")
TL:SetScript("OnEnter", function(self)
TL.texture:SetTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Highlight")
end)
TL:SetScript("OnLeave", function(self)
TL.texture:SetTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Up")
end)
TL:SetScript("OnMouseDown", function(self, button)
if button == "LeftButton" then
WorldFrame:SetResizable(true)
WorldFrame:StartSizing("TopLeft")
end
TL.texture:SetTexture("Interface\\ChatFrame\\UI-ChatIM-SizeGrabber-Down")
end)
TL:SetScript("OnMouseUp", function(self, button)
WorldFrame:StopMovingOrSizing()
WorldFrame:SetResizable(false)
end)