xboxlive_gamedisplayname_for_user


Description

With this function you can retrieve the display name - as a string - from the user ID pointer given. Note that if the user is local then the returned value is simply a string of the their display name, but if it is a remote user then the string will be their gamertag which can then be used, for example, for muting/unmuting in voice chat.

IMPORTANT! This function is only valid when exporting using the UWP target for the Xbox One and it requires you to have checked the Enable XBox Live option in the UWP Game Options.


Syntax:

xboxlive_gamedisplayname_for_user(user_id);

Argument Description
user_id The ID pointer of the user to check.


Returns:

String


Example:

for(var i = 0; i < xboxlive_get_user_count(); ++i;)
    {
    user_id[i] = xboxlive_get_user(i);
    user_name[i] = xboxlive_gamedisplayname_for_user(user_id[i]);
    }

The above code gets the user ID pointer for each available user account and then stores the pointer along with the display name in two arrays.