-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.lua
More file actions
46 lines (35 loc) · 1 KB
/
main.lua
File metadata and controls
46 lines (35 loc) · 1 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
local nest = require("nest").init({ console = "3ds" })
local rect = { w = 200, h = 120 }
function love.load()
end
local function screen_depth(screen)
if not love.graphics.getDepth then return 0 end
local depth = screen ~= "bottom" and -love.graphics.getDepth() or 0
if screen == "right" then
depth = -depth
end
return depth
end
function love.draw(screen)
local x = (love.graphics.getWidth() - rect.w) * 0.5
local y = (love.graphics.getHeight() - rect.h) * 0.5
local depth = screen_depth(screen)
love.graphics.rectangle("fill", x - (depth * 6), y, rect.w, rect.h)
end
function love.gamepadpressed(_, button)
if button == "a" then
nest.plug_in()
end
end
function love.gamepadaxis(_, axis, value)
print(axis, value)
end
function love.touchpressed(id, x, y, dx, dy, pressure)
print(x, y)
end
function love.touchmoved(id, x, y, dx, dy, pressure)
print(x, y, dx, dy)
end
function love.touchreleased(id, x, y, dx, dy, pressure)
print(x, y)
end