Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this.
-
eka
- Prole
- Posts: 5
- Joined: Mon Aug 04, 2014 3:00 pm
Post
by eka »
Hi all, new to Love2d
I tried to set a mouse cursor with love.mouse.newCursor('miImage.png', x, y) in the load callback, but that doesn't work.
What is the proper way to set the mouse cursor without having to rely on code to paint an image that follows the mouse (overkill)
Thanks!
![Nyu :nyu:](./images/smilies/ms-nyu.png)
-
slime
- Solid Snayke
- Posts: 3147
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
-
Contact:
Post
by slime »
That should work - make sure to call love.mouse.setCursor after creating the cursor.
Something like this:
Code: Select all
function love.load()
local hot_x, hot_y = 0, 0
mycursor = love.mouse.newCursor("miImage.png", hot_x, hot_y)
love.mouse.setCursor(mycursor)
end
-
eka
- Prole
- Posts: 5
- Joined: Mon Aug 04, 2014 3:00 pm
Post
by eka »
@slime: Thanks, I was just forgetting to use setCursor
![Very Happy :D](./images/smilies/ms-glad.png)
Users browsing this forum: Ahrefs [Bot], Amazon [Bot] and 7 guests