Returns a ds_map with information about the OS.


GML Code Example


Returns: Real (ds_map index)


This function returns a ds_map with detailed information about the OS that the game is running on. The exact information returned will depend on the OS and the device. Note that the ds_map is not automatically cleared from memory and you should use the ds_map_destroy() function when you no longer need the data it contains.

NOTE: This function only works on Android, iOS, Mac, Ubuntu and Windows, on all other target platforms it will return -1 rather than a ds_map.


GML Code Example

os_map = os_get_info();
 if os_map != -1
    var size, key, i;
    size = ds_map_size(os_map);
    key = ds_map_find_first(os_map);
    for (i = 0; i < size - 1; i++;)
       map_data[i] = ds_map_find_value(os_map, key);
       key = ds_map_find_next(os_map, key);

The above code will check the OS information to see if a ds_map is returned. If it is, then the code will loop through the map and assign all the values to an array.

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here