WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Cant get a simple frame to display in WOTLK (https://www.wowinterface.com/forums/showthread.php?t=59575)

maciekish 05-04-23 01:47 PM

Cant get a simple frame to display in WOTLK
 
Hi, I'm still very new to addon development and i'm struggling to display a simple frame. It gets loaded because the chat message gets displayed and if i enable mouse, i cant click through it, so its there in the middle of the screen but invisible. Can anyone help me with the background please? I want a black background with a silver frame.

Code:

<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ http://wowprogramming.com/FrameXML/UI.xsd">
  <Frame name="CritlineClassicDisplay" parent="UIParent" toplevel="true" enableMouse="false" movable="true">
    <Scripts>
      <OnLoad>
        print("Frame Loaded")
      </OnLoad>
    </Scripts>
    <Size>
      <AbsDimension x="400" y="200"/>
    </Size>
    <Anchors>
      <Anchor point="CENTER" relativePoint="CENTER"/>
    </Anchors>
    <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true">
      <BackgroundInsets>
        <AbsInset left="11" right="12" top="12" bottom="11"/>
      </BackgroundInsets>
      <TileSize>
        <AbsValue val="32"/>
      </TileSize>
      <EdgeSize>
        <AbsValue val="32"/>
      </EdgeSize>
    </Backdrop>
  </Frame>
</Ui>


Fizzlemizz 05-04-23 02:25 PM

Two problems, frames don't automatically have Backdrops any more so they have to inherit the BackdropTemplate (because of that, defining backdrops in XML is done differently).

Without and option to define when it should run, your OnLoad script would "overwrite" (run instead of) the Backdrop templates OnLoad causing it to not run.

Slight change to your XML to show something.

XML Code:
  1. <Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ http://wowprogramming.com/FrameXML/UI.xsd">
  2.   <Frame name="CritlineClassicDisplay" parent="UIParent" toplevel="true" enableMouse="false" movable="true" inherits="BackdropTemplate">
  3.         <Size>
  4.              <AbsDimension x="400" y="200"/>
  5.         </Size>
  6.         <KeyValues>
  7.             <KeyValue key="backdropInfo" value="BACKDROP_DIALOG_32_32" type="global"/>
  8.         </KeyValues>
  9.     <Anchors>
  10.       <Anchor point="CENTER" relativePoint="CENTER"/>
  11.     </Anchors>
  12.     <Scripts>
  13.       <OnLoad inherit="prepend">
  14.         print("Frame Loaded")
  15.       </OnLoad>
  16.     </Scripts>
  17.   </Frame>
  18. </Ui>

maciekish 05-05-23 09:56 AM

That did it, thanks :)


All times are GMT -6. The time now is 10:34 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI