lights FAQ Forum github.com/luapower/ui
ui

GUI
ui WIP
codedit WIP

ui

extensible UI toolkit


Work in Progress

local ui = require'ui'

Extensible UI toolkit written in Lua with layouts, styles and animations.

Features:

  • layouts: constraint-based, container-based and typesetting
  • cascading styles
  • animations based on tweens and timelines
  • layers
  • extensible

API

ui
ui() -> ui create a new UI module with its own stylesheet
selectors
ui:find(sel) -> el find elements based on a selector
el:each(f) call f for each element
ui:each(sel, f) find elements and run f for each element
styles
ui:style(sel, attrs) create a style
windows
ui:window(win_t) -> window create a new UI state for a window
win_t.window nw-like window to bind to
window:free() detach the UI state from the window
layers
window.hot_layer hot element: mouse is over it
elements
e{id}
e{parent}
e{tags}
e.tags -> {tag->true, tag,...} tags table (both as array and as keys)
e:settag(tag[, i][, op]) add/remove/move tag
extending
ui.object the base class of all other classes
ui.element the base class for all widgets
ui:draw() draw the UI (called on window's repaint.ui)
ui:mousemove(x, y) mouse moved (called on window's mousemove.ui)
ui.selector the element selector class
ui.stylesheet the stylsheet class
ui.element_index
ui.element_list

Last updated: 2 months ago | Edit on GitHub

Pkg type:Lua+ffi
Version: dev-68-g9510c07
Last commit:
License: PD
Requires: +amoeba  +box2d  +cairo  +color  +easing  +freetype  +fs  +gfonts  +glue  +libjpeg  +oo  +time  +tuple  +luajit  +path  +pp 
Required by: none

Top