-
Notifications
You must be signed in to change notification settings - Fork 2
04. Actions
VERY IMPORTANT See Start AirConsole
Show ad: Show ad on every connected controllers and the screen. "On ad show" is called when ads are displayed. "On as complete" is called when ad is over
Navigate home: Request that all devices return to the AirConsole store
Navigate to (url): Request that all devices load a game by url
Vibrate(time): Vibrates the device for the given miliseconds
Game ready: Sets the game as ready. You have to use "Game ready" in your game, and the best practice is to use it in "On loader layout complete". This will trigger OnConnect for all already connected devices
Request HighScores (levelName, levelVersion, uids, ranks, total, top): Requests highscores. "On HighScores" triggered when the highscores are returned
Store HighScores (levelName, levelVersion, score, uid, data, scoreString): Stores highscores. "On HighScore stored" triggered when the request is completed
Broadcast (propertyName, propertyValue): Sends a message with {propertyName: propertyValue) to all connected devices
Message (deviceId, propertyName, message): Sends a message with {propertyName: message) to deviceId
Set custom device state property (property, value): Sets a device custom property to value
Request persistent data: Requests persistent data from the servers. Triggers "On persistent data loaded" when done
Store persistent data (property, value, uid): Stores a property-value pair persistently on the AirConsole servers. Storage is per game. Total storage can not exceed 1 MB per game and uid. Storage is public, not secure and anyone can request and tamper with it. Do not store sensitive data
Broadcast preset message: Broadcasts a preset message to all connected devices
Clear preset message: Clear a previously set preset message
Send preset message(deviceId): Sends a preset message to the given device Id
Set message property(property, value): Sets a preset message propertie's value
Edit profile: Lets the user change his nickname, profile picture and email address. If you need a real nickname of the user, use this function. onDeviceProfileChange will be called if the user logs in. Controller only
Get premium: Tries to get/purchase AirConsole premium
Set active players (maxPlayers): Takes all currently connected controllers and assigns them a player number. Can only be called by the screen. The assigned player numbers always start with 0 and are consecutive. You can hardcode player numbers, but not deviceIds. Once the screen has called "Set active players" you can get the deviceId of the first player by calling "convertPlayerNumberToDeviceId(0)", the deviceId of the second player by using "convertPlayerNumberToDeviceId(1)". You can also convert deviceId to player numbers by using "convertDeviceIdToPlayerNumber(deviceId)". You can get all deviceIds that are active players by using "getActivePlayerDeviceIds()"
Set orientation (orientation): Sets the device's orientation. Controller only
Start Airconsole: This is your very first action as soon as the layout has loaded. It initialized AirConsole now that Construct 3 is ready to receive messages from AirConsole API