question

kxia156 avatar image
kxia156 asked

display a users title display name?

How do I get a players title display name to show in game. I tried looking at the documentation but I can't figure it out. Can i get some sample code?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

You can get the Title Display Name any number of ways. If you mean for a single user, the https://api.playfab.com/documentation/client/method/GetAccountInfo API call would be a good one to use. But all the leaderboard API calls also return the TDN info for all the players in the list.

If you literally mean how to create UX to display the name, we don't provide specific libraries or tools for graphics. PlayFab is entirely a backend service - we do not interfere in the presentation layer of the game in any way. But have provided an example "game" that you can use as a template for your own work, assuming you're a Unity developer: https://github.com/PlayFab/UnicornBattle

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kxia156 avatar image kxia156 commented ·

Hi, thanks for the response, but I'm not so sure how to go about calling that API and getting a title display name. I was asking for some sample code on the function call itself.

0 Likes 0 ·
brendan avatar image brendan kxia156 commented ·

The API documentation specifically shows an example of making each call as a simple Web API request, but there's also an example of this specific API call in C# in this thread: https://community.playfab.com/questions/358/206712347-show-display-name.html.

Assuming you're a Unity user though, the UnicornBattle example linked above specifically has code showing how to make a wide range of calls into PlayFab. I'd highly recommend having a look at it for examples.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.