Simple plain text exporter for demo purposes

See http://www.grantlee.org/apidox/for_themers.html for more information

Texture data:
    texture.width  = {{texture.size.width}}
    texture.height = {{texture.size.height}}

    texture.trimmedName = {{texture.trimmedName}}
    texture.fullName = {{texture.fullName}}
    texture.absoluteFileName = {{texture.absoluteFileName}}

SmartUpdateHash: {{smartUpdateKey}}

Exporter Properties, defined in exporter.xml

String: {{exporterProperties.string_property}}
Bool: {{exporterProperties.bool_property}}

Settings:

Access to all values in the settings (.tps file):

settings.tpsName                = {{settings.tpsName}} (empty if used from command line without .tps file)
settings.allowRotation          = {{settings.allowRotation}}
settings.autoAliasEnabled       = {{settings.autoAliasEnabled}}
settings.flipPVR                = {{settings.flipPVR}}
settings.forceIdenticalLayout   = {{settings.forceIdenticalLayout}}
settings.multiPack              = {{settings.multiPack}}
settings.premultiplyAlpha       = {{settings.premultiplyAlpha}}
settings.trimSpriteNames        = {{settings.trimSpriteNames}}
settings.fixedTextureSize       = {{settings.fixedTextureSize.width}} x {{settings.fixedTextureSize.height}}
settings.dataFormat             = {{settings.dataFormat}}
settings.textureSubPath         = {{settings.textureSubPath}}
settings.ditherType             = {{settings.ditherType}}
settings.outputFormat           = {{settings.outputFormat}}
settings.textureFormat          = {{settings.textureFormat}}
settings.backgroundColor        = {{settings.backgroundColor}}
settings.borderPadding          = {{settings.borderPadding}}
settings.shapePadding           = {{settings.shapePadding}}
settings.commonDivisorX         = {{settings.commonDivisorX}}
settings.commonDivisorY         = {{settings.commonDivisorY}}
settings.dpi                    = {{settings.dpi}}
settings.reduceBorderArtifacts  = {{settings.reduceBorderArtifacts}}

settings.contentProtection.key  = {{settings.contentProtection.key}}

Variants:
{% for variant in settings.autoSDSettings %}
---
variant.scale = {{variant.scale}}
variant.extension = {{variant.extension}}
variant.spriteFilter = {{variant.spriteFilter}}
variant.acceptFractionalValues = {{variant.acceptFractionalValues}}
variant.maxTextureSize = {{variant.maxTextureSize.width}} x {{variant.maxTextureSize.height}}
{% endfor %}


Not yet available:

settings.dataFileNames          = {% for filename in settings.dataFileNames %} {{filename}} {% endfor %}
settings.textureFileName        = {{settings.textureFileName}}
settings.algorithmSettings      = {{settings.algorithmSettings}}
settings.globalSpriteSettings   = {{settings.globalSpriteSettings}}

Adjusted values for the current autosd variant:

variantParams.scale             = {{variantParams.scale}}
variantParams.shapePadding      = {{variantParams.shapePadding}}
variantParams.borderPadding     = {{variantParams.borderPadding}}
variantParams.commonDivisorX    = {{variantParams.commonDivisorX}}
variantParams.commonDivisorY    = {{variantParams.commonDivisorY}}
variantParams.extrude           = {{variantParams.extrude}}
variantParams.baseFactor        = {{variantParams.baseFactor}}
variantParams.maxTextureSize    = {{variantParams.maxTextureSize.width}} x {{variantParams.maxTextureSize.height}}
variantParams.fixedTextureSize  = {{variantParams.fixedTextureSize.width}} x {{variantParams.fixedTextureSize.height}}

Sprite data:

There are 2 variants:
- sprites - contains the sprites, aliases are available in the
  aliasList property and are not added top level

- allSprites - list of all sprites

Load javascript filter plugin, must be located in the exporter's folder in a subfolder
grantlee/0.2/makecssselector.qs
{% load makecssselector %}

// set width & height for calculations using the javascript filter
{{texture.size.width|setWidth}}
{{texture.size.width|setHeight}}

