Skip to content

Commit

Permalink
Add E:CreateBackdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
ls- committed May 7, 2023
1 parent aeb3de3 commit 65cdffa
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Binary file added ls_UI/assets/backdrop.TGA
Binary file not shown.
1 change: 1 addition & 0 deletions ls_UI/core/_core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- can sort -->
<Script file="animation.lua"/>
<Script file="border.lua"/>
<Script file="backdrop.lua"/>
<Script file="button.lua"/>
<Script file="changelog.lua"/>
<Script file="cooldown.lua"/>
Expand Down
29 changes: 29 additions & 0 deletions ls_UI/core/backdrop.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local _, ns = ...
local E, C, PrC, M, L, P = ns.E, ns.C, ns.PrC, ns.M, ns.L, ns.P

-- Lua
local _G = getfenv(0)

-- Mine
function E:CreateBackdrop(parent)
local backdrop = CreateFrame("Frame", nil, parent, "BackdropTemplate")
backdrop:SetBackdrop({
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
edgeFile = "Interface\\AddOns\\ls_Glass\\assets\\border",
tile = true,
tileEdge = true,
tileSize = 8,
edgeSize = 8,
-- insets = {left = 4, right = 4, top = 4, bottom = 4},
})

-- the way Blizz position it creates really weird gaps, so fix it
backdrop.Center:ClearAllPoints()
backdrop.Center:SetPoint("TOPLEFT", backdrop.TopLeftCorner, "BOTTOMRIGHT", 0, 0)
backdrop.Center:SetPoint("BOTTOMRIGHT", backdrop.BottomRightCorner, "TOPLEFT", 0, 0)

backdrop:SetBackdropColor(0, 0, 0, 0.6)
backdrop:SetBackdropBorderColor(0, 0, 0, 0.6)

return backdrop
end

0 comments on commit 65cdffa

Please sign in to comment.