Reply
 
Thread Tools Display Modes
Old 04-01-09, 04:10 PM   #1
Geebles
A Murloc Raider
Join Date: Apr 2009
Posts: 8
Question Beginner: Custom Graphic

I've been trying all day to make my "hello world" addon display a custom graphic on the screen. (since it is the basic bones of an addon that works) I've looked at so many things and haven't gotten anywhere.

I wonder if someone could show me some xml code to display a custom graphic on the screen?

I just want to take a png in photoshop, convert it to the right format, put it in the addon's folder, and see how to get that on the screen in the simplest way possible. I haven't been able to find a simple example anywhere that actually works to help me get started...
Geebles is offline   Reply With Quote
Old 04-01-09, 04:28 PM   #2
Maul
Ion Engines, Engage!
 
Maul's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 401
Code:
	<Frame name="MyImageFrame" parent="UIParent">
		<Size x="50" y="50"/>
		<Anchors>
			<Anchor point="CENTER"/>
		</Acnhors>
		<Layers>
			<Layer level="OVERLAY">
				<Texture name="$parentMyImage" file="Interface\AddOns\MyAddon\MyImageName.tga">
					<Size x="50" y="50"/>
					<Anchors>
						<Anchor point="CENTER"/>
					</Anchors>
				</Texture>
			</Layer>
		</Layers>
	</Frame>
Thia would be one basic XML way. Replace the file path with one to your file. Make sure your texture is WoW compliant
__________________

Twitter: @IonMaul | Windows Live: trinityui@live.com | Google Talk: trinityui@gmail.com
Maul is offline   Reply With Quote
Old 05-20-09, 08:54 PM   #3
Samsan
An Aku'mai Servant
 
Samsan's Avatar
Join Date: May 2009
Posts: 33
Smile Custom Graphic in XML

Here's an example of code I use to create a piece of frame background. The images don't have to be in a seperate directory but personally I do it for a little more organization. This is a snippet from my frame background, it's 1 of 6 pieces. I also found that WoW prefers images with dimensions of 256 x 256, 512 x 512 and so on but smaller ones 128 x 64, 32 x 32, 64 x 64 etc. It was trial and error to get the sizing right for me.

I use "Gimp" to create the tga's, "Tilesplitter" to make the 256 squares and believe it or not "Windows Paint" to create the original images.


Hope this helps

Code:
     <Frame name="TopSkinTexture1Right">
        <Size>
          <AbsDimension x="512" y="32" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="245" y="-31" />
            </Offset>
          </Anchor>
        </Anchors>
        <Layers>
          <Layer Level="ARTWORK">
            <Texture name="DWMBgS2" setAllPoints="true" file="interface\AddOns\yourmod\images\Purple-Panel_S1a">
              <TexCoords left="0" right="1" top="0" bottom="1" />
            </Texture>
          </Layer>
        </Layers>
        </Frame>
__________________
To give is to receive so the more that you give the more that you receive.

Last edited by Samsan : 05-20-09 at 09:01 PM.
Samsan is offline   Reply With Quote
Old 05-23-09, 09:11 AM   #4
Exawatt
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Feb 2009
Posts: 36
BLP and TGA files (only two accepted) need to have dimensions of power-of-two numbers (up to 2^10). By that I mean only 16, 32, 64, 128, 256, 512, and 1024 are valid as either width or height. They also must be in 256 colors (8 bits per pixel).

An image can be 32x512, but not 30x500. If you want a different part of it in game, then you take only a portion of that file using the <TexCoords> tag. If you want a different size, then you resize it (the selected area) with the <Size> tag. As a side note; I have files where half of the image file is unused, simply because it's width is a couple of pixels over a limit, and I had to use the next size up.

Here is a decent tutorial, though it is very old... Around page 6 or so it starts talking about textures.

Last edited by Exawatt : 05-23-09 at 09:19 AM.
Exawatt is offline   Reply With Quote
Old 05-23-09, 11:42 AM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,526
Here is a more recent guide: http://forums.wowace.com/showthread.php?t=15439
__________________
"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

Seerah is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » Graphics Help » Beginner: Custom Graphic

Thread Tools
Display Modes

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