Dear All,
I believe I have implemented the code correctly and I have also set up the leaderboards on my dev account. However, I’m wondering why my leaderboard will not show up at all? Here is my code:
Menu.lua: ( the print works when button is pressed but the leaderboard wont show.)
function handleButtonEvent1( event ) if ( "ended" == event.phase ) then print("button pressed for leaderboard") if ( system.getInfo("platformName") == "Android" ) then gameNetwork.show( "leaderboards" ) else gameNetwork.show( "leaderboards", { leaderboard = {timeScope="AllTime"} } ) end return true end end
Main.lua (the sign in process at the beggining of the game works)
gameNetwork = require( "gameNetwork" ) local function loadLocalPlayerCallback( event ) playerName = event.data.alias saveSettings() --save player data locally using your own "saveSettings()" function end local function gameNetworkLoginCallback( event ) gameNetwork.request( "loadLocalPlayer", { listener=loadLocalPlayerCallback } ) return true end local function gpgsInitCallback( event ) gameNetwork.request( "login", { userInitiated=true, listener=gameNetworkLoginCallback } ) end local function gameNetworkSetup() if ( system.getInfo("platformName") == "Android" ) then gameNetwork.init( "google", gpgsInitCallback ) else gameNetwork.init( "gamecenter", gameNetworkLoginCallback ) end end
Thank you in advance!
James x