Merge branch 'posva-master' into feature-add-tests

This commit is contained in:
jdescottes 2014-08-26 22:46:33 +02:00
commit 1a8f10c63d
3 changed files with 16 additions and 6 deletions

View file

@ -38,6 +38,10 @@ Piskel supports the following browsers :
We don't plan/want/could be forced into supporting older IEs. For Opera and Safari, we've never tested them but the gap shouldn't be huge.
## Offline version (Windows and MacOS)
Offline builds are available. More details in the [dedicated wiki page](https://github.com/juliandescottes/piskel/wiki/Desktop-applications).
## Built with
The Piskel editor is purely built in **JavaScript, HTML and CSS**. It uses Canvas extensively for displaying all them pretty sprites.

View file

@ -30,7 +30,8 @@
for (var i = 0; i < this.piskelController.getFrameCount(); i++) {
var frame = this.piskelController.getFrameAt(i);
var canvas = this.getFrameAsCanvas_(frame);
var filename = "sprite_" + (i+1) + ".png";
var basename = document.getElementById("zip-file-name").value || "sprite_";
var filename = basename + (i+1) + ".png";
zip.file(filename, pskl.CanvasUtils.getBase64FromCanvas(canvas) + '\n', {base64: true});
}
@ -85,4 +86,4 @@
}
return url;
};
})();
})();

View file

@ -7,11 +7,16 @@
<span class="settings-description">PNG with all frames side by side.</span>
<button type="button" class="button button-primary png-download-button">Download PNG</button>
</div>
<div class="settings-title">
Export as ZIP
</div>
<div class="settings-item">
<span class="settings-description">ZIP with one PNG file per frame.</span>
<div>
<button type="button" class="button button-primary zip-generate-button"/>Download ZIP</button>
<span class="settings-description">ZIP with one PNG file per frame. Name will use the prefix above and append the frame index, ex: sprite_1.png</span>
<div class="settings-item">
<label for="zip-file-name">File prefix:</label>
<input id="zip-file-name" type="text" class="textfield" placeholder="sprite_">
</div>
<button type="button" class="button button-primary zip-generate-button"/>Download ZIP</button>
</div>
<div class="settings-title">
Export to Animated GIF
@ -37,4 +42,4 @@
<span class="gif-export-progress-status"></span>
<div class="gif-export-progress-bar"></div>
</div>
</div>
</div>