How do I go about printing the leaderboard that is saved on APP42 into unity labels?

0 votes
Im trying to figure out how the information for the demo you guys have in unity uses in order to print stuff. I see it uses APP42Log.

 

How do I go about just getting username score and such like that and just printing it to a label in unity. What is the call. I know its the .GetUserName()); but everytime I do it I get nothing. Is it possible to put it in a label?
asked Apr 23, 2015 in App42 Cloud API-BaaS by IslandStudio.CB (12 points)

1 Answer

+1 vote

Hello,

You can easily set the username and its score on label by using Game object response from respective method of game service. Below is the code snippet for the same..

static string lableText = leaderboardObj.GetUserName(); // Get UserName from the onSuccess response of callback.
GUILayout.Label (lableText, GUILayout.Width (200), GUILayout.Height (100));
 
Also, please find the sample liink from here,it will also help you to integrate the above things.

Thanks,

Himanshu Sharma

answered Apr 24, 2015 by hs00105 (2,005 points)
Ohh my god great link thank you so much. I went ahead and used the FBLeaderboard another quick question. Once the game ends I call to FBLeaderBoard.SaveScore();   and I keep getting the error

App42Exception: User Name can not be blank

Now should it not just take the fb id of the user and then save it to that person?

The scores are working fine displaying and such but everytime the game goes to end it comes up with that error. Do I need to call to get the name I guess? Should this be done in the same class as the game ending script?
Yes, you have to pass the user name for which you want to save the user score. Kindly check and let us know if you need any help on the integration side.

Thanks,
Himanshu Sharma
Got it working great program and backend its wonderful. I have another question Im going to so some searches see but I doubt its there. Will see keep your eyes one ill comment a reply link to the question. I think its a challenging one hopefully it can be done.
Could you please elaborate your question once again?Because i am unable to understand your query.

Thanks
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...