WoW:XML/Texture: Difference between revisions

From AddOn Studio
< XML
Jump to navigation Jump to search
(Created page with 'Derived from: LayoutFrame Elements: TexCoords, Color, Gradient Attributes: file, alphaMode Note: The Textu…')
 
(Started work on making this page much more robust)
Line 1: Line 1:
==Inheritance==
A '''Texture''' is a [[XML/LayoutFrame|LayoutFrame]] XML element that describes a graphic. The graphic may be an image loaded by Blizzard or an addon, or it may be a solid color or gradient. Textures support partially transparent images and different strategies for blending these into other images. They may be changed to show only a portion of a loaded image using ''texture coordinates''.
Derived from: [[XML/LayoutFrame|LayoutFrame]]
 
==Images==
Textures are the means to display images in the game. The image must be either a [http://en.wikipedia.org/wiki/Truevision_TGA TGA] or [http://en.wikipedia.org/wiki/.BLP BLP] image file. Textures may only load images whose dimensions are powers of two, such as 2x2, 4x8, and so on. Images that have non-power of two dimensions will show up as solid green textures. The image does not need to be square, however, so rectangular dimensions like 32x128 are also valid.
 
==Virtual Textures==
 
Virtual textures are textures that are allowed to be used as a template for other textures. This is useful in situations where textures vary by a small amount. In this case, the similarity can be put in a virtual texture, and the children need to only describe their differences.


==Elements==
==Elements==
Line 14: Line 20:
Note: The Texture must be within a ''[[XML_User_Interface#Layers_and_Textures|<Layer>]]''
Note: The Texture must be within a ''[[XML_User_Interface#Layers_and_Textures|<Layer>]]''


Note #2: When adding custom textures remember that the ''file'' '''must''' have power-of-two dimensions, or else you'll end up with a solid green texture. For reference: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048... You can always cut off any excess size with TexCoords.
==Examples==
 
<pre>
<Texture name="SparkleTextureNormal" file="Interface\ItemSocketingFrame\UI-ItemSockets" alphaMode="ADD" hidden="true">
<Size>
<AbsDimension x="13" y="13"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<TexCoords left="0.3984375" right="0.4453125" top="0.40234375" bottom="0.44921875"/>
</Texture>
</pre>
[[Category:XML elements]]
[[Category:XML elements]]

Revision as of 03:54, 28 April 2010

A Texture is a LayoutFrame XML element that describes a graphic. The graphic may be an image loaded by Blizzard or an addon, or it may be a solid color or gradient. Textures support partially transparent images and different strategies for blending these into other images. They may be changed to show only a portion of a loaded image using texture coordinates.

Images

Textures are the means to display images in the game. The image must be either a TGA or BLP image file. Textures may only load images whose dimensions are powers of two, such as 2x2, 4x8, and so on. Images that have non-power of two dimensions will show up as solid green textures. The image does not need to be square, however, so rectangular dimensions like 32x128 are also valid.

Virtual Textures

Virtual textures are textures that are allowed to be used as a template for other textures. This is useful in situations where textures vary by a small amount. In this case, the similarity can be put in a virtual texture, and the children need to only describe their differences.

Elements

<TexCoords>, Color, Gradient

Attributes

file
(string) File name
alphaMode
(string) Blending mode

Notes

Note: The Texture must be within a <Layer>

Examples

<Texture name="SparkleTextureNormal" file="Interface\ItemSocketingFrame\UI-ItemSockets" alphaMode="ADD" hidden="true">
	<Size>
		<AbsDimension x="13" y="13"/>
	</Size>
	<Anchors>
		<Anchor point="CENTER">
			<Offset>
				<AbsDimension x="0" y="0"/>
			</Offset>
 		</Anchor>
	</Anchors>
	<TexCoords left="0.3984375" right="0.4453125" top="0.40234375" bottom="0.44921875"/>
</Texture>