Skip to content

Generic XML ​

Packrat writes TexturePacker-style XML. Each page has an XML file and an image. For several pages, XML filenames are numbered: atlas_1.xml, atlas_2.xml, and so on.

xml
<?xml version="1.0" encoding="UTF-8"?>
<TextureAtlas imagePath="atlas.png" width="512" height="512">
  <sprite n="player_0000" x="128" y="64" w="40" h="48"
          oX="12" oY="8" oW="64" oH="64" />
</TextureAtlas>
AttributeMeaning
imagePath, width, heightPage image and dimensions
nExported frame key
x, y, w, hPacked rectangle
oX, oY, oW, oHTop-left trim offset and original size; omitted if untrimmed
r="y"Rotated rectangle; currently absent because rotation is disabled

Load the image named by imagePath and read the frame rectangle from it. Place the frame at oX, oY within a canvas of size oW, oH. If the trim fields are absent, use zero offset and the packed dimensions. Names that cannot be written as valid XML are rejected.

See Sources and outputs for frame names, trimming, and effect maps.

Packrat documentation