RetroHubGameData
Represents a game entry from the user’s library. Holds all informations available about a game. It is generated by RetroHub when the app in launched, and passed to themes through the game_received signal.
The received object is unique and shared among the app. An instance can also be used to uniquely identify this game, which is done for other parts of the API.
Enumerations
enum BoxTextureRegions:
BACK - Back cover.
SPINE - Spine portion.
FRONT - Front cover.
Properties
Type |
Name |
Default |
|---|---|---|
|
||
|
||
other |
||
|
||
other |
||
other |
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
bool has_metadata =
false
Whether there’s metadata available. If false, only the name and path properties are guaranteed to be valid. In that case, name will be set to the game’s file name.
bool has_media =
false
Whether there’s media available for this game. If false, any calls to retrieve media will fail.
Note
This only denotes the existence of any media, and doesn’t guarantee that all media types are available.
RetroHubSystemData system =
<valid system instance>
The RetroHubSystemData this game belongs to.
String system_path =
""
The physical system folder this game comes from. Because of system remaps for different regions, the system may be pointing to a different system from the game file’s location. This is used internally by RetroHub to determine the correct system for the game when launching the game.
String name =
"..."
The game’s name. This field is always set even when has_metadata is false, in which case it will be set to the game’s file name.
String path =
"..."
The game’s file absolute path. This field is always set even when has_metadata is false.
String description =
""
The game’s description.
float rating =
0.0
The game’s rating, which ranges between 0.0 and 1.0.
String release_date =
""
The game’s release date, in ISO8601 format. Use RegionUtils.localize_date() to convert it to the user’s local date format.
String developer =
""
The game’s developer.
String publisher =
""
The game’s publisher.
Array genres =
[]
The game’s genres. This is an array of strings.
String num_players =
""
The game’s number of players, in the format "{min_players}-{max_players}". This is used to represent both singleplayer ("1-1") and multiplayer ("2-4") games.
String age_rating =
""
The game’s age rating, in the format "{esrb}/{pegi}/{cero}". Values range from 0 to 5, where 0 means unknown, and 1 through 5 increasing levels of age rating. Use RegionUtils.localize_age_rating to get the appropriate rating as a Texture.
bool favorite =
false
Whether the game is marked as a favorite.
int play_count =
0
The number of times the game has been played.
String last_played =
""
The date the game was last played, in ISO8601 format. Use RegionUtils.localize_date() to convert it to the user’s local date format.
Warning
If never played before, the string will be set to "null".
String emulator =
""
Used internally by RetroHub to specify a specific emulator to be used when launching the game.
Dictionary box_texture_regions =
{}
Defines regions of the game’s box art texture. This allows you to extract specific regions of the box art, such as the front portion. See RetroHubMedia.get_box_texture_region() for more information.
Methods
Type |
Name |
|---|---|
void |
bool sort (a: RetroHubGameData, b: RetroHubGameData)
Custom sorting implementation for RetroHubGameData instances. This is used internally by RetroHub to sort games by name, in ascending order. You can also use this if you need to sort game datas, by using Array.sort_custom().
var game_datas = [...]
game_datas.sort_custom(RetroHubGameData, "sort")
# game_datas will now be sorted by names
void copy_from (other: RetroHubGameData)
Copies all information from existing game data, creating a duplicate.