You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've played OpenTTD, and I have found that I prefer "Mouse moves Viewport" panning much more than "Mouse moves Canvas" panning because your mouse can move in one motion, instead of going back and forth. Additionally, Mouse Lock keeps the cursor within bounds of the window, so there's no problem with your mouse leaving the window.
Basically, have an option to invert panning direction and/or activate pointer lock while panning.
(IMO the terms I used here, which are adapted from OpenTTD, explains it much more nicely than "Normal" and "Inverted")
The text was updated successfully, but these errors were encountered:
Previously I made a minor mod to my litegraph.core.js back in June 2024 to shove this feature in, so I don't know what changes are needed for current version, but here's what I've done back then:
All changes are in LGraphCanvas class. use canvas.requestPointerLock() and document.exitPointerLock() to lock and unlock pointer when dragging_canvas became true or false. did this in processMouseMove:
the reason both delta and e.movementX/Y is needed is to improve responsiveness, as pointer lock takes a bit of time to activate.
and because pointer lock hides the cursor, I made the canvas draw a small cross shaped cursor in drawFrontCanvas.
I've played OpenTTD, and I have found that I prefer "Mouse moves Viewport" panning much more than "Mouse moves Canvas" panning because your mouse can move in one motion, instead of going back and forth. Additionally, Mouse Lock keeps the cursor within bounds of the window, so there's no problem with your mouse leaving the window.
Basically, have an option to invert panning direction and/or activate pointer lock while panning.
(IMO the terms I used here, which are adapted from OpenTTD, explains it much more nicely than "Normal" and "Inverted")
The text was updated successfully, but these errors were encountered: