os_is_network_connected


描述

With this function you can check and see if your device currently has an internet connection and it will return true if it does, or false if it does not.

NOTE: This function checks the internal device API that controls connections and so may return true if there is a bluetooth connection, a Wi-Fi connection, or even just a normal network connection that permits internet access.


语法:

os_is_network_connected()


返回:

Boolean(布尔值)


例如:

if os_is_network_connected()
   {
   facebook_init();
   }

The above code checks to see if the device has a connection to the internet and if so initialises the GameMaker Studio 2 Facebook API.