summaryrefslogtreecommitdiffhomepage
path: root/not/Ray.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-07 05:15:35 +0200
committerAki <nthirtyone@gmail.com>2017-09-07 05:15:35 +0200
commit58e6962593cadd4cfc1dd4028ce3b272814fe3f3 (patch)
tree14af991da26595a4d961acf6f2af7bef4bedb918 /not/Ray.lua
parent41a20f87015d1cc3eaa33e936c9dc1fac19246a9 (diff)
downloadroflnauts-58e6962593cadd4cfc1dd4028ce3b272814fe3f3.zip
roflnauts-58e6962593cadd4cfc1dd4028ce3b272814fe3f3.tar.gz
roflnauts-58e6962593cadd4cfc1dd4028ce3b272814fe3f3.tar.bz2
Initial layering for drawing
Diffstat (limited to 'not/Ray.lua')
-rw-r--r--not/Ray.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/not/Ray.lua b/not/Ray.lua
index 3c80440..536ed05 100644
--- a/not/Ray.lua
+++ b/not/Ray.lua
@@ -26,7 +26,9 @@ function Ray:update (dt)
return false
end
+-- TODO: Whole Ray is dated but `draw` require a lot attention due to layering in World. See `World@new`.
function Ray:draw (offset_x, offset_y, scale)
+ local canvas = love.graphics.getCanvas()
love.graphics.setCanvas(self.canvas)
love.graphics.clear()
love.graphics.setColor(255, 247, 228, 247)
@@ -40,7 +42,7 @@ function Ray:draw (offset_x, offset_y, scale)
end
love.graphics.line(-x+offset_x,-y+offset_y-dy*0.7,x+offset_x,y+dy*0.7+offset_y)
-- reset
- love.graphics.setCanvas()
+ love.graphics.setCanvas(canvas)
love.graphics.setLineWidth(1)
love.graphics.setColor(255,255,255,255)
-- draw on screen