View Single Post
05-24-21, 08:26 PM   #7
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
Lua Code:
  1. <Frame name="TestFrame" parent="UIParent">
  2.     <Size x="300" y="300"/>
  3.     <Anchors>
  4.         <Anchor point="CENTER"/>
  5.     </Anchors>
  6.     <Scripts>
  7.         <OnLoad inherit="prepend">
  8.             if BackdropTemplateMixin then
  9.                 Mixin(self, BackdropTemplateMixin)
  10.             end
  11.             self:SetBackdrop( BACKDROP_TOOLTIP_16_16_5555 )
  12.             self:SetBackdropColor(unpack(LEGENDARY_ORANGE_COLOR))
  13.             self:SetBackdropColor(0.25)
  14.  
  15.         </OnLoad>
  16.     </Scripts>
  17. </Frame>

Because the frame doesn't have the backdrop code when it is created, the xml attributes for backdrops are ignored (or error?) so they have to be set after the frame is configured to use a backdrop via the mixin.

This should work in all versions of the client.

You could replace:
Code:
self:SetBackdrop( BACKDROP_TOOLTIP_16_16_5555 )
with:
Code:
self:SetBackdrop(
    {
        bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
        edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
        tile = true,
        tileEdge = true,
        tileSize = 16,
        edgeSize = 16,
        insets = { left = 5, right = 5, top = 5, bottom = 5 },
    }
)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-24-21 at 08:36 PM.
  Reply With Quote