View Single Post
07-28-20, 10:18 AM   #13
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Same as normal. The Mixin that is applied when using the template applies all the pre 9x backdrop methods to the frame. Nothing really changes once you've inherited the template.

Lua Code:
  1. if not f.Backdrop then
  2.     f.Backdrop = CreateFrame("Frame", name.."Backdrop", f, "BackdropTemplate")
  3.     f.Backdrop:SetAllPoints()
  4.     f.Backdrop.backdropInfo = {
  5.         bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background-Dark",
  6.         edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
  7.         tile = true,
  8.         tileSize = 32,
  9.         edgeSize = 32,
  10.         insets = { left = 11, right = 12, top = 12, bottom = 9, },
  11.     }
  12.     f.Backdrop:SetBackdrop(f.Backdrop.backdropInfo)
  13.     f.Backdrop:SetBackdropColor(r, g, b, a)
  14.     f.Backdrop:SetBackdropBorderColor(r, g, b, a)
  15. end
f could just have easily inherited the backdrop template negating the need for a separate frame unless the backdrop is applied after the frame is created eg. something like KGPanels where a backdrop can be added/removed at runtime.

Example
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 07-28-20 at 10:55 AM.
  Reply With Quote