{% for sprite in allSprites %}
    =========================================================================

    Use the javascript filter plugin to replace -hover with :hover
    {{sprite.fullName|makecssselector}}

    -- name without image type extension
    sprite.trimmedName      = {{sprite.trimmedName}}

    -- name with image extension
    sprite.fullName         = {{sprite.fullName}}

    -- offset of the center of the trimmed sprite from the
    -- center of the original sprite (used by cocos2d)
    sprite.centerOffset.x = {{sprite.centerOffset.x}}
    sprite.centerOffset.y = {{sprite.centerOffset.y}}

    -- list of alias sprites for this one
    sprite.aliasList = {% for a in sprite.aliasList %} {{ a.trimmedName }} {% endfor %}

    --- frame rectangle with pixel coordinates
    sprite.frameRect.x = {{sprite.frameRect.x}}
    sprite.frameRect.y = {{sprite.frameRect.y}}
    sprite.frameRect.width = {{sprite.frameRect.width}}
    sprite.frameRect.height = {{sprite.frameRect.height}}

    --- frame rectangle with uv coordinates (0..1)
    sprite.frameRectRel.x = {{sprite.frameRectRel.x}}
    sprite.frameRectRel.y = {{sprite.frameRectRel.y}}
    sprite.frameRectRel.width = {{sprite.frameRectRel.width}}
    sprite.frameRectRel.height = {{sprite.frameRectRel.height}}

    --- frame rectangle with uv coordinates (0..1) calculated through JS
    sprite.frameRectRel.x = {{sprite.frameRect.x|makeRelX}}
    sprite.frameRectRel.y = {{sprite.frameRect.y|makeRelY}}
    sprite.frameRectRel.width = {{sprite.frameRect.width|makeRelX}}
    sprite.frameRectRel.height = {{sprite.frameRect.height|makeRelY}}

    --- version of the frame rect with "original" width and height
    sprite.frameRectWithoutRotation.x = {{sprite.frameRectWithoutRotation.x}}
    sprite.frameRectWithoutRotation.y = {{sprite.frameRectWithoutRotation.y}}
    sprite.frameRectWithoutRotation.width = {{sprite.frameRectWithoutRotation.width}}
    sprite.frameRectWithoutRotation.height = {{sprite.frameRectWithoutRotation.height}}

    -- true if the sprite was rotated
    sprite.rotated        = {{sprite.rotated}}

    -- true if the sprite does not contain any transparent pixels
    sprite.isSolid        = {{sprite.isSolid}}

    -- true if the sprite was trimmed
    sprite.trimmed        = {{sprite.trimmed}}

    -- scaling factor set in sprite settings
    sprite.scale          = {{sprite.scale}}

    sprite.sourceRect.x = {{sprite.sourceRect.x}}
    sprite.sourceRect.y = {{sprite.sourceRect.y}}
    sprite.sourceRect.width = {{sprite.sourceRect.width}}
    sprite.sourceRect.height = {{sprite.sourceRect.height}}

    sprite.cornerOffset.x = {{sprite.cornerOffset.x}}
    sprite.cornerOffset.y = {{sprite.cornerOffset.y}}

    sprite.untrimmedSize.width = {{sprite.untrimmedSize.width}}
    sprite.untrimmedSize.height = {{sprite.untrimmedSize.height}}

    -- the file absolute file name of the sprite
    sprite.fileData.absoluteFileName = {{sprite.fileData.absoluteFileName}}

    -- the modification date of the sprite
    sprite.fileData.lastModified = {{sprite.fileData.lastModified}}

    -- the creation date of the sprite
    sprite.fileData.created = {{sprite.fileData.created}}

    -- the file size of the sprite
    sprite.fileData.fileSize = {{sprite.fileData.fileSize}}

{% endfor %}

#### Complete dump of all available objects

### Values for the current texture
The following values are available inside templates that are written for each
variant or multipack. They are not available in a file that has the following values set:
<hasSeparateAutoSDFiles>all</hasSeparateAutoSDFiles>
<hasSeparateMultiPackFiles>last</hasSeparateMultiPackFiles>

## sprites
Contains the sprite of the current file, aliases are available through the aliasList property
Shortcut into texture.sprites

## allSprites
Contains all sprites of the current file including aliases.
Shortcut into texture.allSprites

## texture
Contains information about the current texture, size, and other information.
Shortcut into allResults[variantIndex].textures[multiPackIndex]

## variantParams
The data the current file was created with

### Values for all files
The following values are available for all templates

## settings
The main settigns the file was created with

## smartUpdateKey
The key for this file used to check file consistency and avoid re-calculating
data that is already available

## multiPackIndex
The multipack index number the current file was created with

## variantIndex
The AutoSD variant index the file was created with

## allResults
All texture and sprite information in a big array

smartUpdateKey = {{smartUpdateKey}}

multiPackIndex = {{multiPackIndex}}

variantIndex = {{variantIndex}}

variantParams{{variantParams|objectInfo}}

settings{{settings|objectInfo}}

allResults{{allResults|objectInfo}}

texture{{texture|objectInfo}}

allSprites{{allSprites|objectInfo}}

sprites{{sprites|objectInfo}}
