spritesmith
Advanced tools
Comparing version 0.18.0 to 0.19.0
# spritesmith changelog | ||
0.19.0 - Added ability to turn off image sorting via `imageOpts` | ||
0.18.0 - Upgraded `gmsmith` to implicitly find `imagemagick` | ||
@@ -3,0 +5,0 @@ |
{ | ||
"name": "spritesmith", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"description": "Utility that takes images and creates a spritesheet with JSON sprite data", | ||
@@ -19,3 +19,3 @@ "main": "src/smith.js", | ||
"async": "~0.2.6", | ||
"layout": "~1.3.0" | ||
"layout": "~2.0.0" | ||
}, | ||
@@ -22,0 +22,0 @@ "devDependencies": { |
@@ -40,2 +40,3 @@ # Spritesmith [](https://travis-ci.org/Ensighten/spritesmith) | ||
* @param {Mixed} [params.engineOpts] Options to pass through to engine for settings | ||
* @param {Mixed} [params.algorithmOpts] Options to pass through to algorithm for layout | ||
* @param {Mixed} [params.exportOpts] Options to pass through to engine for export | ||
@@ -84,2 +85,11 @@ * @param {Function} callback Function that receives compiled spritesheet and map | ||
#### `algorithmOpts` | ||
All algorithms provide the current options: | ||
```js | ||
{ | ||
'sort': false // Stops sorting of images (default for all algorithms) | ||
} | ||
``` | ||
### Adding new engines | ||
@@ -86,0 +96,0 @@ Example engines can be found in [src/engines](tree/master/src/engines). |
@@ -13,6 +13,7 @@ // Load in modules and set up routes | ||
'An array of sprites': function () { | ||
// DEV: These were unsorted for testing `sort: false` but these work for all tests as is =D | ||
this.sprites = [ | ||
path.join(spriteDir, 'sprite1.png'), | ||
path.join(spriteDir, 'sprite2.jpg'), | ||
path.join(spriteDir, 'sprite3.png') | ||
path.join(spriteDir, 'sprite3.png'), | ||
path.join(spriteDir, 'sprite2.jpg') | ||
]; | ||
@@ -59,2 +60,6 @@ | ||
}, 'when processed via spritesmith'], | ||
'when told not to sort': [function () { | ||
this.namespace = 'unsorted.'; | ||
this.options = {'algorithm': 'top-down', 'algorithmOpts': {'sort': false}}; | ||
}, 'when processed via spritesmith'], | ||
@@ -80,2 +85,3 @@ // Engine-specific setups | ||
'renders a padded spritesheet': 'assertSpritesheet', | ||
'renders an unsorted spritesheet': 'assertSpritesheet', | ||
'has the proper coordinates': 'assertCoordinates', | ||
@@ -82,0 +88,0 @@ 'has the proper properties': 'assertProps', |
@@ -21,2 +21,8 @@ // Generate basic outlines | ||
] | ||
}, { | ||
'when told not to sort': [ | ||
'renders an unsorted spritesheet', | ||
'has the proper coordinates', | ||
'has the proper properties' | ||
] | ||
}] | ||
@@ -23,0 +29,0 @@ }, { |
@@ -50,3 +50,3 @@ var async = require('async'), | ||
var engineSmith = new EngineSmith(engine), | ||
layer = new Layout(algorithmPref), | ||
layer = new Layout(algorithmPref, params.algorithmOpts), | ||
padding = params.padding || 0, | ||
@@ -53,0 +53,0 @@ exportOpts = params.exportOpts || {}, |
389433
38
576
179
+ Addedlayout@2.0.2(transitive)
- Removedlayout@1.3.2(transitive)
Updatedlayout@~2.0.0