Thread Tools Display Modes
08-02-18, 01:16 PM   #1
pcg79
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2018
Posts: 7
[Solved] UIPanelDialogTemplate backdrop appears inconsistently

I was playing with different frame templates. I stumbled upon UIPanelDialogTemplate and liked it because it came with a built-in title bar. But I've noticed that when I apply a backdrop to it, some times the backdrop just doesn't show up. Or it'll show on the title and not the main part. Or it'll show in the main part and not the title.

I'm assuming the solution is "don't use UIPanelDialogTemplate" but I was curious if anyone knew if I was doing something else wrong.

https://imgur.com/a/tQIpVQV

The entirety of my code:

Code:
local frame = CreateFrame("Frame", "TestPopup", UIParent, "UIPanelDialogTemplate")
frame:SetBackdrop({
  bgFile = "Interface\\ACHIEVEMENTFRAME\\UI-GuildAchievement-AchievementBackground",
  insets = {left = 6, right = 6, top = 6, bottom = 6},
})
frame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
frame:SetWidth(350)
frame:SetHeight(100)

Last edited by pcg79 : 08-02-18 at 03:03 PM.
  Reply With Quote
08-02-18, 01:40 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
I might be wrong, but I believe you're setting a different type of "background" that's z-fighting with the template's own backgrounds. Try using the global designations of the title and dialog body directly instead of the whole frame.

Here's the whole template from SharedXML\SharedBasicControls.xml:

XML Code:
  1. <Frame name="UIPanelDialogTemplate" virtual="true">
  2.     <Layers>
  3.         <Layer level="OVERLAY">
  4.             <Texture name="$parentTopLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
  5.                 <Size x="64" y="64"/>
  6.                 <Anchors>
  7.                     <Anchor point="TOPLEFT"/>
  8.                 </Anchors>
  9.                 <TexCoords left="0.501953125" right="0.625" top="0" bottom="1"/>
  10.             </Texture>
  11.             <Texture name="$parentTopRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
  12.                 <Size x="64" y="64"/>
  13.                 <Anchors>
  14.                     <Anchor point="TOPRIGHT"/>
  15.                 </Anchors>
  16.                 <TexCoords left="0.625" right="0.75" top="0" bottom="1"/>
  17.             </Texture>
  18.             <Texture name="$parentTop" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
  19.                 <Size x="0" y="64"/>
  20.                 <Anchors>
  21.                     <Anchor point="TOPLEFT" relativeTo="$parentTopLeft" relativePoint="TOPRIGHT"/>
  22.                     <Anchor point="TOPRIGHT" relativeTo="$parentTopRight" relativePoint="TOPLEFT"/>
  23.                 </Anchors>
  24.                 <TexCoords left="0.25" right="0.369140625" top="0" bottom="1"/>
  25.             </Texture>
  26.             <Texture name="$parentBottomLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
  27.                 <Size x="64" y="64"/>
  28.                 <Anchors>
  29.                     <Anchor point="BOTTOMLEFT"/>
  30.                 </Anchors>
  31.                 <TexCoords left="0.751953125" right="0.875" top="0" bottom="1"/>
  32.             </Texture>
  33.             <Texture name="$parentBottomRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
  34.                 <Size x="64" y="64"/>
  35.                 <Anchors>
  36.                     <Anchor point="BOTTOMRIGHT"/>
  37.                 </Anchors>
  38.                 <TexCoords left="0.875" right="1" top="0" bottom="1"/>
  39.             </Texture>
  40.             <Texture name="$parentBottom" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
  41.                 <Size x="0" y="64"/>
  42.                 <Anchors>
  43.                     <Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeft" relativePoint="BOTTOMRIGHT"/>
  44.                     <Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRight" relativePoint="BOTTOMLEFT"/>
  45.                 </Anchors>
  46.                 <TexCoords left="0.376953125" right="0.498046875" top="0" bottom="1"/>
  47.             </Texture>
  48.             <Texture name="$parentLeft" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
  49.                 <Size x="64" y="0"/>
  50.                 <Anchors>
  51.                     <Anchor point="TOPLEFT" relativeTo="$parentTopLeft" relativePoint="BOTTOMLEFT"/>
  52.                     <Anchor point="BOTTOMLEFT" relativeTo="$parentBottomLeft" relativePoint="TOPLEFT"/>
  53.                 </Anchors>
  54.                 <TexCoords left="0.001953125" right="0.125" top="0" bottom="1"/>
  55.             </Texture>
  56.             <Texture name="$parentRight" file="Interface\PaperDollInfoFrame\UI-GearManager-Border">
  57.                 <Size x="64" y="0"/>
  58.                 <Anchors>
  59.                     <Anchor point="TOPRIGHT" relativeTo="$parentTopRight" relativePoint="BOTTOMRIGHT"/>
  60.                     <Anchor point="BOTTOMRIGHT" relativeTo="$parentBottomRight" relativePoint="TOPRIGHT"/>
  61.                 </Anchors>
  62.                 <TexCoords left="0.1171875" right="0.2421875" top="0" bottom="1"/>
  63.             </Texture>
  64.             <FontString parentKey="Title" inherits="GameFontNormal">
  65.                 <Anchors>
  66.                     <Anchor point="TOPLEFT" x="12" y="-8"/>
  67.                     <Anchor point="TOPRIGHT" x="-32" y="-8"/>
  68.                 </Anchors>
  69.             </FontString>
  70.         </Layer>
  71.         <Layer level="BACKGROUND">
  72.             <Texture name="$parentTitleBG" file="Interface\PaperDollInfoFrame\UI-GearManager-Title-Background">
  73.                 <Anchors>
  74.                     <Anchor point="TOPLEFT" x="8" y="-7"/>
  75.                     <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" x="-8" y="-24"/>
  76.                 </Anchors>
  77.             </Texture>
  78.             <Texture name="$parentDialogBG" file="Interface\PaperDollInfoFrame\UI-Character-CharacterTab-L1">
  79.                 <Anchors>
  80.                     <Anchor point="TOPLEFT" x="8" y="-24"/>
  81.                     <Anchor point="BOTTOMRIGHT" x="-6" y="8"/>
  82.                 </Anchors>
  83.                 <TexCoords left="0.255" right="1" top="0.29" bottom="1"/>
  84.             </Texture>
  85.         </Layer>
  86.     </Layers>
  87.     <Frames>
  88.         <Button name="$parentClose" inherits="UIPanelCloseButton">
  89.             <Anchors>
  90.                 <Anchor point="TOPRIGHT" x="2" y="1"/>
  91.             </Anchors>
  92.         </Button>
  93.     </Frames>
  94. </Frame>

For your frame, the title background object is TestPopupTitleBG and the body is TestPopupDialogBG.
  Reply With Quote
08-02-18, 03:03 PM   #3
pcg79
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Jul 2018
Posts: 7
Oh, that's fantastic! First, that helps me learn how to read the xml files, and second, using those globals with SetTexture worked perfectly. Thank you!

Last edited by pcg79 : 08-02-18 at 03:11 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » [Solved] UIPanelDialogTemplate backdrop appears inconsistently

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off