Enable right click on overlay

This commit is contained in:
Lukas Hass 2022-04-02 00:18:22 +02:00 committed by David Négrier
parent 9647f93cc2
commit f0b283ea24

View File

@ -104,7 +104,6 @@ const config: GameConfig = {
dom: { dom: {
createContainer: true, createContainer: true,
}, },
disableContextMenu: true,
render: { render: {
pixelArt: true, pixelArt: true,
roundPixels: true, roundPixels: true,
@ -142,6 +141,14 @@ const game = new Game(config);
waScaleManager.setGame(game); waScaleManager.setGame(game);
/*
TODO: replace with disableContextMenu when Phaser does not disable context menu on document.body
see https://github.com/photonstorm/phaser/issues/6064
*/
HtmlUtils.querySelectorOrFail("#game canvas").addEventListener("contextmenu", function (e) {
e.preventDefault();
});
window.addEventListener("resize", function (event) { window.addEventListener("resize", function (event) {
coWebsiteManager.resetStyleMain(); coWebsiteManager.resetStyleMain();