This asynchronous function synchronises the changes to the file system on the GX.games platform.
You should call this function whenever more than one game, e.g. a Live Wallpaper and a Game Strip, writes to and reads from the file system and you want to get the changes made by the other game in the current one.
Because of the type of file system used by GameMaker when running on GX.games, the changes made by one game will not automatically be picked up by the other. To retrieve these changes and to synchronise the state of the file system in both games you call this function.
The function takes a callback function that's called when the synchronisation has completed.
gxc_file_sync([callback]);
Argument | Type | Description |
---|---|---|
callback | Method or Script Function | OPTIONAL The callback method to execute when the sync is complete |
N/A
Create Event
confirm = function()
{
show_debug_message("Successfully synced file system changes!");
}
alarm_time = 60;
alarm[0] = alarm_time;
Alarm Event
gxc_file_sync(confirm);
alarm[0] = alarm_time;
The above code first creates a method in an object's Create event that shows a debug message and sets alarm[0] to 60 steps. In the Alarm event a file sync is performed with a call to gxc_file_sync and the alarm is set to countdown again.