aseprite/scripts/slice.lua
2018-09-11 18:46:35 -03:00

25 lines
563 B
Lua

-- Copyright (C) 2018 David Capello
--
-- This file is released under the terms of the MIT license.
-- Read LICENSE.txt for more information.
do
local s = Sprite(32, 32)
local a = s:newSlice(0, 0, 32, 32)
assert(a.bounds == Rectangle(0, 0, 32, 32))
assert(a.sprite == s)
assert(a.name == "Slice")
a.name = "Slice A"
assert(a.name == "Slice A")
assert(a.center == nil)
a.center = Rectangle(2, 3, 28, 20)
assert(a.center == Rectangle(2, 3, 28, 20))
assert(a.pivot == nil)
a.pivot = Point(16, 17)
assert(a.pivot == Point(16, 17))
end