Right-click: Custom context menu instead of browser default #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A right-click anywhere on the game canvas triggers the browser's native context menu, which offers to "save image". This is disruptive and not part of the game experience.
Goal
Prevent the browser default context menu on the canvas and replace it with a custom in-game context menu.
Expected Behaviour
Open Questions
Notes
event.preventDefault()oncontextmenuevent suppresses the browser menuinput.mouse.disableContextMenu()for thisThe context menu should show nothing as default. Just take the input and stop the browser from doing something else.
In the world it could have buttons for build and folks.
The visual should go well with the other overlay objects.
Summary
Default behaviour: No menu — always suppress the browser context menu, nothing more.
In the world: Show buttons for
BuildandFolks.Visual style: Consistent with existing overlay objects.