Zwoptex comes packaged with a couple of very stable well tested coordinate formats. Sometimes game engines are using newer builds or arn't as mainstream. This repository is a collection of formats you can add through Zwoptex's preferences and use in your own documents.
The coordinates syntax is based on Matt Gemmell's MGTemplateEngine but open sourced as MGKit with some modifications.
{% for <value> in <collection> %}
{{ currentLoop.currentIndex }} # current loop index - 0 based
{{ currentLoop.currentIndex1 }} # current loop index - 1 based
{{ currentLoop.startIndex }} # current loop start index - 0 based
{{ currentLoop.startIndex1 }} # current loop start index - 1 based
{{ currentLoop.endIndex }} # current loop end index - 0 based
{{ currentLoop.endIndex1 }} # current loop end index - 1 based
{{ currentLoop.first }} # boolean if on first object
{{ currentLoop.last }} # boolean if on last object
{% /for %}
{% if currentLoop.first %}<{% /if %}
{% if not currentLoop.first %},{% /if %}
{% if currentLoop.last %}<{% /if %}
Matt Gemmell's page has more information on all the syntax details if you need more than for loops and if statements.
Zwoptex inputs a lot of variables into the system for you to use. Here's a list:
metadata
- metadata objecttarget
- publish target objectsprites
- array of sprite objectsspritesAndAliases
- array of sprites objects including aliases
version
- Zwoptex versionname
- document namesize
- texture size as "{, }"sizeWidth
- texture size widthsizeHeight
- texture size heightpremultipliedAlpha
- if alpha is premultiplied ( PVR formats only )target
- publish target object
name
- target nametextureFileName
- target texture file nametextureFileExtension
- target texture file extension namecoordinatesFileName
- target coordinates file namecoordinatesFileNameExtension
- target coordinates file extension namepremultipliedAlpha
- if alpha is premultiplied ( PVR formats only )scale
- scale of document in decimal where 1.0 is 100%
name
- sprite namenameWithoutExtension
- sprite name without extensionsourceSize
- source size as "{, }"sourceSizeHeight
- source size widthsourceSizeHeight
- source size heightsourceColorRect
- source color rect as "{{, }, {, }}"sourceColorRectX
- source color rect xsourceColorRectY
- source color rect ysourceColorRectWidth
- source color rect widthsourceColorRectHeight
- source color rect heightsize
- size as "{, }"sizeWidth
- size widthsizeHeight
- size heightoffset
- offset as "{, }"offsetX
- offset xoffsetY
- offset yisTrimmed
- if sprite is trimmedisRotated
- if sprite is rotatedtextureRect
- textureRect as "{{, }, {, }}"textureRectX
- texture rect xtextureRectY
- texture rect ytextureRectWidth
- texture rect widthtextureRectHeight
- texture rect heightaliases
- array of alias strings