When I make a sprite, I usually like exporting it in 100%, 200% 300% and 400% size for ease of use and visibility. I made a simple script for that.
for i = 1,4,1 do
local fn = path .. '/' .. title .. '-' .. i .. 'x'
filename=fn .. '.png'
… But the “scale” parameter seems to do nothing at all, no matter what I set the value at. I’ve checked this out, so I know there is a parameter called
scale and its default value is
1.0, but setting it to, for example,
2.0, seems to do nothing.
Throw me a bone, please? Much appreciated.
Welcome aboard! I tried this out:
local activeSprite = app.activeSprite
if not activeSprite then return end
local activeFrame = app.activeFrame
local palette = activeSprite.palettes
local blit = Image(activeSprite.spec)
local path = "mypath\\"
local title = "blah"
local format = ".png"
for i = 1, 4, 1 do
local scaled = blit:clone()
width = scaled.width * i,
height = scaled.height * i
filename = path .. title .. i .. format,
palette = palette
I try to avoid commands whenever possible for reasons like this.
(Obviously there’s inefficiency in the script above, since there’s no need clone and scale an image by 1x, but you get the point.)
This does work, and I’m very grateful for your answer! But I’m still a bit irked as to why the scale parameter doesn’t work… I should change the thread title.
Once again, thanks for the help, the script works wonders.
If you’d like to pursue the bug further, what version of Aseprite are you using? I tried
app.command.SaveFileCopyAs in 1.3-beta20 and the results were scaled properly. In 1.2.35 they weren’t. There might be a clue in the commit history for the source code you linked above.
Anwho, glad I could help you some.
I’m using 1.3-beta16. I’m updating to 1.3-beta20 as I type this post… Annnnd it works. Wild.
Case closed, everybody! Great job.