Imageset Files

From Multiverse

Jump to: navigation, search

Contents

Overview

Imageset files in the Interface/Imagesets directory of your asset repository define one or more images on a larger image, defined by a bitmap or texture file in the /Imagefiles directory.

If your image uses an alpha channel then the DDS format must be used. For DDS files, the texture dimensions must be a power of two. Textures need not be square. Sizes such as 256x256 and 1024x128 for example are acceptable. Non power-of-two textures will work, but will be internally scaled upward to the next power of two, possibly with unacceptable results.


Defining an imageset

An imageset is defined by an XML file with root element is <Imageset>. For example:

<Imageset Name="My_Imageset" Imagefile="MySample.jpg" NativeHorzRes="64"
          NativeVertRes="64" AutoScaled="false">
  <Image Name="Button_Red"   XPos="0"  YPos="0"  Width="32" Height="32" />
  <Image Name="Button_Green" XPos="32" YPos="0"  Width="32" Height="32" />
  <Image Name="Button_Blue"  XPos="0"  YPos="32" Width="32" Height="32" />
  <Image Name="Button_Grey"  XPos="32" YPos="32" Width="32" Height="32" />
</Imageset>

This imageset defines four 32x32 pixel images that can be used in Textures:

  • My_Imageset\Button_Red
  • My_Imageset\Button_Green
  • My_Imageset\Button_Blue
  • My_Imageset\Button_Grey

When you reference these, you must precede them with "Interface\", For example:

<NormalTexture file="Interface\My_Imageset\Button_Red"/>

Imageset Element

The <Imageset> tag can contain one or more Image elements. The following table descrbes the attributes of the <Imageset> tag.

Attribute Description Required / Default
Imagefile Path to the image file containing the graphics. Required
Name Name assigned to the Imageset in the GUI system Required
AutoScaled Boolean, states whether to scale imagery so it appears the same size with any screen resolution Optional. default is false
NativeHorzRes Horizontal size of image in pixels Required
NativeVertRes Vertical size of image in pixels Required

Image Element

The Image tag defines an sub-image area, and cannot contain any other elements (tags). It has the attributes described in the following table.

Attribute Description Required / Default
Name Name that identifies the image within the Imageset. Required
XPos X pixel co-ordinate of the top-left corner of the image on the texture. Required
YPos Y pixel co-ordinate of the top-left corner of the image on the texture. Required
Width Width of this image in pixels. Required
Height Height of this image in pixels. Required
XOffset Horizontal offset to apply when rendering. Optional. Default is zero (0).
YOffset Vertical offset to apply when rendering. Optional. Default is zero (0).
Personal tools