Difference between revisions of "Imageset files"
From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
m (Robot: Adding Category:Uncategorised) |
|||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | 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 | + | 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). | Imagesets define one or more images on a larger image (texture). | ||
The root element must be Imageset. | The root element must be Imageset. | ||
+ | NOTE: These XML files are case sensitive, so the XML Elements/Attributes will be written in the case required rather than by capitalization rules. | ||
− | + | == Document structure == | |
− | + | * '''Imageset''' | |
+ | ** '''Image Element''' | ||
+ | |||
+ | |||
+ | == Imageset Element == | ||
Has attributes and a collection of one or more Image elements. | Has attributes and a collection of one or more Image elements. | ||
− | 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''. | |
− | 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. |
− | + | * '''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. | ||
+ | <source lang="xml"> | ||
+ | <?xml version="1.0" ?> | ||
+ | <Imageset version="2" name="MyLook" imagefile="MyLook.tga" nativeHorzRes="800" nativeVertRes="600" autoScaled="true"> | ||
+ | ... | ||
+ | ... resources ... | ||
+ | ... | ||
+ | </Imageset> | ||
+ | </source> | ||
− | Image Element | + | == Image Element == |
− | + | ||
Has attributes defining an sub-image area. Can have no sub-elements. | Has attributes defining an sub-image area. Can have no sub-elements. | ||
− | Image attributes | + | 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''. | |
+ | |||
+ | <source lang="xml"> | ||
+ | <?xml version="1.0" ?> | ||
+ | <Imageset version="2" name="MyLook" imagefile="MyLook.tga" nativeHorzRes="800" nativeVertRes="600" autoScaled="true"> | ||
+ | ... | ||
+ | <Image name="MyWidgetImage" xPos="0" yPos="0" width="64" height="64" /> | ||
+ | ... | ||
+ | </Imageset> | ||
+ | </source> | ||
− | |||
− | [[Category: | + | [[Category:Manuals]] |
+ | [[Category:Update requested]] |
Latest revision as of 21:35, 25 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.
NOTE: These XML files are case sensitive, so the XML Elements/Attributes will be written in the case required rather than by capitalization rules.
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 version="2" 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 version="2" name="MyLook" imagefile="MyLook.tga" nativeHorzRes="800" nativeVertRes="600" autoScaled="true"> ... <Image name="MyWidgetImage" xPos="0" yPos="0" width="64" height="64" /> ... </Imageset>