0.8.0 - setMask/getMask API weirdness
Posted: Mon May 21, 2012 4:30 am
Okay, so I don't yet know all the ins and outs of Lua, but I have a problem with Fixture:setMask and getMask... Essentially I want to save the collision mask of an object, and restore it later, but I can't seem to find a good way of doing it.
I can store the collision mask easily thus, no matter how large it is:
But then I appear to have no good way of shoving it back into setMask(). Ideally I'd want to do something like this:
where "mask" is the table saved in the previous code. But that just passes a table to the function as the first argument, which doesn't work. Is there some way of expanding that table out into multiple arguments... somehow? I've looked through the Lua docs and and can't see anything like that. Is there a better way of doing this? If not, can I beg that the next version of LOVE takes this into account when deciding how getMask and setMask will work?
Thanks in advance.
I can store the collision mask easily thus, no matter how large it is:
Code: Select all
mask = {somefixture:getMask()}
Code: Select all
somefixture:setMask(mask)
Thanks in advance.