newCanvas function

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
logoliv
Prole
Posts: 29
Joined: Mon Jan 27, 2014 3:05 pm

newCanvas function

Post 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 ?
User avatar
pgimeno
Party member
Posts: 3657
Joined: Sun Oct 18, 2015 2:58 pm

Re: newCanvas function

Post 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.
logoliv
Prole
Posts: 29
Joined: Mon Jan 27, 2014 3:05 pm

Re: newCanvas function

Post by logoliv »

It works :)
Many thanks (with a 6 years delay !)
User avatar
pgimeno
Party member
Posts: 3657
Joined: Sun Oct 18, 2015 2:58 pm

Re: newCanvas function

Post by pgimeno »

Better late than never! ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests