Is it possible to add mouse scrolling in LÖVE? I don't believe I've ever seen it done, so I'm wondering if it's possible and how to do it?
How can I tell if the user is scrolling with the mouse wheel?
Thanks!
Mouse scrolling
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Mouse scrolling
"In those quiet moments, you come into my mind" - Liam Reilly
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Mouse scrolling
Sure, why not?Eamonn wrote:Is it possible to add mouse scrolling in LÖVE?
love.keypressed gets called every time your scroll wheel "clicks", with "wu" for up and "wd" for down.Eamonn wrote:How can I tell if the user is scrolling with the mouse wheel?
Re: Mouse scrolling
Don't you mean love.mousepressed?bartbes wrote:love.keypressed gets called every time your scroll wheel "clicks", with "wu" for up and "wd" for down.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Mouse scrolling
Yes. Mousepressed, not Keypressed. It sends an event for every tick of the scroll. On OS X it even has the inertia.
Use the "wu" and "wd" as the buttons being clicked.
Use the "wu" and "wd" as the buttons being clicked.
Re: Mouse scrolling
Hat Cat uses mouse scrolling for zooming in and out.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Mouse scrolling
I did mean mousepressed.
Re: Mouse scrolling
update? I think it works differently now. I set up a test to change the background color in love.mousepressed, and it doesn't trigger when I scroll my mouse wheel.Jasoco wrote:Yes. Mousepressed, not Keypressed. It sends an event for every tick of the scroll. On OS X it even has the inertia.
Use the "wu" and "wd" as the buttons being clicked.
Re: Mouse scrolling
See love.wheelmoved
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Mouse scrolling
Yeah. 0.10.0 changed it to have its own callback. Also I think buttons are numbers now instead of letters for "l" and "r".
When in doubt, check the Wiki.
When in doubt, check the Wiki.
Re: Mouse scrolling
Jasoco wrote: alwaysWhen in doubtcheck the Wiki.
Who is online
Users browsing this forum: No registered users and 5 guests