Difference between revisions of "FBInstant.player.getPhoto"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
<languages />
 
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
 
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/Player|Player]]<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/Player|Player]]<br/>
Line 7: 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>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(string) = FBInstant.player.getPhoto()
 
(string) = FBInstant.player.getPhoto()
</source>
+
</syntaxhighlight>
 
=== <translate>Return values</translate> ===
 
=== <translate>Return values</translate> ===
 
'''<translate>Returns</translate>''' (string) <translate>Url to the player's public profile photo.</translate><br/>
 
'''<translate>Returns</translate>''' (string) <translate>Url to the player's public profile photo.</translate><br/>
 +
 +
{{FBInstant.player}}

Latest revision as of 14:29, 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'.

(string) = FBInstant.player.getPhoto()

Return values

Returns (string) Url to the player's public profile photo.