-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
48 lines (37 loc) · 787 Bytes
/
main.lua
File metadata and controls
48 lines (37 loc) · 787 Bytes
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
Editor = require("Editor")
Colors = require("Colors")
PI = math.pi
local Defaults =
{
Mode = "cartesian",
Color = Colors.Black,
Background = Colors.White,
Scale = 50,
}
function love.load()
Editor.Initialize(Defaults)
end
function love.update()
Editor.ComputeAllGraphs()
Editor.ComputeAllCOMs()
Editor.ManageOriginPanning()
Editor.ManageZoom()
end
function love.draw()
Editor.DrawHud()
Editor.DrawAxes()
Editor.PlotAllGraphs()
Editor.PlotAllCOMs()
end
function love.keypressed(key)
local is_ctrl_down = love.keyboard.isDown("rctrl", "lctrl")
if key == "return" and is_ctrl_down then
debug.debug()
end
if key == "m" and is_ctrl_down then
Editor.ChangeMode()
end
if key == "kp0" or key == "0" then
Editor.Scale = Defaults.Scale
end
end