Phones and tablets play your web release in their browser. There’s nothing extra to build: the same files that play on a computer play on a phone.

How the game looks on a phone

The starter game is set up for landscape. Its js/options.js sets 'Orientation': 'landscape', so on a phone or tablet held upright, the game covers itself with a box that says “Please rotate your device to play”. When the player turns the device sideways, the box goes away; its OK button closes it too, for a player who keeps the device upright.

The starter game's main menu on a phone held upright, dimmed behind a white box that says "Please rotate your device to play", with an OK button
Held upright, the game asks the player to rotate the device.

The starter game's main menu on a phone held sideways, with the Start, Load, Settings and Help buttons on the right
The same game on a phone held sideways.

To change it, set 'Orientation' in js/options.js:

Value What the game does on a phone or tablet
'landscape' Asks the player to hold the device sideways. The starter game’s choice.
'portrait' Asks the player to hold the device upright.
'any' Plays either way. The engine’s default when the setting is left out.

The box only appears on phones and tablets, as the engine recognizes them from the browser: Android devices, iPhones and iPads among them. If you choose 'portrait', also change orientation in manifest.json (below), which is the orientation an installed game opens in.

On iPhones and iPads, the settings screen has no volume sliders: it says “Audio settings are not supported on iOS”, because the device’s own volume controls all sound there. The rest of the interface adapts to small screens on its own; Responsiveness explains how, and how to adjust it.

Install the game on the home screen

Your web release is an installable web app (a “progressive web app”) with no extra work: manifest.json describes the app, and the service worker (service-worker.js) keeps a copy of its files so it starts without a connection. Browsers that can install web apps offer it, usually from their menu, as long as the game is served from a secure https:// address. The installed game gets its own icon on the home screen and, on most systems, opens without the browser’s address bar.

manifest.json is what the browser reads to install it. Change these fields for your game:

Field What it’s for The starter’s value
name The app’s full name. "Monogatari Visual Novel"
short_name The name under the icon, where space is short. "Monogatari"
icons The app’s icons, from assets/icons/. 13 sizes, from 48×48 to 512×512
background_color The color shown while the game opens. "#F7F7F7"
theme_color The color of the system’s bars around the app, where the system uses one. "#F7F7F7"
display How much of the browser shows around the game. "fullscreen"
orientation The orientation the installed game opens in. "landscape"
start_url The page the installed game opens. "index.html"

Each system decides how it uses these fields. The web app manifest reference lists them all.

A game started before 2.9.0 that’s served from a sub-folder (as on itch.io) needs its service worker updated first, or it won’t play offline once installed.

To try it, open your released game on a phone, play a little, install it from the browser’s menu, then turn on airplane mode and open it from its icon. The game’s code is stored on the first visit; images and sounds are stored as the game loads them while the service worker is running, so open the game a second time before you go offline.

NOTE

For this page, a release copy was served from the top of a site and from a sub-folder on a local computer, and checked in Chromium, which reported it installable both ways and played it with the network off. It hasn't been tried on a real phone or tablet.

Saves on a phone

The game keeps its saves in the browser’s storage on the device, like on a computer. When the game starts, it asks the browser to keep that storage for good. A browser that says no may delete it when the device runs low on space, along with the saves. See Where saves are kept.

Store apps (optional, needs a computer)

To sell or list your game on Google Play or Apple’s App Store, you wrap the web release in a native app with a wrapper tool such as Capacitor or Apache Cordova. In general: you make a release copy, give it to the wrapper as the app’s web content, and use the wrapper’s own tools to build an Android or iOS package. That takes a computer with those tools installed, a developer account with each store (both charge a fee), and a Mac for iOS.

What the engine does inside such an app:

  • In a Cordova app (the engine checks for window.cordova), it doesn’t register the service worker and skips preloading, since the files are already on the device.
  • In another wrapper, it behaves as it does on the web. To turn the service worker off there, set 'ServiceWorkers': false in js/options.js.

NOTE

Wrapping the game for an app store hasn't been tried for this page. Follow the wrapper's own documentation for the steps and each store's rules.