Custom Cursors on OS X

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Custom Cursors on OS X

Post 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!
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Custom Cursors on OS X

Post by Nixola »

It should be lm.setVisible, not lm.isVisible; the latter is only there to check wether the mouse is visible
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Custom Cursors on OS X

Post 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!
User avatar
Saegor
Party member
Posts: 119
Joined: Thu Nov 08, 2012 9:26 am
Location: Charleroi

Re: Custom Cursors on OS X

Post 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 ?
Current work : Isömap
tomshreds
Party member
Posts: 101
Joined: Thu Oct 18, 2012 8:49 pm

Re: Custom Cursors on OS X

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests