Thread Tools Display Modes
04-17-07, 01:20 AM   #1
ClemSnide
A Deviate Faerie Dragon
 
ClemSnide's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 12
Creating custom frame borders?

Call me "intermediate." I have a mod that's working but I want to dress it up-- the default window elements are just too boring. As I understand it from reading other peoples' code, there's two ways to do this.
  • 1. Place graphics in the Backdrop element, for example
    Code:
    <Backdrop bgFile="Interface\AddOns\WIM\Images\WIM_UI_BG" edgeFile="Interface\AddOns\WIM\Images\WIM_UI" tile="true">
    	<BackgroundInsets>
    		<AbsInset left="64" right="64" top="64" bottom="64" />
    	</BackgroundInsets>
    	<TileSize>
    		<AbsValue val="8" />
    	</TileSize>
    	<EdgeSize>
    		<AbsValue val="64" />
    	</EdgeSize>
    </Backdrop>
    Source: WIM
    whixh requires the graphics to be (some power of two) pixels square; and
  • 2. Place graphics in an ARTWORK layer, for example
    Code:
    <Layer level="ARTORK">
    	<Texture file="Interface\TaxiFrame\UI-TaxiFrame-BotLeft">
    		<Size>
    			<AbsDimension x="256" y="256"/>
    		</Size>
    		<Anchors>
    			<Anchor point="BOTTOMLEFT">
    				<Offset>
    					<AbsDimension x="-9" y="-71"/>
    				</Offset>
    			</Anchor>
    		</Anchors>
    	</Texture>
    </Layer>
    which may or may not. (This only seems to work if you use Blizzard's paths; I tried copying the file into my AddOn's folder and using that path, and got the green "couldn't find graphic" texture.)

My own file, a tga graphic of size 404x273, doesn't load at all. The WIM graphics work as long as I use the author's folder; when I copy them to mine (again resetting the path) they fail. So, I'm pleading: Has anyone done work on an AddOn which had a custom border, and if so, how did you do it?

Thanks!
  Reply With Quote
04-17-07, 06:25 AM   #2
Riraito
An Aku'mai Servant
 
Riraito's Avatar
Join Date: Dec 2006
Posts: 32
from my experience, any image you try to use with wow must have dimensions with a power of two
__________________
  Reply With Quote
04-17-07, 08:46 AM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
That has been my experience as well. Even something you put in an eePanel or a custom status bar/cast bar texture needs to have dimensions of a power of two.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
04-18-07, 02:13 AM   #4
ClemSnide
A Deviate Faerie Dragon
 
ClemSnide's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 12
Both of you are quite correct, as I also found. I had the bright idea of using the Tutorial frame (which doesn't suck, and looks more or less the way I want, without the extraneous elements of the other frames).

That definition goes into the Backdrop element of the frame:
Code:
<Backdrop edgeFile="Interface\TUTORIALFRAME\TUTORIALFRAMEBORDER" tile="true">
	<EdgeSize>
		<AbsValue val="32"/>
	</EdgeSize>
</Backdrop>
(I later use a color fill to handle the internal color, so I don't need a bgFile.) However, I also wanted a badge at the top left. So in the ARTWORK layer went

Code:
<Texture file="Interface\AddOns\MyAddOn\UI-MyBadge-TopLeft">
	<Size>
		<AbsDimensions x="128" y="128"/>
	</Size>
	<Anchors>
		<Anchor point="TOPLEFT">
			<Offset>
				<AbsDimension x="-7" y="10"/>
			</Offset>
		</Anchor>
	</Anchors>
</Texture>
This overlaid the graphic on top of the Tutorial frame. I found by experience that the best way to do it was to make the bulk of the badge transparent, so that it didn't place unwanted colors in its rectangle. (I actually believe that one of those dimensions could be 64, which ought to work-- WoWWiki says you can mix values as long as they're both powers of 2.)

Guess what? It works. In fact, it works so well I did my little Chicken Dance of Victory when I saw it. I'm planning a small tutorial on this particular aspect of modding, with the tools and procedures and everything.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Creating custom frame borders?


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