View Single Post
07-25-22, 09:24 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
If you have an OnLoad you can set the backdrop there:

Lua Code:
  1. <Ui xmlns="http://www.blizzard.com/wow/ui/"
  2.  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  3.     <Frame name="BCHFrame" parent="UIParent"  toplevel="true" movable="true" enableMouse="true" inherits="BackdropTemplate">
  4.         <!--Anchors is a property element-->
  5.         <Size>
  6.             <AbsDimension x="200" y="150" />
  7.         </Size>
  8.         <Anchors>
  9.             <!-- An anchor can be created with frame:SetPoint() method-->
  10.             <Anchor point="LEFT" relativePoint="CENTER">
  11.                 <Offset>
  12.                     <AbsDimension x="150" y="0" />
  13.                 </Offset>
  14.             </Anchor>
  15.         </Anchors>
  16.         <Frames>
  17.             <!-- close button -->
  18.             <Button name="$parent_CloseButton" inherits="UIPanelCloseButton">
  19.                 <Anchors>
  20.                     <Anchor point="TOPRIGHT" relativePoint="TOPRIGHT">
  21.                         <Offset>
  22.                             <AbsDimension x="0" y="0" />
  23.                         </Offset>
  24.                     </Anchor>
  25.                 </Anchors>
  26.             </Button>
  27.         </Frames>
  28.         <Scripts>
  29.             <OnLoad>
  30.                 self:SetBackdrop(BACKDROP_DIALOG_32_32)
  31.                 self:RegisterForDrag("LeftButton")
  32.             </OnLoad>
  33.             <OnDragStart>self:StartMoving()</OnDragStart>
  34.             <OnDragStop>self:StopMovingOrSizing()</OnDragStop>
  35.         </Scripts>
  36.     </Frame>
  37. </Ui>
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote