[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

feat: [#2324] Add FullScreen Target Element Id (#2325) master

Closes #2324 This PR adds an additional optional argument to `ex.Screen.goFullScreen('some-element-id')` to target a specific element for the browser fullscreen API. Example: ```html <button id="fullscreen">Go Fullscreen</button> <div id="container" class="container"> <div class="ui" style="position: absolute; right: 0"> <div>Some text</div> <button>Click me!</button> </div> <canvas id="game"></canvas> </div> ``` ```typescript const game = new ex.Engine({ ... canvasElementId: 'game' }); var fullscreenButton = document.getElementById('fullscreen') as HTMLButtonElement; fullscreenButton.addEventListener('click', () => { if (game.screen.isFullScreen) { game.screen.exitFullScreen(); } else { game.screen.goFullScreen('container'); } }); ```


+51 -3
4 changed files