FBInstant.setLoadingProgress

From GiderosMobile
Revision as of 15:28, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")


Available since: Gideros 2018.3
Class: * Initialisation and Core

Description


Report the game's initial loading progress.
<syntaxhighlight lang="lua">

FBInstant.setLoadingProgress(percentage)

</source>

Parameters

percentage: (number) A number between 0 and 100.

Examples

Example
<syntaxhighlight lang="lua"> FBInstant.getSupportedAPIs( function(result,error) local progressCount=0 function progress() progressCount+=1 local steps=9 -- set to the number of times progress() called local percent=70+((30/steps)*progressCount) -- on export set the % to 70 print("Progress",progressCount,percent.."%") if FBInstant then FBInstant.setLoadingProgress(percent) end end progress() -- do this multiple times as you load images, process data, etc -- eventually call FBInstant.startGameAsync(function) just before starting the game proper. end)
</source>