Difference between revisions of "FBInstant.player.getPhoto"
m (Text replacement - "<source" to "<syntaxhighlight") |
|||
Line 8: | Line 8: | ||
WARNING: Due to CORS, using these photos in the game canvas can cause it to be tainted, which will prevent the canvas data from being extracted. To prevent this, set the cross-origin attribute of the images you use to 'anonymous'.<br /> | WARNING: Due to CORS, using these photos in the game canvas can cause it to be tainted, which will prevent the canvas data from being extracted. To prevent this, set the cross-origin attribute of the images you use to 'anonymous'.<br /> | ||
<br /></translate> | <br /></translate> | ||
− | < | + | <syntaxhighlight lang="lua"> |
(string) = FBInstant.player.getPhoto() | (string) = FBInstant.player.getPhoto() | ||
</source> | </source> |
Revision as of 14:28, 13 July 2023
Available since: Gideros 2018.3
Class: Player
Description
A url to the player's public profile photo. The photo will always be a square, and with dimensions of at least 200x200. When rendering it in the game, the exact dimensions should never be assumed to be constant. It's recommended to always scale the image to a desired size before rendering. The value will always be null until FBInstant.startGameAsync() resolves.
WARNING: Due to CORS, using these photos in the game canvas can cause it to be tainted, which will prevent the canvas data from being extracted. To prevent this, set the cross-origin attribute of the images you use to 'anonymous'.
<syntaxhighlight lang="lua">
(string) = FBInstant.player.getPhoto()
</source>
Return values
Returns (string) Url to the player's public profile photo.
- FBInstant.player.canSubscribeBotAsync
- FBInstant.player.flushDataAsync
- FBInstant.player.getConnectedPlayersAsync
- FBInstant.player.getDataAsync
- FBInstant.player.getID
- FBInstant.player.getName
- FBInstant.player.getPhoto
- FBInstant.player.getSignedPlayerInfoAsync
- FBInstant.player.getStatsAsync
- FBInstant.player.incrementStatsAsync
- FBInstant.player.setDataAsync
- FBInstant.player.setStatsAsync
- FBInstant.player.subscribeBotAsync