Growler Posted April 13, 2020 Share Posted April 13, 2020 (edited) Hello, I'm on a Macbook Pro 15" monitor, on Google Chrome. MelonJS 5.1. 640 x 480 dimension. if (!me.video.init(640, 480, { wrapper: 'screen', scale: 'auto', scaleMethod: 'fit', renderer: me.video.AUTO, subPixel: false, })) { alert('Your browser does not support HTML5 canvas.'); return; } I'm trying to request full screen. I'm using DOM elements for the GUI, so I'm requesting full screen on documentElement: me.device.requestFullscreen(document.documentElement); When I change to full screen, there's no issues with my pointer events— e.gameX, e.gameY. When I exit full screen, e.gameY seems to be permanently offset by the height difference expanding back to normal viewport, by about 84 pixels. This only happens when I have Chrome console closed. If Chrome console is open, there's no issue with e.gameY. Clicking in the same exact location each time, I get: Normal browser viewport: e.gameX: 3018.744 e.gameY: 2284.550 Full screen: e.gameX: 3018.138 e.gameY: 2284.371 Exited full screen: e.gameX: 3018.465 e.gameY: 2367.873 Why does this happen? Edited April 13, 2020 by Growler Quote Link to comment Share on other sites More sharing options...
obiot Posted April 13, 2020 Share Posted April 13, 2020 (edited) before version 7.0, there were some issues indeed when the game was embedded in a complex css layouts, this has been fixed here if you want to back port the change to version 5.1 and see if it fixed it : https://github.com/melonjs/melonJS/commit/7b1301c492654e4f59c6fc7d46c092f3ac3d1466#diff-7dc57d2221a69e771261f215eefd8926 this say, you should reaaaally consider updating, the improvements since 5.x up to 8.0 that is to be released soon are huge now , and solves many of the issues you have reported here : https://github.com/melonjs/melonJS/blob/master/CHANGELOG and also since version 6.0 we provide backward compatibility as much as possible when changing the API, so by following the updated guide (even by one version at the time) it should not be difficult task : https://github.com/melonjs/melonJS/wiki/Upgrade-Guide Edited April 13, 2020 by obiot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.