Skip to content

joshclark/SpriteGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Sprite Generator

https://github.com/joshclark/SpriteGenerator

Github fork of http://spritegenerator.codeplex.com

This will combine multiple images into a single large image and produce a CSS file containing classes for each sprite contained in the master image. Running the executable with out command line arguments displays a UI that can be used to manually generate the sprites.

The expected use is to pass in a .sprite file that defines what images should be sprited together. The sprite file should contain a list of image files (one per line) that will be combined into the final composite image. Each image path should be relative to the .sprite file.

Using the default settings, the generator will produce a composite image and CSS file in the same directory as the .sprite file. For foo.sprite, the generator will create foo.png and foo.css. The CSS classes created will be named based on the CSS file name, the source image name, and a configurable prefix. The class name format looks like this:

{prefix}-{CSSFileName}-{SourceImageName}

If animals.sprite contains dog.jpg and cat.png, the CSS class names will be .sprite-animals-dog and .sprite-animals-cat.

It is also possible to configure various settings for the generated sprite files. To specify a setting in the .sprite file, add a line to the file of the form:

#SettingName=Value

(the line must start with a #). The available settings are:

SpriteFilePath

The path for the composite file relative to the .sprite file.  The default value uses the file 
name of the .sprite file.

CssFilePath

The path for the CSS file relative to the .sprite file.  The default value uses the file 
name of the .sprite file.

CssClassPrefix

A string to prefix to the begining of each CSS class created.  Teh default is "sprite".

Layout

One of the supported image layouts: Automatic, Horizontal, Vertical, Rectangular.  Default is 
Automatic.

DistanceBetweenImages

Amount of padding between images.  Default is 0.

MarginWidth

Amount a margin around images. Default is 0.

ImagesInRow

If the layout is Horizontal or Rectangular the number of images to allow in a single row.

ImagesInColumn

If the layout is Vertical or Rectangular the number of images to allow in a single column.

Releases

No releases published

Packages

No packages published

Languages