Commands
Commands

editor.action.model
M.commands = {
action = {
play = {_trigger = ""},
playAll = {actions = {}, random = true},
},
animation = {
pause = {_target = ""},
resume = {_target = ""},
play = {_target = ""},
playAll = { animations = {}}
},
audio = {
record = {
duration = 0,
mmFile = "",
malfa = "",
audiotype = ""
},
muteUnmute = {
_target = {}
},
play = {
_target = "",
type = "",
channel = "",
repeatable = "",
delay = "",
loop = "",
fade = "",
volume = "",
tm = "", -- timer id
_trigger = "",
},
rewind = {
_target = "",
type = "",
channel = "",
repeatable = "",
},
...
template/commands/pageX/actionX.lua
local ActionCommand = {}
local AC = require("commands.kwik.actionCommand")
---
function ActionCommand:new()
local command = {}
--
function command:execute(params)
local UI = params.UI
local sceneGroup = UI.scene.view
local layers = UI.layers
local obj = params.obj
{{#actions}}
{{#animation}}
--
-- target layer :sceneGroup[layerName]
-- target animation : layer.animations[index]
--
{{#pause}}
AC.Animation:pause("{{target}}")
{{/pause}}
{{#resume}}
AC.Animation:resume("{{target}}")
{{/resume}}
{{#play}}
AC.Animation:play("{{target}}", {{index}})
{{/play}}
{{/animation}}
{{#button}}
{{#onOff}}
AC.Button:onOff("{{target}}", {{enable}}, {{toggle}} ) -- enable, toggle
{{/onOff}}
{{/button}}
{{/actions}}
end
return setmetatable( command, {__index=AC})
end
commands.kwik.actionCommand
animationAction.lua
local M = {}
--
function _M:pause(anim)
end
--
function _M:resume(anim)
end
--
function _M:play(anim)
end
--
return _M