-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
62 lines (49 loc) · 1.3 KB
/
main.lua
File metadata and controls
62 lines (49 loc) · 1.3 KB
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
59
60
61
62
require("custom_conf")
local nuklear = require("nuklear")
local YoungMeWindow = require("ui.young_me.YoungMeWindow")
local ContextController = require("entities.ContextController")
local data = require("assets.initial_data")
local ctx
local font
local ui
local ymUi
function love.load()
ctx = ContextController:load(data)
font = love.graphics.newFont(data.fontSize)
ui = nuklear.newUI()
local w, h = love.graphics.getDimensions()
ymUi = YoungMeWindow(0, 0, w, h, ctx)
end
function love.update(dt)
ui:frameBegin()
ui:styleSetFont(font)
ymUi:frame(ui)
ui:frameEnd()
end
function love.draw()
ui:draw()
end
function love.keypressed(key, scancode, isrepeat)
if key == "escape" then
love.event.quit()
end
ui:keypressed(key, scancode, isrepeat)
end
function love.keyreleased(key, scancode)
ui:keyreleased(key, scancode)
end
function love.mousemoved(x, y, dx, dy, istouch)
ui:mousemoved(x, y, dx, dy, istouch)
end
function love.mousepressed(x, y, button, istouch, presses)
ui:mousepressed(x, y, button, istouch, presses)
end
function love.mousereleased(x, y, button, istouch, presses)
ui:mousereleased(x, y, button, istouch, presses)
end
function love.textinput(text)
ui:textinput(text)
end
function love.wheelmoved(x, y)
ui:wheelmoved(x, y)
end