Difference between revisions of "Imageset files"

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Jump to: navigation, search
Line 14: Line 14:
  
 
Imageset attributes:
 
Imageset attributes:
 
+
* '''Version''' - specifies the version of the resource file. Should be specified for all files, current CEGUI imageset version is: 2
 
* '''Imagefile''' - Path to the image file containing the graphics. ''Required''.
 
* '''Imagefile''' - Path to the image file containing the graphics. ''Required''.
 
* '''ResourceGroup''' - The resource group identifier to pass to the resource provider when loading the file.
 
* '''ResourceGroup''' - The resource group identifier to pass to the resource provider when loading the file.

Revision as of 23:05, 23 June 2014

For the time being, this has been copy-and-pasted directly from "readme.txt" in the XMLRefSchema directory of the CEGUI source code. Some prettier formatting along the lines of Scheme files would be nice.

Introduction

Imagesets define one or more images on a larger image (texture). The root element must be Imageset.

Document structure

  • Imageset
    • Image Element


Imageset Element

Has attributes and a collection of one or more Image elements.

Imageset attributes:

  • Version - specifies the version of the resource file. Should be specified for all files, current CEGUI imageset version is: 2
  • Imagefile - Path to the image file containing the graphics. Required.
  • ResourceGroup - The resource group identifier to pass to the resource provider when loading the file.
  • Name - the name that will be assigned to the Imageset in the GUI system. required.
  • NativeHorzRes - The horizontal screen resolution that the images were are intended to be displayed at. Optional, default=640.
  • NativeVertRes - The vertical screen resolution that the images were are intended to be displayed at. Optional, default=480.
  • AutoScaled - Boolean, states whether to scale imagery so it appears the same size as any resolution. Optional, default=false.

Imageset is the root element and is the only "global" tag.

  <?xml version="1.0" ?>
  <Imageset Name="MyLook" Imagefile="MyLook.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true">
    ...
    ... resources ...
    ...
  </Imageset>

Image Element

Has attributes defining an sub-image area. Can have no sub-elements.

Image attributes:

  • Name - The name that will be used to identify 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=0.
  • YOffset - Vertical offset to apply when rendering. Optional, default=0.
  <?xml version="1.0" ?>
  <Imageset Name="MyLook" Imagefile="MyLook.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true">
    ...
    <Image Name="MyWidgetImage" XPos="0" YPos="0" Width="64" Height="64" />
    ...
  </Imageset>