Game Development Reference
In-Depth Information
The getAvatarPix method returns bitmap data for the avatar's picture. The returned
values may be null if the image is not loaded from the server. The avId is the ID of
the avatar whose picture is being requested. The PulseUI framework, specifically
PlayerDisplay and FriendDisplay , will use this API to get the image for the
corresponding avatar:
public function getAvatarPix(avId:int):BitmapData
Pulse game client callbacks
The callback method is fired to provide the developers subclass of the
GameAvatarClient . This would be the instance of the class that is modeled within
the schema. If no customized avatar was created, the implementation can simply
return null.
function onCreateNewAvatar():GameAvatarClient
Since loading images over the Internet is asynchronous, it often takes time to fetch
the image and when that happens, the above callback is fired and PulseUI will
update the corresponding PlayerDisplay or FriendDisplay instance.
function onAvatarPixLoaded(avId:int, pixData:BitmapData):void
In order to conserve memory resources, Pulse only keeps track of other players
that are relevant. This being friends and players in the room with the player. When
the player leaves the current game room or when the player is no longer friend
with another player, the associated resources are released. During this callback, the
developer can uncache any such resources.
function onAvatarPixUnloaded(avId:int):void
Friends management
Friends get people visit your site again, of course, besides offering fun games.
Friends are established on the platform between people who already know each
other and new ones are discovered while interacting on the game community site.
Making new friends involves the following steps:
1. Player A sends a friendship invitation to Player B.
2. Player B receives a notification.
3.
Player B either accepts or rejects the friendship.
4.
If Player B accepts, a friendship relation is established.
 
Search WWH ::




Custom Search