Add detailed comments to AnimationNode explaining its behavior and usage
example
This commit is contained in:
parent
f790a4dcf8
commit
70d1d72b83
@ -1,6 +1,26 @@
|
|||||||
--- @alias voidCallback fun(): nil
|
--- @alias voidCallback fun(): nil
|
||||||
--- @alias animationRunner fun(node: AnimationNode)
|
--- @alias animationRunner fun(node: AnimationNode)
|
||||||
|
|
||||||
|
--- Узел дерева анимаций.
|
||||||
|
---
|
||||||
|
--- Отслеживает завершение всех анимаций всех дочерних узлов и оповещает вышестоящий узел.
|
||||||
|
---
|
||||||
|
--- Дочерние узлы одного уровня запускают свою анимацию одновременно после завершения анимации родителя.
|
||||||
|
--- Example:
|
||||||
|
--- ```lua
|
||||||
|
--- AnimationNode {
|
||||||
|
--- function (node) residentsleeper:sleep(1000, node) end, -- must pass itself down as the parameter
|
||||||
|
--- onEnd = function() print("completed") end,
|
||||||
|
--- children = { -- children run in parallel after the parent animation is completed
|
||||||
|
--- AnimationNode {
|
||||||
|
--- function (node) sprite:animate("attack", node) end
|
||||||
|
--- },
|
||||||
|
--- AnimationNode {
|
||||||
|
--- function (node) other_sprite:animate("hurt", node) end
|
||||||
|
--- },
|
||||||
|
--- }
|
||||||
|
--- }:run()
|
||||||
|
--- ```
|
||||||
--- @class AnimationNode
|
--- @class AnimationNode
|
||||||
--- @field count integer
|
--- @field count integer
|
||||||
--- @field run animationRunner
|
--- @field run animationRunner
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user