Page 1 of 1

canvas and not functioning properly?

Posted: Tue Jul 28, 2015 5:35 pm
by immakinggames
In love.draw()

Code: Select all, 10)

randomCanvas =
why is it such that drawing randomCanvas doesn't translate? Only drawing the image directly translates things, and that seems really weird.

Re: canvas and not functioning prope

Posted: Tue Jul 28, 2015 9:03 pm
by DekuJuice
First off, you should not be calling from love.draw, just call it once and store it somewhere so you can reuse it later.

I'm not completely sure that I understand your issue, but from what I see:
immakinggames wrote:

Code: Select all, 10)

randomCanvas = --Since the translation is in effect, the image is being drawn at 10,10 --The translation is still in effect, meaning the canvas itself is drawn at 10,10, and the image drawn onto it is now at 20,20 --Draws the image at 10,10
When you're drawing to randomCanvas, the image is being translated twice, and when you're drawing it directly, it's only being translated once.