add ui module
This commit is contained in:
parent
1744e689b5
commit
6008ebf5ed
12 changed files with 703 additions and 215 deletions
20
demo/ui_demo.fnl
Normal file
20
demo/ui_demo.fnl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
(local pxl8 (require :pxl8))
|
||||
|
||||
(var button-clicks 0)
|
||||
|
||||
(global init (fn []
|
||||
(pxl8.load_palette "palettes/gruvbox.ase")))
|
||||
|
||||
(global update (fn [_dt]))
|
||||
|
||||
(global frame (fn []
|
||||
(pxl8.clr 1)
|
||||
|
||||
(when pxl8.ui
|
||||
(when (pxl8.ui_window_begin "UI Demo" 20 20 280 150)
|
||||
(pxl8.ui_layout_row 1 0 0)
|
||||
(pxl8.ui_label "Welcome to some window UI!")
|
||||
(pxl8.ui_label (.. "Clicks: " button-clicks))
|
||||
(when (pxl8.ui_button "Click me!")
|
||||
(set button-clicks (+ button-clicks 1)))
|
||||
(pxl8.ui_window_end)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue