summaryrefslogtreecommitdiffhomepage
path: root/not/World.lua
diff options
context:
space:
mode:
Diffstat (limited to 'not/World.lua')
-rw-r--r--not/World.lua19
1 files changed, 14 insertions, 5 deletions
diff --git a/not/World.lua b/not/World.lua
index ae00b48..6aee966 100644
--- a/not/World.lua
+++ b/not/World.lua
@@ -220,11 +220,15 @@ function World:update (dt)
end
function World:draw ()
- local offset_x, offset_y = self.camera:getOffsets()
+ -- TODO: Offests are here to keep compatibility.
+ local offset_x, offset_y = 0, 0
local scale = getScale()
local scaler = getRealScale()
-- TODO: Prototype of layering. See `World@new`.
+ -- TODO: Camera rewrite in progress.
+ self.camera:translate()
+
for _,entity in pairs(self.entities) do
if entity:is(Decoration) then
if entity.layer == 1 then
@@ -248,12 +252,21 @@ function World:draw ()
entity:draw(offset_x, offset_y, scale, debug)
end
+ self.camera:pop()
love.graphics.setCanvas()
+
for _,layer in ipairs(self.layers) do
layer:draw()
layer:clear()
end
+ -- TODO: Just move heroes' tags to front layer.
+ self.camera:translate()
+ for _,naut in pairs(self:getNautsAlive()) do
+ naut:drawTag(offset_x, offset_y, scale)
+ end
+ self.camera:pop()
+
if debug then
local c = self.camera
local w, h = love.graphics.getWidth(), love.graphics.getHeight()
@@ -280,10 +293,6 @@ function World:draw ()
love.graphics.line(x1,y1,x2,y2)
end
- for _,naut in pairs(self:getNautsAlive()) do
- naut:drawTag(offset_x, offset_y, scale)
- end
-
for _,naut in pairs(self:getNautsAll()) do
-- I have no idea where to place them T_T
-- let's do: bottom-left, bottom-right, top-left, top-right