Test SaveFile with slice parameter

This commit is contained in:
David Capello 2022-06-14 10:58:14 -03:00
parent 96c4f703d0
commit 1caeee9ace

View File

@ -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