summaryrefslogtreecommitdiffhomepage
path: root/not/World.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-13 10:00:59 +0200
committerAki <nthirtyone@gmail.com>2017-09-13 10:00:59 +0200
commit2a0cef0fba687e03fd322ac73c511bbb12b1e31c (patch)
treebd432a8a616152994dbef9ef56a3190233ada0ac /not/World.lua
parent914049749fc9f6f86b9ba22d5b74a173a2c8a3bc (diff)
downloadroflnauts-2a0cef0fba687e03fd322ac73c511bbb12b1e31c.zip
roflnauts-2a0cef0fba687e03fd322ac73c511bbb12b1e31c.tar.gz
roflnauts-2a0cef0fba687e03fd322ac73c511bbb12b1e31c.tar.bz2
Fixed background bug on non-16:9 screens
Diffstat (limited to 'not/World.lua')
-rw-r--r--not/World.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/not/World.lua b/not/World.lua
index 5392e18..e3b7695 100644
--- a/not/World.lua
+++ b/not/World.lua
@@ -76,6 +76,7 @@ end
--- Builds map using one of tables frin config files located in `config/maps/` directory.
-- TODO: Clean World@buildMap. Possibly explode into more methods.
+-- TODO: ScaledLayers and RealScaledLayers should be implemented properly with good Camera support.
function World:buildMap ()
for _,op in pairs(self.map.create) do
if op.platform then
@@ -98,7 +99,13 @@ function World:buildMap ()
width = width * getScale()
height = height * getScale()
end
- bg.layer = self:addLayer(width, height, op.ratio)
+ bg.layer = self:addLayer(width, height, op.ratio, getRealScale())
+ print("ayyy", getScale(), getRealScale())
+ print("lmao", x, y)
+ bg.layer.draw = function (self)
+ love.graphics.setColor(255, 255, 255, 255)
+ love.graphics.draw(self.canvas)
+ end
end
if op.clouds then
local width, height = love.graphics.getDimensions()
@@ -313,7 +320,7 @@ function World:draw ()
layer:draw()
layer:clear()
end
-
+
-- TODO: Debug information could possibly get its own layer so it could follow flow of draw method.
if debug then
local center = self.map.center