Replies: 1 comment 14 replies
-
The closest thing that comes to my mind would be to define all the other possible argument aliases as overloads to the function: ---@param screen ctr_screen_3d
---@overload fun(screen : ctr_screen_2d)
---@overload fun(screen : hac_screen)
---@overload fun(screen : cafe_screen)
function love.draw(screen) end
-- or you can define a union type using |
---@param ctr_screen_2d|screen ctr_screen_3d|hac_screen|cafe_screen
function love.draw(screen) end Then to really see which works best for you I'd recommend trying both and seeing for yourself which gives you the best results. |
Beta Was this translation helpful? Give feedback.
14 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Heya,
So, I'm the developer of LÖVE Potion. I gave it some thought to add a meta file for some of its functionality. However, I am unsure of what to do for a few functions. Here's an example:
The problem is that this function is different for many reasons in its parameter. In this case, a 3DS would only have 'left', 'right', or 'bottom' by default since stereoscopic 3d is enabled by default. However, if it isn't, then it would pass 'top' or 'bottom'. This also is a bit more complicated because I have to also add values for the Switch (and Wii U!) where all screen aliases are different. I do have a way to check the current console,
love._console_name
, but afaik with this being a meta file, I can't really use that. Is there a way to have end-users configure the data on their end to give them the proper hintings?Beta Was this translation helpful? Give feedback.
All reactions