|
| array | GetCommandLineArguments () |
| | Gets a list of the command line arguments passed to the application.
|
| string | GetEngineVersionString () |
| | Gets the engine version string.
|
| integer | GetEngineVersionMajor () |
| | Gets the major engine version.
|
| integer | GetEngineVersionMinor () |
| | Gets the minor engine version.
|
| integer | GetEngineVersionPatch () |
| | Gets the minor engine version.
|
| string | GetEngineVersionPrerelease () |
| | Gets the prerelease engine version.
|
| string | GetEngineVersionCodename () |
| | Gets the engine version codename.
|
| integer | GetTargetFrameRate () |
| | Gets the target frame rate of the fixed timestep.
|
| void | SetTargetFrameRate (integer framerate) |
| | Sets the target frame rate of the fixed timestep.
|
| void | UseFixedTimestep (boolean useFixedTimestep) |
| | Enables or disables fixed timestep. This is enabled by default.
|
| decimal | GetFPS () |
| | Gets the current FPS (frames per second).
|
| void | ShowFPSCounter (boolean show) |
| | Enables or disables the FPS (frames per second) counter.
|
| KeyBind | GetKeyBind (KeyBind keyBind) |
| | Gets a keybind.
|
| void | SetKeyBind (KeyBind keyBind, Key keyID) |
| | Sets a keybind.
|
|
void | GetGameTitle () |
| | Gets the game title of the application.
|
|
void | GetGameTitleShort () |
| | Gets the short game title of the application.
|
|
void | GetGameVersion () |
| | Gets the version of the application.
|
|
void | GetGameDescription () |
| | Gets the description of the game.
|
| void | SetGameTitle (string title) |
| | Sets the title of the game.
|
| void | SetGameTitleShort (string title) |
| | Sets the short title of the game.
|
| void | SetGameVersion (string title) |
| | Sets the version of the game.
|
| void | SetGameDescription (string title) |
| | Sets the description of the game.
|
| void | SetCursorVisible (boolean cursorVisible) |
| | Sets the visibility of the cursor.
|
| boolean | GetCursorVisible () |
| | Gets the visibility of the cursor.
|
| void | Error (string message, boolean detailed=true) |
| | Shows an error message to the user through a dialog box, if possible. The error message is also logged.
|
| void | SetDefaultFont (string font) |
| | Sets the default font to the given Resource path, or array containing Resource paths.
|
| void | SetDefaultFont (array font) |
| | Sets the default font to the given Resource path, or array containing Resource paths.
|
| boolean | ChangeGame (string path, string startingScene, array cmdLineArgs) |
| | Changes the current game, by loading a data file containing the new game.
|
|
void | Quit () |
| | Closes the application.
|
Functions for manipulating and reading runtime information.
| boolean Application.ChangeGame |
( |
string | path, |
|
|
string | startingScene, |
|
|
array | cmdLineArgs ) |
Changes the current game, by loading a data file containing the new game.
If the path ends with a path separator (/), an entire directory will be loaded as the game instead. Only game:// and user:// URLs are supported (or an absolute path that resolves to those locations).
This is permanent for as long as the application is running, so restarting the application using the associated developer key (KeyBind_DevRestartApp) will reload the current game, and not the one the application started with. Script compiling is also disabled after the game changes.
The change only takes effect after a frame completes.
Note that certain game configurations will persist between games if not set by the new GameConfig:
-
Game-identifying configurations:
-
Game title (including the short game title)
-
Game version
-
Game description
-
Game developer
-
Game identifier
-
Developer identifier
-
Paths:
-
Saves directory
-
Preferences directory
-
Engine configurations:
-
Window size
-
Audio volume
-
Target frame rate
-
Whether fixed timestep was enabled or disabled with useFixedTimestep
-
Settings filename
this is changed, the current settings are discarded (not saved) and the new settings file is loaded. If the file does not exist, however, default settings will be loaded.
Some of the game's current state also persists between games:
-
Command line arguments (unless cmdLineArgs is passed to this function)
-
Palette colors
-
Whether palette rendering is enabled
-
Whether software rendering was enabled or disabled with useSoftwareRenderer
The following does not persist between games:
-
Any loaded resources
-
Any persistent entities
-
Scripting state
The following cannot be changed between games:
-
Log file name
-
Graphics rendering backend
- Parameters
-
| path | The path of the data file to load. |
| startingScene | The filename of the scene file to load upon changing the game. Note that restarting the game will load the starting scene defined in its GameConfig instead. Passing null to this argument is equivalent to not passing it at all. |
| cmdLineArgs | An array of strings containing the command line arguments to pass to the new game. If any of the values are not strings, they will be converted to a string representation. If this argument is not given, the current command line arguments will be passed to the new game. |
- Returns
- Returns whether the game will change.