Last active
February 9, 2021 12:08
-
-
Save dacap/e7d85ebd2de17eb31509e926af14e9a5 to your computer and use it in GitHub Desktop.
Export a sprite sheet keeping the background opaque for indexed sprites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local spr = app.activeSprite | |
if not spr then return print("No active sprite") end | |
app.command.ExportSpriteSheet() | |
if app.activeSprite ~= spr and | |
spr.backgroundLayer and | |
spr.colorMode == ColorMode.INDEXED then | |
local oldColor = app.bgColor | |
app.bgColor = Color(spr.transparentColor) | |
app.command.BackgroundFromLayer() | |
app.bgColor = oldColor | |
app.command.SaveFile() | |
app.command.CloseFile() | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment