Thread Tools Display Modes
05-04-23, 01:47 PM   #1
maciekish
A Murloc Raider
Join Date: May 2023
Posts: 4
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>
  Reply With Quote
05-04-23, 02:25 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
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>
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-04-23 at 02:39 PM.
  Reply With Quote
05-05-23, 09:56 AM   #3
maciekish
A Murloc Raider
Join Date: May 2023
Posts: 4
That did it, thanks
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Cant get a simple frame to display in WOTLK


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