Quantcast
WoWInterface - View Single Post - How to add a thin border to a frame?
View Single Post
12-12-20, 02:27 PM   #6
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 550
If you want something simple and direct, this is what I use to add a 1pixel black border around my chat frame with a single pixel missing at the corners:

Lua Code:
  1. local frame = frameYouWantToAddBordersTo
  2.  
  3. local frameborder=CreateFrame("frame",nil,frame)
  4. frameborder:SetAllPoints(frame)
  5. frameborder:SetFrameStrata("BACKGROUND")
  6. frameborder:SetFrameLevel(1)
  7. frameborder.left=frameborder:CreateTexture(nil,"BORDER")
  8. frameborder.left:SetPoint("BOTTOMLEFT",frameborder,"BOTTOMLEFT",-2,-1)
  9. frameborder.left:SetPoint("TOPRIGHT",frameborder,"TOPLEFT",-1,1)
  10. frameborder.left:SetColorTexture(0,0,0,1)
  11. frameborder.right=frameborder:CreateTexture(nil,"BORDER")
  12. frameborder.right:SetPoint("BOTTOMLEFT",frameborder,"BOTTOMRIGHT",1,-1)
  13. frameborder.right:SetPoint("TOPRIGHT",frameborder,"TOPRIGHT",2,1)
  14. frameborder.right:SetColorTexture(0,0,0,1)
  15. frameborder.top=frameborder:CreateTexture(nil,"BORDER")
  16. frameborder.top:SetPoint("BOTTOMLEFT",frameborder,"TOPLEFT",-1,1)
  17. frameborder.top:SetPoint("TOPRIGHT",frameborder,"TOPRIGHT",1,2)
  18. frameborder.top:SetColorTexture(0,0,0,1)
  19. frameborder.bottom=frameborder:CreateTexture(nil,"BORDER")
  20. frameborder.bottom:SetPoint("BOTTOMLEFT",frameborder,"BOTTOMLEFT",-1,-1)
  21. frameborder.bottom:SetPoint("TOPRIGHT",frameborder,"BOTTOMRIGHT",1,-2)
  22. frameborder.bottom:SetColorTexture(0,0,0,1)

A blank "background" container with four black textures anchored to the four corners. With the way this lays out, these lines rest right on the edges of the parent frame, leaving the blank corners clear from the parent frame's own background. Attached is a screenshot of my chatframes. I repeat this code for each chatframe separately.
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	122
Size:	194.5 KB
ID:	9551  
  Reply With Quote