diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-07 05:15:35 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-07 05:15:35 +0200 |
commit | 58e6962593cadd4cfc1dd4028ce3b272814fe3f3 (patch) | |
tree | 14af991da26595a4d961acf6f2af7bef4bedb918 /not/Ray.lua | |
parent | 41a20f87015d1cc3eaa33e936c9dc1fac19246a9 (diff) | |
download | roflnauts-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.lua | 4 |
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 |