canvas speed


Now in LOVE2D when you just starting maybe you need to use canvas for some pixel operations when drawing. But suddenly the speed of drawing is reduced to snail speed and you wonder what happened.

First check if drawing into canvas happens in love.draw. When yes, put it in love.update. This improves the overall speed.

Second, if you see strange artifacts and are using scaling then do it so the scale number increases as integer not as float. This means floor it down 1,2,3,4… and so on. Not 0, not 0.5, not 5.2 etc this makes the surface look artifact uggly.

And that’s all for the tricks and treats for this short halloween special.

Ok. I add some expertise here. Instead of canvas using when the bluring as nearest/linear filter is not needed you can use an image and imagedata that is then replace function applied to the image thus the pixels are really faster copied than using setPixel in canvas.

Leave a comment

Log in with itch.io to leave a comment.