diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-12 03:34:23 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-12 03:34:23 +0200 |
commit | 9e29f6127fc27e58a5680a8aa6bea7336add4755 (patch) | |
tree | 3d71934a4a8daf61a97de5c901d6401a7084db21 /not/World.lua | |
parent | 2b2c4b06ec483e02bda201548ab89a6d0d116c19 (diff) | |
download | roflnauts-9e29f6127fc27e58a5680a8aa6bea7336add4755.zip roflnauts-9e29f6127fc27e58a5680a8aa6bea7336add4755.tar.gz roflnauts-9e29f6127fc27e58a5680a8aa6bea7336add4755.tar.bz2 |
Added renderToWith to shorten using Camera with Layers
Diffstat (limited to 'not/World.lua')
-rw-r--r-- | not/World.lua | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/not/World.lua b/not/World.lua index 37b6dbe..d7b69b2 100644 --- a/not/World.lua +++ b/not/World.lua @@ -260,18 +260,10 @@ function World:draw () -- TODO: Camera rewrite in progress. for _,entity in pairs(self.entities) do if entity.draw and entity.layer then - self.camera:push() - self.camera:scale(entity.layer.scale) - self.camera:translate(entity.layer.ratio) - entity.layer:renderTo(entity.draw, entity, 0, 0, 1, debug) -- TODO: Offsets and Scale are passed as 0,0,1 in World@draw for compatibility reasons. Remove them. - self.camera:pop() + entity.layer:renderToWith(self.camera, entity.draw, entity, 0, 0, 1, debug) -- TODO: Offsets and Scale are passed as 0,0,1 in World@draw for compatibility reasons. Remove them. end if entity.drawTag then - self.camera:push() - self.camera:scale() - self.camera:translate() - self.layers[6]:renderTo(entity.drawTag, entity, 0, 0, 1) -- TODO: Offsets and Scale passed. See `World@draw`. - self.camera:pop() + self.layers[6]:renderToWith(self.camera, entity.drawTag, entity, 0, 0, 1) -- TODO: Offsets and Scale passed. See `World@draw`. end end |