Spriter uses a simple template system to allow more flexibility in how CSS and HTML content is generated for your project.

Template Properties

Each template can be customized in the following ways:

AttributeDescription
TextSpecifies the text of the templateSpecial keywords can be embedded which are replaced with an appropriate value
RepeatingDetermines if the template text is only processed once, or if it is processed for each sprite in the project

Template Tokens

The following tables lists the supported tokens values.

Repeating or non-repeating templates

The tokens below can be used in any repeat mode.

TokenDescription
{spritefilename}The filename of the current sprite sheet, relative to the project file
{fullspritefilename}The full filename of the current sprite sheet
{cssfilename}The filename of the CSS document export, relative to the project file
{fullcssfilename}The full filename of the CSS document export
{date}The current date and time in UTC
{appname}The name of the application generating the content
{appversion}The version of the application generating the content
{thumbnailwidth}The width of preview thumbnails
{thumbnailheight}The height of preview thumbnails
{name}The filename of the project, excluding path and extension
{filename}The filename of the project
{fullfilename}The full path and filename of the project

Repeating templates

The tokens below can only be used for templates which are repeated for each sprite in the project:

TokenDescription
{classname}The name of the CSS class associated with the sprite. This includes any class specific prefixes and suffixes, but not outer prefixes/suffixes
{fullclassname}The name of the CSS class associated with the sprite. This includes all prefixes and suffixes
{imagex}The X position of the sprite in the sprite sheet
{imagexunit}The unit representing the position of the sprite in the sprite sheet. Currently always px (pixels)
{imagey}The Y position of the sprite in the sprite sheet
{imageyunit}The unit representing the position of the sprite in the sprite sheet. Currently always px (pixels)
{imagewidth}The width of the sprite
{imagewidthunit}The unit representing the size of the sprite in the sprite sheet. Currently always px (pixels)
{imageheight}The height of the sprite
{imageheightunit}The unit representing the size of the sprite in the sprite sheet. Currently always px (pixels)
{imagefilename}The filename of the sprite, relative to the project file. For sprites automatically created as part of an effect, this will return the filename of the original image the sprite is based upon
{fullimagefilename}The full filename of the sprite. For sprites automatically created as part of an effect, this will return the filename of the original image the sprite is based upon
{imagefolder}The folder where the sprite is located
© 2010-2023 Cyotek Ltd. All Rights Reserved.
Documentation version 1.9 (buildref #60.15868), last modified 2023-04-09. Generated 2024-05-19 15:42 using Cyotek HelpWrite Professional version 6.19.1