View Single Post
05-10-19, 12:19 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
More like:
Lua 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/">
  2.     <Script file="Some.lua" />
  3.  
  4.     <Frame name="iTrackerBodyFrameTemplate" virtual="true">
  5.         <Anchors>
  6.             <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="BOTTOMLEFT"/>
  7.             <Anchor point="TOPRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT"/>
  8.         </Anchors>
  9.         <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="" tile="true">
  10.             <BackgroundInsets>
  11.                 <AbsInset left="0" right="0" top="0" bottom="0" />
  12.             </BackgroundInsets>
  13.             <TileSize val="32" />
  14.             <EdgeSize val="32" />
  15.         </Backdrop>
  16.         <Scripts>
  17.             <OnLoad>
  18.                 iTrackerFrame_TitleFrameTemplate_OnLoad_SetWidth(self)
  19.             </OnLoad>
  20.         </Scripts>
  21.     </Frame>
  22.  
  23.     <Frame name="iTrackerFrame_TitleFrameTemplate" virtual="true" movable="true">
  24.         <Size x="200" y="20" />
  25.         <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background-Dark" edgeFile="" tile="true">
  26.             <BackgroundInsets>
  27.                 <AbsInset left="0" right="0" top="0" bottom="0" />
  28.             </BackgroundInsets>
  29.             <TileSize val="32" />
  30.             <EdgeSize val="32" />
  31.         </Backdrop>
  32.         <Layers>
  33.             <Layer level="OVERLAY">
  34.                 <FontString name="title" parentKey="title" inherits="GameFontNormal" text="&lt;title&gt;">
  35.                     <Anchors>
  36.                         <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT" />
  37.                         <Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="BOTTOMRIGHT" />
  38.                     </Anchors>
  39.                 </FontString>
  40.             </Layer>
  41.         </Layers>
  42.         <Frames>
  43.             <Frame name="$parent_BodyFrame" parentKey="body" inherits="iTrackerBodyFrameTemplate" />
  44.         </Frames>
  45.         <Scripts>
  46.             <OnLoad>
  47.                 self:EnableMouse(true)
  48.                 self:RegisterForDrag("LeftButton")
  49.             </OnLoad>
  50.             <OnDragStart>
  51.                 self:StartMoving()
  52.             </OnDragStart>
  53.             <OnDragStop>
  54.                 self:StopMovingOrSizing()
  55.             </OnDragStop>
  56.         </Scripts>
  57.     </Frame>
  58.  
  59.     <Frame name="FizzTrack" parent="UIParent"  inherits="iTrackerFrame_TitleFrameTemplate">
  60.         <Anchors>
  61.             <Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER" />
  62.         </Anchors>
  63.     </Frame>
  64. </Ui>

Lua Code:
  1. function iTrackerFrame_TitleFrameTemplate_OnLoad_SetWidth(Frame)
  2.     -- Set desired height
  3.     title:SetText("Some Name")
  4.     Frame:SetHeight(300)
  5. end

The width of the body will size with the header and its height can be set independently so the function name is now a bit misleading, more like
TrackerFrame_BodyFrameTemplate_OnLoad_SetHeight.

Edited: so the background insets and anchors don't overlay and darken the text.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 05-10-19 at 12:42 AM.
  Reply With Quote