fixture:setMask requiring two arguments

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.
Post Reply
pandna
Prole
Posts: 2
Joined: Thu May 02, 2024 6:40 am

fixture:setMask requiring two arguments

Post by pandna »

I have a fixture that I'd like to add a mask to, I'm using VSCode, and it looks like it's interpreting that the function requires two arguments. I don't have any runtime errors, and the wiki shows an example with 1 parameter. Anybody have info on how to fix this? Any reason the love2d has two params listed in the definition?
Screenshot 2024-05-02 014301.png
Screenshot 2024-05-02 014301.png (30.89 KiB) Viewed 862 times
User avatar
knorke
Party member
Posts: 258
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: fixture:setMask requiring two arguments

Post by knorke »

https://love2d.org/wiki/Fixture:setMask
Fixture:setMask( mask1, mask2, ... )
Those three dots mean there can be more arguments.
The number of arguments is flexible. It needs at least 1 argument but can take more.
The physics system supports up to 16 categories, so 16 is the upper limit.
I do not know how to fix the VSCode warning.
User avatar
dusoft
Party member
Posts: 518
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: fixture:setMask requiring two arguments

Post by dusoft »

This is not the forum for VSCode bugs. The LOVE docs are clear.
pandna
Prole
Posts: 2
Joined: Thu May 02, 2024 6:40 am

Re: fixture:setMask requiring two arguments

Post by pandna »

I'm not sure this is a VSCode bug, but more a result of how love2d has its definition. Any reason it's not just Fixture:setMask(mask1, ...)?
User avatar
slime
Solid Snayke
Posts: 3141
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: fixture:setMask requiring two arguments

Post by slime »

While the wiki could be more clear, updating it won't fix that vscode extension. Like dusoft said it's a separate and independently developed piece of software.
User avatar
knorke
Party member
Posts: 258
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: fixture:setMask requiring two arguments

Post by knorke »

In the screenshot, VScode uses the same text as the wiki. Did they parse the wiki somehow or is that docu created by hand?
Would it make sense to standardize the style a bit to make it more machine-readable?
For example: https://love2d.org/wiki/love.event.push writes things a bit different: a,b,c,d,e,f... instead of argument1, argument2, ...
For me, the totally normal human, either way is clear enough.
User avatar
slime
Solid Snayke
Posts: 3141
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: fixture:setMask requiring two arguments

Post by slime »

knorke wrote: Fri May 03, 2024 11:54 pm In the screenshot, VScode uses the same text as the wiki. Did they parse the wiki somehow or is that docu created by hand?
Would it make sense to standardize the style a bit to make it more machine-readable?
I believe it's a heavily modified edit of something that originated as a wiki scrape.

I'm interested in making the wiki human-readable, which is often in conflict with making it perfectly machine-readable. Given a choice between the two I'll pick the former.
knorke wrote: Fri May 03, 2024 11:54 pm For example: https://love2d.org/wiki/love.event.push writes things a bit different: a,b,c,d,e,f... instead of argument1, argument2, ...
For me, the totally normal human, either way is clear enough.
Those are the actual argument names to the function (it's consistent with other var-arg listings in the wiki), they just don't have good names because they can have sort of arbitrary values.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Iori Branford and 3 guests