A browser window can have any shape, and a phone can be held either way. Three settings in js/options.js decide what your game does about it.

Setting Default Starter game
ForceAspectRatio 'None' same
AspectRatio '16:9' same
Orientation 'any' 'landscape'

All three are read when the game starts, so reload the page after changing them.

Keep the game in one shape

With ForceAspectRatio at 'None', the game fills the window and the scene covers it, so part of the scene may be cut off. The other two values keep part or all of the game in the shape of AspectRatio, as large as the window allows and centered, and follow the window when it’s resized:

monogatari.settings({
  'AspectRatio': '16:9',
  'ForceAspectRatio': 'Global',
});
ForceAspectRatio What keeps the shape
'None' Nothing. The game fills the window.
'Visuals' The scene, the characters and the images. The text box and the quick menu still span the whole window, and the space on each side of the scene is black.
'Global' The whole game, menus included. The space around it shows the page’s background.

The same game in a window wider than 16:9 (1200 × 500), with each value:

The palace scene fills the whole window, cut at the top and the bottom
'None': the scene covers the window.

The scene is a 16:9 picture in the middle with black bands on each side, while the text box and quick menu run across the whole window
'Visuals': the scene keeps its shape; the text box doesn't.

The whole game, text box and quick menu included, is a 16:9 rectangle in the middle of a light gray page
'Global': the whole game keeps its shape.

AspectRatio is the width and height of your scenes, separated by a colon: '16:9', '4:3', '21:9'. It’s only used when ForceAspectRatio isn’t 'None'.

Ask players to turn their device

On a phone or tablet held the other way, a game drawn for a wide screen is hard to play. Set Orientation to the way your game should be held, and players holding it the other way see a message over the game asking them to turn their device:

monogatari.settings({
  'Orientation': 'landscape',
});

A phone screen held upright, with a white box reading "Please rotate your device to play" and an OK button over the main menu
The starter game on a phone held upright.

Orientation Effect
'any' No message.
'landscape' The message appears on phones and tablets held upright.
'portrait' The message appears on phones and tablets held sideways.

The message goes away when the player turns the device. Its OK button closes it too, so a player whose screen rotation is locked, or who prefers to, can keep playing the other way; turning the device the wrong way again brings it back. The starter game sets 'landscape', so while you try it on a phone held upright, you see this message: turn the phone, press OK, or set 'any'. The message is in the player’s language, and it only appears on phones and tablets; a desktop browser never shows it, whatever the window’s shape.

Before 2.9.0 the message had no button, so a player holding the device upright couldn’t play at all.

If your game is drawn upright, also change "orientation": "landscape" to "portrait" in the starter game’s manifest.json, the file browsers read when a player installs the game to their home screen.

Desktop builds

In a desktop build made with Electron or Electrobun, ForceAspectRatio at 'Global' also fixes the window’s shape: the player picks a size from the settings screen’s Resolution list, and in the Electron app can’t resize the window by dragging (Electrobun has no way to lock a window’s size). See Window size in desktop builds.