General discussion about LÖVE, Lua, game development, puns, and unicorns.
tomshreds
Party member
Posts: 101 Joined: Thu Oct 18, 2012 8:49 pm
Post
by tomshreds » Sat Feb 09, 2013 2:51 pm
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!
Nixola
Inner party member
Posts: 1949 Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy
Post
by Nixola » Sat Feb 09, 2013 3:04 pm
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
Post
by tomshreds » Sat Feb 09, 2013 3:15 pm
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!
Saegor
Party member
Posts: 119 Joined: Thu Nov 08, 2012 9:26 am
Location: Charleroi
Post
by Saegor » Sun Feb 10, 2013 5:09 pm
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 ?
tomshreds
Party member
Posts: 101 Joined: Thu Oct 18, 2012 8:49 pm
Post
by tomshreds » Sun Feb 10, 2013 5:24 pm
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.
Users browsing this forum: No registered users and 3 guests