The XML atlas resource class. More...

#include "murl_resource_xml_atlas.h"

Inheritance diagram for Murl::Resource::XmlAtlas:

Additional Inherited Members

- Public Types inherited from Murl::IFactoryObject< IObject >
using ClassInfoArray = Array< const ClassInfo * >
 Definition of an array of ClassInfo objects.
- Public Member Functions inherited from Murl::Resource::IObject
virtual Bool GetFileDependencies (Array< String > &fileNames) const =0
 Fill a given string array with names of files the resource depends on. More...
- Public Member Functions inherited from Murl::IFactoryObject< IObject >
 ~IFactoryObject () override
 The destructor.
virtual const ClassInfo * GetObjectClassInfo () const=0
 Get the object instance's class info, if present. More...
virtual void ResetObjectProperties ()=0
 Reset the object instance's properties to their default values.
- Static Public Member Functions inherited from Murl::IFactoryObject< IObject >
static const PropertyInfoGetPropertyInfo ()
 Get the class' property info struct. More...
static const AttributeInfoGetAttributeInfo ()
 Get the class' attribute info struct. More...
static void ResetProperties (IFactoryObject< IObject > *object)
 Reset an object instance's properties to their default values. More...

Detailed Description

The XML atlas resource class.

An XML atlas file is recognized by its <Atlas> root element. Within the root element, the only allowed elements are of type <Rectangle>, each of which defines a single IAtlas::Raw::Rectangle entry, with increasing (zero-based) index that can be used to retrieve this rectangle via IAtlas::GetRectangle().

The following attributes are accepted in a <Rectangle> tag:

  • coordX1, coordY1, coordX2, coordY2: The actual start and end X/Y coordinates for the screen area stored in the resulting IAtlas::Raw::Rectangle structure.
  • coordSizeX, coordSizeY: Alternatively, the horizontal/vertical screen size of the rectangle. Only valid if not both explicit coordinates are given for the respective axis.
  • coordOffsetX, coordOffsetY: Horizontal/vertical center offset of the screen rectangle, only valid together with a given size, and if no explicit coordinate is given for the respective axis.
  • texCoordX1, texCoordY1, texCoordX2, texCoordY2 and
  • texCoordSizeX, texCoordSizeY, texCoordOffsetX, texCoordOffsetY: Define the actual start and end texture coordinates. The same restrictions apply as for the screen area.

Example of an XML atlas file:

<?xml version="1.0" ?>
<Rectangle coordSizeX="16" coordSizeY="16" texCoordX1="0" texCoordY1="0" texCoordX2="64" texCoordY2="64"/>
<Rectangle coordSizeX="16" coordSizeY="16" texCoordX1="64" texCoordY1="0" texCoordX2="128" texCoordY2="64"/>
<Rectangle coordSizeX="16" coordSizeY="16" texCoordX1="128" texCoordY1="0" texCoordX2="192" texCoordY2="64"/>
<Rectangle coordSizeX="16" coordSizeY="16" texCoordX1="192" texCoordY1="0" texCoordX2="256" texCoordY2="64"/>
<Rectangle coordSizeX="16" coordSizeY="16" texCoordX1="256" texCoordY1="0" texCoordX2="320" texCoordY2="64"/>
<Rectangle coordSizeX="16" coordSizeY="16" texCoordX1="320" texCoordY1="0" texCoordX2="384" texCoordY2="64"/>
<Rectangle coordSizeX="16" coordSizeY="16" texCoordX1="384" texCoordY1="0" texCoordX2="448" texCoordY2="64"/>
<Rectangle coordSizeX="16" coordSizeY="16" texCoordX1="448" texCoordY1="0" texCoordX2="512" texCoordY2="64"/>

Note that when using texture coordinates outside the 0.0-1.0 range defined by the hardware (like in the given example), the texture reference size should be set accordingly, e.g. via Graph::IPlaneSequenceGeometry::SetTextureSize().

XML atlas resources can be generated using the atlas_generator tool, or created by hand.

Use the <Resource> tag in a .murlres package's resource.xml file to specify an XML atlas resource. See Resource::Object.

The documentation for this class was generated from the following file:
  • murl_resource_xml_atlas.h

Copyright © 2011-2024 Spraylight GmbH.