glasses.createLayout¶
since 26.1.0
Create a layout.
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
params |
table | yes | see the fields below |
Fields of params:
x(integer): lefty(integer): topw(integer): widthh(integer): heighttext: table with elements:- x (integer): text left
- y (integer): text top
- opacity (integer): text opacity
- font (integer): text font
bitmap: table with elements:- id (unsigned): bitmap ID
- x (integer): bitmap left
- y (integer): bitmap top
border(boolean): layout border
Returns¶
the new layout (GlassesLayout)
Examples¶
From the official Ethos documentation
local function build(context)
context.layout = glasses.createLayout({x=10, y=10, w=100, h=100, bitmap={id=10, x=10, y=10}, text={x=10, y=100}, font=3, border=true})
end
Used in¶
Real-world usage¶
Called 2 times across 2 open-source Ethos Lua projects. A few short excerpts: