Re:Show HN: Unity like game editor running in pure WASM
by TrevorSundberg on Tuesday September 26, 2023 @05:54PM
(#37666287)
Thanks, I’ll make the fix!
Re:Show HN: Unity like game editor running in pure WASM
by TrevorSundberg on Wednesday September 27, 2023 @05:58PM
(#37681937)
Fixed:
https://github.com/raverie-us/raverie-engine/commit/aa7e1b6c...
Had to take into account the mouse coordinates too since they were not scaled.
The fix is setting canvas width to window.innerWidth * window.devicePixelRatio, and height to window.innerHeight * window.devicePixelRatio. Then use CSS to maximize the canvas on the screen.