[title: "LoadCordova Class"] ← Back to index

Initialize Cordova on mobile devices, initialize file system

[heading: "Description"]

A conditional startup state that runs before any external storage is accessed. When the game is running inside a Cordova environment the Cordova script is injected and the filesystem is created once the device is ready; on other platforms the game proceeds straight to building the required directory structure.

[heading: "Methods"] [table header] [ Method | Parameters | Description ] [ create | () | Detects the current environment: on Cordova it injects cordova.js and waits for the device to be ready, otherwise it builds the folder structure immediately. ] [ loadScript | () | Shows the loading dots, injects the cordova.js script into the page, and registers a back button handler for mobile devices once the Cordova device is ready. ] [ createFolderStructure | () | Creates the main storage directory along with its addons, screenshots, songs, and editor output subdirectories, then continues to the next startup state. ] [ continue | () | Advances to the LoadAddons state to continue the startup sequence. ] [/table] [heading: "Example Usage (Modding)"] [codeblock javascript] // Added to the boot chain so storage directories exist before song loading. game.state.add('LoadCordova', LoadCordova); game.state.start('LoadCordova'); [/codeblock] [footer: "© Retora 2026"]