Skip to content

system.registerLayout

since 1.5.8

Register a Lua Layout.

system.registerLayout(params)

Parameters

Name Type Required Description
params table yes see the fields below

Fields of params:

  • key (string): unique key, with 7 chars max
  • widgets (table of rect, optional): layout widgets slots
  • trims (table of rect, optional): layout trims slots
  • pots (table of rect, optional): layout pots slots

Returns

Nothing.

Examples

From the official Ethos documentation
local function init()
    system.registerLayout({key="foo", widgets={
      {x=10, y=10, w=100, h=100},
      {x=120, y=120, w=100, h=100}}
    })
end

return {init=init}

Used in

Real-world usage

Called 1 times across 1 open-source Ethos Lua project. A few short excerpts:
local function init()
  system.registerLayout({key="XL+3", widgets={
    {x=8, y=95, w=784, h=248},
    {x=8, y=351, w=256, h=56},
    {x=272, y=351, w=256, h=56},
    {x=536, y=351, w=256, h=56}
  }})
end

lua/frsky/Layout1P3/main.lua:3