[READ-ONLY] Mirror of https://github.com/excaliburjs/Excalibur. 🎮 Your friendly TypeScript 2D game engine for the web 🗡️ excaliburjs.com
excalibur excaliburjs game-development game-engine game-framework gamedev games html5-canvas typescript

fix: Handle webgl context lost + Recover from hidpi scale too large (#2958) master

This PR addresses some issues with webgl contexts - Fixed issue when WebGL context lost occurs where there was no friendly output to the user - Fixed issue where HiDPI scaling could accidentally scale past the 4k mobile limit, if the context would scale too large it will now attempt to recover by backing off. - Added way to add custom WebGL context lost/recovered handlers for your game ```typescript const game = new ex.Engine({ handleContextLost: (e) => {...}, handleContextRestored: (e) => {...} }) ``` Default context lost screen ![image](https://github.com/excaliburjs/Excalibur/assets/612071/92b20772-7ce9-4099-86aa-d174d561044e)