summaryrefslogtreecommitdiffhomepage
path: root/config/menumain.lua
blob: def1ab78e64edeee1f917560ae3404e6ea1ab443 (plain)
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
42
43
44
local menu = ...

local button = require "button"

local width, height = love.graphics.getWidth()/getRealScale(), love.graphics.getHeight()/getRealScale()
local button_x = width/2-29

return {
	button:new(menu)
		:setText("start")
		:setPosition(button_x,60)
		:set("active", function (self)
				self.parent:load("menustart")
			end)
	,
	button:new(menu)
		:setText("join")
		:setPosition(button_x,76)
	,
	button:new(menu)
		:setText("settings")
		:setPosition(button_x,92)
	,
	button:new(menu)
		:setText("credits")
		:setPosition(button_x,108)
	,
	button:new(menu)
		:setText("exit")
		:setPosition(button_x,124)
		:set("active", love.event.quit)
	,
	button:new(menu)
		:setText("NEVER")
		:setPosition(button_x,140)
		:set("focus", function (self, next)
				if next then
					self.parent:next()
				else
					self.parent:previous()
				end
			end)
	,
}