-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuttons.lua
41 lines (30 loc) · 956 Bytes
/
buttons.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
local widget = require('widget')
local glo = require('globals')
local screen = glo.screen
-- Buttons displays buttons to the screen that when pressed perform some action.
-- Define padding between the button and the screen wall dimension.
local Buttons = {
yPadding = 10,
xPadding = 10
}
-- Define left arrow button
Buttons.left_arrow = widget.newButton(
{
width = 50,
height = 50,
defaultFile = "assets/left_arrow.png",
}
)
Buttons.left_arrow.y = screen.yMax - Buttons.left_arrow.height / 2 - Buttons.yPadding
Buttons.left_arrow.x = Buttons.xPadding + Buttons.left_arrow.width / 2
-- Define right arrow button
Buttons.right_arrow = widget.newButton(
{
width = 50,
height = 50,
defaultFile = "assets/right_arrow.png",
}
)
Buttons.right_arrow.y = screen.yMax - Buttons.right_arrow.height / 2 - Buttons.yPadding
Buttons.right_arrow.x = Buttons.right_arrow.width * 2
return Buttons;