Difference between revisions of "FBInstant.setLoadingProgress"
From GiderosMobile
Line 2: | Line 2: | ||
'''Available since:''' Gideros 2018.3<br/> | '''Available since:''' Gideros 2018.3<br/> | ||
=== Description === | === Description === | ||
− | <br /> | + | <translate><br /> |
− | Report the game's initial loading progress.<br /> | + | Report the game's initial loading progress.<br /></translate> |
<source lang="lua"> | <source lang="lua"> | ||
FBInstant.setLoadingProgress(percentage) | FBInstant.setLoadingProgress(percentage) | ||
</source> | </source> | ||
=== Parameters === | === Parameters === | ||
− | '''percentage''': (number) A number between 0 and 100. <br/> | + | '''percentage''': (number) <translate>A number between 0 and 100.</translate> <br/> |
=== Examples === | === Examples === | ||
'''Example'''<br/> | '''Example'''<br/> | ||
− | <source lang="lua" | + | <source lang="lua"> |
FBInstant.getSupportedAPIs( function(result,error) | FBInstant.getSupportedAPIs( function(result,error) | ||
local progressCount=0 | local progressCount=0 |
Revision as of 13:34, 23 August 2018
Available since: Gideros 2018.3
Description
Report the game's initial loading progress.
FBInstant.setLoadingProgress(percentage)
Parameters
percentage: (number) A number between 0 and 100.
Examples
Example
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)
<br/>