about summary refs log tree commit diff stats
path: root/main.lua
blob: 12b569e48ca4c090c2478a8053a7c263d8e98051 (plain) (blame)
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
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