Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this .
IndieLöver
Prole
Posts: 29 Joined: Mon Jun 10, 2013 8:49 am
Post
by IndieLöver » Mon Jul 21, 2014 8:00 pm
Hi fellow lövers,
I was just wondering can one copy canvases?
Obviously that doesn't work, because now the oldCanvas just refers to the mainCanvas. And as far as I know canvases don't have :clone() function like particleEffects do.
Thanks,
IndieLöver
Joemag
Prole
Posts: 24 Joined: Sun Apr 14, 2013 5:42 pm
Post
by Joemag » Mon Jul 21, 2014 9:21 pm
You can create a new canvas and render the old canvas in it:
Code: Select all
local oldCanvas = love.graphics.newCanvas(mainCanvas:getDimensions())
oldCanvas:renderTo(function()
love.graphics.setColor(255,255,255)
love.graphics.draw(mainCanvas, 0, 0)
end)
IndieLöver
Prole
Posts: 29 Joined: Mon Jun 10, 2013 8:49 am
Post
by IndieLöver » Tue Jul 22, 2014 4:45 am
Thanks Joemag. It's amazing how fast people respond here. I löve this community
Users browsing this forum: Bing [Bot] and 1 guest