Something else to try:
Lua Code:
local function CreateBorder(self)
if not self.borders then
self.borders = {}
for i=1, 4 do
self.borders[i] = self:CreateLine(nil, "BACKGROUND", nil, 0)
local l = self.borders[i]
l:SetThickness(1)
l:SetColorTexture(1, 1, 0, 1)
if i==1 then
l:SetStartPoint("TOPLEFT")
l:SetEndPoint("TOPRIGHT")
elseif i==2 then
l:SetStartPoint("TOPRIGHT")
l:SetEndPoint("BOTTOMRIGHT")
elseif i==3 then
l:SetStartPoint("BOTTOMRIGHT")
l:SetEndPoint("BOTTOMLEFT")
else
l:SetStartPoint("BOTTOMLEFT")
l:SetEndPoint("TOPLEFT")
end
end
end
end
local f = CreateFrame("Frame")
f:SetSize(40, 40)
f:SetPoint("CENTER")
f.bg = f:CreateTexture()
f.bg:SetAllPoints()
f.bg:SetTexture("Interface/BUTTONS/WHITE8X8")
f.bg:SetVertexColor(0, 0, 0)
f:SetResizable(true)
f:EnableMouse(true)
f:RegisterForDrag("LeftButton")
f:SetScript("OnDragStart", function(self)
self:StartSizing("BOTTOMRIGHT")
end)
f:SetScript("OnDragStop", function(self)
self:StopMovingOrSizing()
end)
CreateBorder(f)
It's along the same lines as Kanegasi's solution.