From 81ec1a6509b0f349c145dd1b4d40029d141cbd6e Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 11 Sep 2017 19:22:18 +0200 Subject: Debug drawing changed to use new Camera properly --- not/PhysicalBody.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'not/PhysicalBody.lua') diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua index 804c706..c9b7300 100644 --- a/not/PhysicalBody.lua +++ b/not/PhysicalBody.lua @@ -77,7 +77,8 @@ function PhysicalBody:draw (offset_x, offset_y, scale, debug) if category == 3 then love.graphics.setColor(137, 0, 255, 40) end - love.graphics.polygon("fill", self.world.camera:translatePoints(self.body:getWorldPoints(fixture:getShape():getPoints()))) + local camera = self.world.camera + love.graphics.polygon("fill", camera:scalePoints(self.body:getWorldPoints(fixture:getShape():getPoints()))) end end end -- cgit v1.1 From 20eb4aa0ecd165b727cbb5bb3f3a7aad6a49ebce Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 12 Sep 2017 01:53:03 +0200 Subject: Draw debugging utilities using scaled camera --- not/PhysicalBody.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'not/PhysicalBody.lua') diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua index c9b7300..1b2e90d 100644 --- a/not/PhysicalBody.lua +++ b/not/PhysicalBody.lua @@ -78,7 +78,7 @@ function PhysicalBody:draw (offset_x, offset_y, scale, debug) love.graphics.setColor(137, 0, 255, 40) end local camera = self.world.camera - love.graphics.polygon("fill", camera:scalePoints(self.body:getWorldPoints(fixture:getShape():getPoints()))) + love.graphics.polygon("fill", self.body:getWorldPoints(fixture:getShape():getPoints())) end end end -- cgit v1.1 From c201bef4950138bd8c475d9b8cd1c26e0615145a Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 12 Sep 2017 19:27:32 +0200 Subject: Removed obsolete offsets and scale from draw of Sprites and children --- not/PhysicalBody.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'not/PhysicalBody.lua') diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua index 1b2e90d..01a725b 100644 --- a/not/PhysicalBody.lua +++ b/not/PhysicalBody.lua @@ -63,8 +63,8 @@ function PhysicalBody:update (dt) end -- Draw of `PhysicalBody`. -function PhysicalBody:draw (offset_x, offset_y, scale, debug) - PhysicalBody.__super.draw(self, offset_x, offset_y, scale) +function PhysicalBody:draw (debug) + PhysicalBody.__super.draw(self, debug) if debug then for _,fixture in pairs(self.body:getFixtureList()) do local category = fixture:getCategory() -- cgit v1.1 From 5b69916da9b58818da16841a0213716c55b3f07a Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 21 Sep 2017 17:51:03 +0200 Subject: Debug drawing for Traps --- not/PhysicalBody.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'not/PhysicalBody.lua') diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua index 01a725b..5081836 100644 --- a/not/PhysicalBody.lua +++ b/not/PhysicalBody.lua @@ -62,20 +62,27 @@ function PhysicalBody:update (dt) PhysicalBody.__super.update(self, dt) end --- Draw of `PhysicalBody`. function PhysicalBody:draw (debug) PhysicalBody.__super.draw(self, debug) if debug then for _,fixture in pairs(self.body:getFixtureList()) do local category = fixture:getCategory() + -- TODO: Fixture drawing of PhysicalBodies could take activity into account in every case. if category == 1 then - love.graphics.setColor(255, 69, 0, 140) + love.graphics.setColor(255, 69, 0, 150) end if category == 2 then - love.graphics.setColor(137, 255, 0, 120) + love.graphics.setColor(137, 255, 0, 150) end if category == 3 then - love.graphics.setColor(137, 0, 255, 40) + love.graphics.setColor(137, 0, 255, 50) + end + if category == 4 then + if self.body:isActive() then + love.graphics.setColor(255, 230, 0, 50) + else + love.graphics.setColor(255, 230, 0, 10) + end end local camera = self.world.camera love.graphics.polygon("fill", self.body:getWorldPoints(fixture:getShape():getPoints())) -- cgit v1.1