Page 1 of 1

newCanvas function

Posted: Fri Sep 07, 2018 9:51 pm
by logoliv
hi all,

I try to port a Löve app from 0.10.2 to 11.1 version, I had :
width, height = love.window.getMode()
buffer = love.graphics.newCanvas(width, height, "rgba32f")

but when I try to do this :
buffer = love.graphics.newCanvas(width, height, { "2d"; "rgba32f"; true; 0; 1; "none" })

I have the error :
main.lua:6: bad argument #5 to 'new canvas' (string expected, got number)

can someone help please ? is my settings table incorrect ?

Re: newCanvas function

Posted: Fri Sep 07, 2018 10:59 pm
by pgimeno
Try this:

Code: Select all

buffer = love.graphics.newCanvas(width, height, { type="2d"; format="rgba32f"; readable=true; msaa=0; dpiscale=1; mipmaps="none" })
The docs are not very clear about the fact that you need named table entries, not an array.

Re: newCanvas function

Posted: Fri Jun 07, 2024 11:41 pm
by logoliv
It works :)
Many thanks (with a 6 years delay !)

Re: newCanvas function

Posted: Sun Jun 09, 2024 8:06 am
by pgimeno
Better late than never! ;)