summaryrefslogtreecommitdiffhomepage
path: root/config/menumain.lua
blob: 2ca2c5924bdb90995ec4d5b68af63e78ec5a11fe (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
local menu = ...

local button = require "button"
local header = require "header"
local element = require "element"

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

return {
	button:new(menu)
		:setText("Start")
		:setPosition(bx, 80)
		:set("active", function (self)
				self.parent:load("menuhost")
			end)
	,
	button:new(menu)
		:setText("Join")
		:setPosition(bx, 96)
		:set("active", function (self)
				self:blink()
			end)
	,
	button:new(menu)
		:setText("Settings")
		:setPosition(bx, 112)
		:set("active", function (self)
				self:blink()
			end)
	,
	button:new(menu)
		:setText("Credits")
		:setPosition(bx, 128)
		:set("active", function (self)
				self:blink()
			end)
	,
	button:new(menu)
		:setText("Exit")
		:setPosition(bx, 144)
		:set("active", love.event.quit)
	,
	element:new(menu)
		:setPosition(width/2, 15)
		:set("draw", function (self, scale) 
				local x,y = self:getPosition()
				love.graphics.setColor(255, 255, 255, 255)
				love.graphics.setFont(Bold)
				love.graphics.print("1", (x-17)*scale, y*scale, 0, scale*2, scale*2, 12)
				love.graphics.print("1", (x+13)*scale, y*scale, 0, scale*2, scale*2, 12)
			end)
	,
	header:new(menu)
		:setText("Roflnauts")
		:setPosition(width/2,40)
	,
}