Right now there’s no documentation on how everything works, but you can take a look at the existing plugins. Their overall structure is always the same. You’ll need a tile.lua file within your plugin. It gets automatically loaded once the setup is activated on a device:
local api, CHILDS, CONTENTS = ...
local M = {}
function M.updated_config_json(config)
--[[
Called when the local config.json is updated. This happens if the
user edits any value within the plugin's editor tab within the setup.
If you have a configuration option like this in the local node.json
you can use api.localized to get the correct full path name:
{
"title": "Font",
"name": "font",
"type": "font",
"default": "default-font.ttf"
}
]]--
pp(config)
font = resource.load_font(api.localized(config.font.asset_name))
end
function M.task(starts, ends, config, x1, y1, x2, y2)
--[[
Called when a plugin is added within a page and that page
is about to get activated. The function is executed as a coroutine
and you must yield after drawing your content. The helper function
api.frame_between automatically does that and "loops" while your
plugin should show content on the screen.
]]--
for now in api.frame_between(starts, ends) do
print("draw something within", x1, y1, x2, y2)
end
end
return M