Page 1 of 1

Custom Cursors on OS X

Posted: Sat Feb 09, 2013 2:51 pm
by tomshreds
Hi,

I'm trying to get a custom cursor working on OS X but nothing seems to make my current cursor disappear.

Does it work on OS X? It looks like no.

Here's a little bit of code:

Code: Select all

function shop.keypressed(args)
    if args.key == "delete" then
        isDestroyMode = true
        love.mouse.setGrab(true)
        love.mouse.isVisible(false)
    end
end

function shop.draw()
    if isDestroyMode then
        local x, y = love.mouse.getScaledPosition()
        love.graphics.draw(destroyCursor, x, y)
    end
end
This should simply replace the cursor when I press delete, but it doesn't.

Any idea or suggestions?

Thanks!

Re: Custom Cursors on OS X

Posted: Sat Feb 09, 2013 3:04 pm
by Nixola
It should be lm.setVisible, not lm.isVisible; the latter is only there to check wether the mouse is visible

Re: Custom Cursors on OS X

Posted: Sat Feb 09, 2013 3:15 pm
by tomshreds
Nixola wrote:It should be lm.setVisible, not lm.isVisible; the latter is only there to check wether the mouse is visible
How dumb am I? haha thanks it worked!

Re: Custom Cursors on OS X

Posted: Sun Feb 10, 2013 5:09 pm
by Saegor
tomshreds wrote:
Nixola wrote:It should be lm.setVisible, not lm.isVisible; the latter is only there to check wether the mouse is visible
How dumb am I? haha thanks it worked!
i got the same problem a week ago

what do you think of proposing the renaming of isVisible() to getVisible() in the Issue Tracker ?

Re: Custom Cursors on OS X

Posted: Sun Feb 10, 2013 5:24 pm
by tomshreds
Saegor wrote:
tomshreds wrote:
Nixola wrote:It should be lm.setVisible, not lm.isVisible; the latter is only there to check wether the mouse is visible
How dumb am I? haha thanks it worked!
i got the same problem a week ago

what do you think of proposing the renaming of isVisible() to getVisible() in the Issue Tracker ?
I agree, because it would follow the rest of the function name's standards.