about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-01 21:55:57 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-01 21:56:08 -0700
commit51eb86c6736850b0b6699906dc06337aba42b250 (patch)
tree91ec8d9ea8a4ed37ca872aea8c27f32eac696bd3 /main.lua
parent36a1e1789677dbdb2497f0ba8022c2561792d5fc (diff)
downloadview.love-51eb86c6736850b0b6699906dc06337aba42b250.tar.gz
love2d scaffold
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/main.lua b/main.lua
new file mode 100644
index 0000000..12b569e
--- /dev/null
+++ b/main.lua
@@ -0,0 +1,37 @@
+lines = {}
+width, height, flags = 0, 0, nil
+
+function love.load()
+  table.insert(lines, '')
+  love.window.setMode(0, 0)  -- maximize
+  width, height, flags = love.window.getMode()
+end
+
+function love.draw()
+  love.graphics.setColor(1, 1, 1)
+  love.graphics.rectangle('fill', 1, 1, width-1, height-1)
+  love.graphics.setColor(0, 0, 0)
+  for i, line in ipairs(lines) do
+    love.graphics.print(line, 12, i*12)
+  end
+end
+
+function love.update(dt)
+end
+
+function love.keypressed(key, scancode, isrepeat)
+  if key == 'return' then
+    table.insert(lines, '')
+  else
+    lines[#lines] = lines[#lines]..key
+  end
+end
+
+function love.keyreleased(key, scancode)
+end
+
+function love.mousepressed(x, y, button)
+end
+
+function love.mousereleased(x, y, button)
+end