Add Sprite:flatten()

This commit is contained in:
David Capello 2019-04-17 15:04:25 -03:00
parent de9f8beed9
commit ea4f6ce957

View File

@ -62,3 +62,15 @@ do
assert(a.palettes[1]:getColor(1) == Color(0, 255, 0))
assert(a.palettes[1]:getColor(2) == Color(0, 0, 255))
end
-- Flatten
do
local a = Sprite(32, 32)
a:newLayer()
a:newLayer()
assert(#a.layers == 3)
a:flatten()
assert(#a.layers == 1)
end