2023-04-20 00:41:11 +08:00
|
|
|
-- Copyright (C) 2018-2023 Igara Studio S.A.
|
2018-11-04 00:39:43 +08:00
|
|
|
--
|
|
|
|
-- This file is released under the terms of the MIT license.
|
|
|
|
-- Read LICENSE.txt for more information.
|
|
|
|
|
|
|
|
local s = Sprite(32, 64)
|
2023-04-20 00:41:11 +08:00
|
|
|
assert(s == app.sprite)
|
2018-11-04 00:39:43 +08:00
|
|
|
assert(s == app.activeSprite)
|
2018-11-23 01:45:26 +08:00
|
|
|
assert(s == app.site.sprite)
|
2023-04-20 00:41:11 +08:00
|
|
|
assert(s == app.frame.sprite)
|
2018-11-04 00:39:43 +08:00
|
|
|
assert(s == app.activeFrame.sprite)
|
2018-11-23 01:45:26 +08:00
|
|
|
assert(s == app.site.frame.sprite)
|
2018-11-04 00:39:43 +08:00
|
|
|
assert(1 == app.activeFrame.frameNumber)
|
2018-11-23 01:45:26 +08:00
|
|
|
assert(1 == app.site.frame.frameNumber)
|
2018-11-23 02:05:03 +08:00
|
|
|
assert(1 == app.site.frameNumber)
|
2018-11-04 00:39:43 +08:00
|
|
|
assert(0.100 == app.activeFrame.duration) -- Default frame duration
|
2018-11-23 01:45:26 +08:00
|
|
|
assert(0.100 == app.site.frame.duration)
|
2023-04-20 00:41:11 +08:00
|
|
|
assert(s == app.layer.sprite)
|
2019-04-14 03:30:58 +08:00
|
|
|
assert(s == app.activeLayer.sprite)
|
|
|
|
assert(s == app.site.layer.sprite)
|
2023-04-20 00:41:11 +08:00
|
|
|
assert(s == app.cel.sprite)
|
2019-04-14 03:30:58 +08:00
|
|
|
assert(s == app.activeCel.sprite)
|
|
|
|
assert(s == app.site.cel.sprite)
|
|
|
|
|
2023-04-20 00:41:11 +08:00
|
|
|
app.frame.duration = 0.8
|
2018-11-04 00:39:43 +08:00
|
|
|
|
2019-04-14 03:30:58 +08:00
|
|
|
app.command.NewFrame()
|
2023-04-20 00:41:11 +08:00
|
|
|
assert(2 == app.frame.frameNumber)
|
|
|
|
assert(0.8 == app.frame.duration) -- Copy frame duration of previous frame
|