`newCursor` accepting a filepath / `setCursor` accepting a CursorType?
I mentioned some of this on the forums but I thought I'd mention it here since I just thought of another reason why this might maybe perhaps be a good idea.
newCursor can accept an ImageData or a CursorType, and
setCursor accepts a Cursor or nothing to reset to the default cursor.
I see two issues with this:
1: I'm not really sure how to phrase this, but it's weird that the constructor can only create one thing from the CursorType. Like...
cursor1 = love.mouse.newCursor('arrow') cursor2 = love.mouse.newCursor('arrow')
2: Image cursors could be created from a filepath which could be nice, except since
newCursor accepts a CursorType string the argument would be ambiguous.
cursor = love.mouse.newCursor('cursor.png')
So, how about...
setCursor could accept a Cursor or a CursorType.
love.mouse.newCursor could also accept a filepath.
I think it might make things nicer to use:
custom = love.mouse.newCursor(love.image.newImageData('cursor.png')) arrow = love.mouse.newCursor('arrow') if hover() then love.mouse.setCursor(custom) else love.mouse.setCursor(arrow) end
custom = love.mouse.newCursor('cursor.png') if hover() then love.mouse.setCursor(custom) else love.mouse.setCursor('arrow') end