Quantcast
WoWInterface - View Single Post - How to add a thin border to a frame?
View Single Post
12-14-20, 04:06 PM   #12
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,346
Something else to try:
Lua Code:
  1. local function CreateBorder(self)
  2.     if not self.borders then
  3.         self.borders = {}
  4.         for i=1, 4 do
  5.             self.borders[i] = self:CreateLine(nil, "BACKGROUND", nil, 0)
  6.             local l = self.borders[i]
  7.             l:SetThickness(1)
  8.             l:SetColorTexture(1, 1, 0, 1)
  9.             if i==1 then
  10.                 l:SetStartPoint("TOPLEFT")
  11.                 l:SetEndPoint("TOPRIGHT")
  12.             elseif i==2 then
  13.                 l:SetStartPoint("TOPRIGHT")
  14.                 l:SetEndPoint("BOTTOMRIGHT")
  15.             elseif i==3 then
  16.                 l:SetStartPoint("BOTTOMRIGHT")
  17.                 l:SetEndPoint("BOTTOMLEFT")
  18.             else
  19.                 l:SetStartPoint("BOTTOMLEFT")
  20.                 l:SetEndPoint("TOPLEFT")
  21.             end
  22.         end
  23.     end
  24. end
  25.  
  26. local f = CreateFrame("Frame")
  27. f:SetSize(40, 40)
  28. f:SetPoint("CENTER")
  29. f.bg = f:CreateTexture()
  30. f.bg:SetAllPoints()
  31. f.bg:SetTexture("Interface/BUTTONS/WHITE8X8")
  32. f.bg:SetVertexColor(0, 0, 0)
  33. f:SetResizable(true)
  34. f:EnableMouse(true)
  35. f:RegisterForDrag("LeftButton")
  36. f:SetScript("OnDragStart", function(self)
  37.     self:StartSizing("BOTTOMRIGHT")
  38. end)
  39. f:SetScript("OnDragStop", function(self)
  40.     self:StopMovingOrSizing()
  41. end)
  42.  
  43. CreateBorder(f)

It's along the same lines as Kanegasi's solution.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-14-20 at 05:11 PM.
  Reply With Quote