From 1caeee9aceaac470db75b62b2385804f061b7f6d Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 14 Jun 2022 10:58:14 -0300 Subject: [PATCH] Test SaveFile with slice parameter --- scripts/save_file_command.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/save_file_command.lua b/scripts/save_file_command.lua index a8b50efb8..04529e937 100644 --- a/scripts/save_file_command.lua +++ b/scripts/save_file_command.lua @@ -5,13 +5,23 @@ do local spr = Sprite(32, 32) - spr.filename = "_test_a.png" + app.useTool{ color=Color(255, 255, 255), brush=Brush(1), + tool="filled_ellipse", points={{0,0},{31,31}} } + spr.filename = "_test_a.aseprite" app.command.SaveFile() - assert(spr.filename == "_test_a.png") + assert(spr.filename == "_test_a.aseprite") app.command.SaveFileAs{ filename="_test_b.png" } assert(spr.filename == "_test_b.png") app.command.SaveFileCopyAs{ filename="_test_c.png" } assert(spr.filename == "_test_b.png") + + -- Slices + local slice = spr:newSlice(Rectangle(1, 2, 8, 15)) + slice.name = "small_slice" + app.command.SaveFileCopyAs{ filename="_test_c_small_slice.png", slice="small_slice" } + local c = app.open("_test_c_small_slice.png") + assert(c.width == 8) + assert(c.height == 15) end