Added sprite number padding to mergedExport

This commit is contained in:
Matt D 2016-03-23 20:25:22 +11:00
parent 776cf1ec87
commit c7381b771f

View File

@ -58,11 +58,13 @@
};
ns.PngExportController.prototype.mergedExport_ = function (zip) {
var paddingLength = (""+this.piskelController.getFrameCount()).length;
var padding = new Array(paddingLength).join("0");
for (var i = 0; i < this.piskelController.getFrameCount(); i++) {
var frame = this.piskelController.getFrameAt(i);
var canvas = this.getFrameAsCanvas_(frame);
var basename = this.pngFilePrefixInput.value;
var filename = basename + (i + 1) + '.png';
var filename = basename + (padding + (i + 1)).slice(-paddingLength) + '.png';
zip.file(filename, pskl.utils.CanvasUtils.getBase64FromCanvas(canvas) + '\n', {base64: true});
}
};