diff --git a/scripts/app_command.lua b/scripts/app_command.lua index 50c3b30a4..a96a8b420 100644 --- a/scripts/app_command.lua +++ b/scripts/app_command.lua @@ -41,6 +41,21 @@ do -- NewSprite assert(s2.colorMode == ColorMode.INDEXED) end +do -- ExportSpriteSheet + local s = Sprite{ fromFile="sprites/2f-index-3x3.aseprite" } + app.command.ExportSpriteSheet { + type="horizontal", + textureFilename="_test_export_spritesheet1.png", + shapePadding=1 + } + local i = Image{ fromFile="_test_export_spritesheet1.png" } + expect_img(i, { + 11,8,11,21,8,11,11, + 11,8,11,21,11,8,11, + 11,8,11,21,11,11,8, + }) +end + do -- NewLayer/RemoveLayer local s = Sprite(32, 32) assert(#s.layers == 1) diff --git a/sprites/2f-index-3x3.aseprite b/sprites/2f-index-3x3.aseprite new file mode 100644 index 000000000..55d2ce410 Binary files /dev/null and b/sprites/2f-index-3x3.aseprite differ diff --git a/sprites/README.md b/sprites/README.md index d3130d959..14dfd7245 100644 --- a/sprites/README.md +++ b/sprites/README.md @@ -23,3 +23,5 @@ content as in `point4frames.aseprite`. Useful to test if `"sourceSize"` is different when two cels from different sprites are merged in the same texture atlas. +* `2f-index-3x3.aseprite`: Indexed, 2 frames, 1 layer, mask color set + to index 21.