Game Development Reference
In-Depth Information
To make a new friend, the game code is required to call makeFriend API with the
name of the avatar. The recipient will receive the onMakeFriend notification.
function onMakeFriend(newFriend:GameAvatarClient):void;
The recipient may then respond by calling the respondToFriendInvite method.
The avName parameter should be the same as the initiating avatar's name.
Customizing friends display
The following figure shows the classes that create the object instance that are
responsible for displaying friends. You may observe the slight difference between
the creations of player display objects and the friend display objects. Unlike player
display objects where both are created by PulseGame class, the friends display is
created by PulseGame, but the FriendDisplay is created by the FriendsDisplay class.
The following code overrides the method in MyGame to create our own subclass of
FriendsDisplay (MyFriendsDisplay):
protected override function initFriendsDisplay():void {
m_friendsDisplay = new MyFriendsDisplay();
}
 
Search WWH ::




Custom Search