-- It appears that this is the correct way love filesystem require vie

 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
-- It appears that this is the correct way
love.filesystem.require("viewport/viewport.lua")
function load()
width = love.graphics.getWidth()
height = love.graphics.getHeight()
love.graphics.setBackgroundColor(33, 33, 33)
love.graphics.setColor(255, 255, 255)
love.graphics.setFont(love.graphics.newFont(love.default_font, 12))
viewport = Viewport:getInstance()
viewport:setPosition(40, 40)
viewport:init()
mouse_x = 0
mouse_y = 0
end
function update(dt)
mouse_x = love.mouse.getX()
mouse_y = love.mouse.getY()
end
function keypressed(key)
cell = viewport:getCell(1, 1)
cell:setState(1)
end
function draw()
viewport:draw()
love.graphics.draw("(" .. mouse_x .. ", " .. mouse_y .. ")", 330, 50)
end