adds very simple proof of concept buttons

This commit is contained in:
duncathan 2019-09-10 04:46:45 -06:00
parent 9bdb928668
commit ac8015b2f0
3 changed files with 56 additions and 0 deletions

View file

@ -8,6 +8,9 @@ local status
local C = Class:extend()
local layout = Luigi(require 'layout')
layout:setStyle(require 'style')
function C:setup()
Terebi.initializeLoveDefaults()
screen = Terebi.newScreen(320, 240, 2)
@ -38,6 +41,7 @@ end
function C:draw()
screen:draw(_draw)
layout:show()
end
function C:setStatus(text)

44
src/layout.lua Normal file
View file

@ -0,0 +1,44 @@
return { id = 'window',
{ flow = 'y',
{ height = 360 },
{ flow = 'x',
{ width = false },
{
type = 'button',
id = 'exampleButton',
text = 'Press me!',
width = 100,
height = 32,
},
{
type = 'button',
id = 'exampleButton2',
text = 'Press me',
width = 100,
height = 32,
},
{
type = 'button',
id = 'exampleButton3',
text = 'Press me',
width = 100,
height = 32,
},
{
type = 'button',
id = 'exampleButton4',
text = 'Press me',
width = 100,
height = 32,
},
{
type = 'button',
id = 'exampleButton5',
text = 'Press me',
width = 100,
height = 32,
},
{ width = false }
}
}
}

8
src/style.lua Normal file
View file

@ -0,0 +1,8 @@
return {
panel = {
background = {0,0,0,0}
},
button = {
align = 'centre middle'
}
}