-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
58 lines (45 loc) · 1.15 KB
/
Copy pathmain.lua
File metadata and controls
58 lines (45 loc) · 1.15 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
local gui
function love.load()
io.stdout:setvbuf("no")
love.filesystem.setRequirePath(love.filesystem.getRequirePath() .. ";src/?.lua;src/?/init.lua")
love.keyboard.setKeyRepeat(true)
gui = require("init").hook()
gui.loadExternalObjects("classes/objects")
gui.getCanvas().layout.growth = "horizontal"
gui.getCanvas().layout.padding[2] = 80
local box1 = gui.Image{w = "fill", h = "fill", image = love.graphics.newImage("test.png"), display = "limit"}
local box2 = gui.Container{w = "fill", h = "fill"}
local left_container = gui.Container{
w = 300,
h = "fill",
padding = {0, 100, 0, 50},
growth = "vertical",
gap = 0
}
left_container:add(box1)
left_container:add(box2)
local main_container = gui.Container{
w = "fill",
h = "fill",
growth = "vertical",
horizontal = "right",
vertical = "top",
colors = {
fill = {0.5, 0, 0, 0.5},
border = {0.5, 0.5, 1, 0.5}
},
border_size = 10,
r = 40
}
gui.add(left_container)
gui.add(main_container)
end
totaldt = 0
function love.update(dt)
totaldt = totaldt + dt*5
end
function love.draw()
gui.drawMousePosition()
end
function love.keypressed(key)
end