diff options
Diffstat (limited to 'not')
-rw-r--r-- | not/Layer.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/not/Layer.lua b/not/Layer.lua index 63c38ac..126b402 100644 --- a/not/Layer.lua +++ b/not/Layer.lua @@ -17,12 +17,16 @@ function Layer:setAsCanvas () return c end -function Layer:clear () +function Layer:renderTo (func, ...) local c = self:setAsCanvas() - love.graphics.clear() + func(...) love.graphics.setCanvas(c) end +function Layer:clear () + self:renderTo(love.graphics.clear) +end + function Layer:draw () love.graphics.setColor(255, 255, 255, 255) love.graphics.draw(self.canvas) |