Module Runtime
Functions to access general runtime information.
Functions
fromJson (json) | Converts a json string into a lua table. |
getId () | Package id of the app, should be 'info.flowersoft.theotown.theotown' |
getModel () | Returns model name and manufacturer of the device. |
getName () | Name of the application, should be 'TheoTown' |
getOSVersion () | Returns the version code of the os (e.g. |
getPlatform () | Returns a string that represents that platform TheoTown is running on right now. |
getTime () | Unix timestamp in milliseconds |
getUuid () | Returns a random uuid string. |
getVersion () | Current version of TheoTown, e.g. |
getVersionCode () | Current version of TheoTown as number, e.g. |
isDebug () | Returns true iff game is currently running on a debug build. |
isPremium () | Returns true iff this copy of TheoTown is a premium version. |
postpone (func[, delayMS]) | Postpones the execution of a function. |
toJson (table) | Converts a table into a json string. |
Functions
- fromJson (json)
-
Converts a json string into a lua table.
Parameters:
- json string
Returns:
- getId ()
-
Package id of the app, should be 'info.flowersoft.theotown.theotown'
Returns:
- getModel ()
-
Returns model name and manufacturer of the device.
Returns:
- getName ()
-
Name of the application, should be 'TheoTown'
Returns:
- getOSVersion ()
-
Returns the version code of the os (e.g. Android API level).
Returns:
- number
- string
- getPlatform ()
-
Returns a string that represents that platform TheoTown is running on
right now. E.g. 'android', 'ios' or 'desktop'.
Returns:
- getTime ()
-
Unix timestamp in milliseconds
Returns:
-
int
- getUuid ()
-
Returns a random uuid string.
Returns:
- getVersion ()
-
Current version of TheoTown, e.g. 1.5.15
Returns:
- getVersionCode ()
-
Current version of TheoTown as number, e.g. 1515
Returns:
-
int
- isDebug ()
-
Returns true iff game is currently running on a debug build. Should always return false.
Returns:
-
bool
- isPremium ()
-
Returns true iff this copy of TheoTown is a premium version.
Returns:
-
bool
- postpone (func[, delayMS])
-
Postpones the execution of a function.
Postponed functions will be executed synchronously once per frame.
You can optionally set a minimum time to wait until execution.
Parameters:
- func function The function that should be executed.
- delayMS int Minimum amount of milliseconds to wait until execution. (optional)
- toJson (table)
-
Converts a table into a json string.
Parameters:
- table table
Returns: