How do I make my AI game go full screen?
On Cassette every game gets a full-screen button in the player’s bar, wherever the browser can go full screen. Your game can ask for full screen too, from a click or a key press, with one call that works in Firefox and Safari as well, where a framed game can’t do it alone.
Tell your agent
Add a full-screen button to my game on cassette.gg.- Your own call works
- element.requestFullscreen() from a click or a key press works as it is: in Firefox and Safari, Cassette’s script asks the page to go full screen for the game.
- Turned the right way
- Full screen turns to the orientation your game declares, where the phone allows it.
- iPhone
- iPhone Safari has no full screen for pages. Players add the game to their home screen and it opens full screen, and Cassette tells them so once.
From a click:
const cassette = await Cassette.ready
fullscreenButton.addEventListener('click', async () => {
const on = await cassette.requestFullscreen() // true or false
})What the frame changes, for agents (§1)