Skip to main content

mbga.Avatar

Object​

NameTypeDescription
idUserId–
sizeEnumAvatarSize–
viewEnumAvatarView–
emotionEnumAvatarEmotion–
dimensionEnumAvatarDimension–
transparentBoolean–
typeEnumAvatarType–
extensionEnumAvatarExtension–
motionInterger–
sceneAvatarMotionScenes–
fpsInteger–
movieClipString–
urlString–

The correspondence relationship between EnumAvatarSize, EnumAvatarView, and EnumAvatarExtension is as follows.

sizeviewwidthheightextensionsupport
xlargeentire150200gif, swftrue
xlargeupper–––false
largeentire120160gif, swftrue
largeupper6080gif, swftrue
mediumentire6080gif, swftrue
mediumupper3040gif, swftrue
smallentire3040gif, swftrue
smallupper–––false

The correspondence relationship between EnumAvatarDimention, transparent is as follows.

dimensiontransparentsupport
2dtruefalse
2dfalsetrue
3dtruetrue
3dfalsetrue
EnumAvatarSize​
KeyDescription
xlargeCan only be used when the Avatar.view is 'entire'.
large–
medium–
small–
AvatarMotionScenes​

AvatarMotionScenes is string data in a format determined by the following BNF.

AvatarMotionScenes = AvatarMotionScene *( "-" AvatarMotionScene ){1,7}
AvatarMotionScene = AvatarMotionLabel "." ( AvatarFrameId *( "." AvatarFrameId ) ) "." AvatarEndExpression
AvatarMotionLabel = ALPHA / DIGIT / "_"
AvatarFrameId = Integer
AvatarEndExpression = "loop" / "stop"

For example, if it is

s1.10.11.stop-s2.13.15.loop

then the scene label s1 is composed of frames 10 and 11, and there is no repeat. Then, scene label s2 is composed of frames 13 and 15, and 13, 15 will repeat.
This may be omitted if the view is upper, but it must be specified if it is entire.

Method​

mbga.Avatar.getId​

String getId()

mbga.Avatar.getUrl​

String getUrl()

mbga.Avatar.getField​

Object getField(name)

mbga.Avatar.setField​

void setField(name, value)

mbga.Avatar.Field​

mbga.Avatar.Field.ID​

The ID of the avatar image.

mbga.Avatar.Field.SIZE​

The size of the avatar image. mbga.Enum.AvatarSize can be specified.

mbga.Avatar.Field.VIEW​

The view of the avatar image. mbga.Enum.Avatar.View can be specified.

mbga.Avatar.Field.EMOTION​

The emotion of the avatar image. mbga.Enum.Avatar.Emotion can be specified.

mbga.Avatar.Field.DIMENSION​

The dimension of the avatar image. mbga.Enum.Avatar.Dimension can be specified (only 3D avatars are provided in the PC version).

mbga.Avatar.Field.TRANSPARENT​

Whether or not the background of the avatar image is transparent.

mbga.Avatar.Field.TYPE​

The type of avatar image. mbga.Enum.Avatar.Type can be specified.

mbga.Avatar.Field.EXTENSION​

The extension of the avatar image. mbga.Enum.Avatar.Extension can be specified.

mbga.Avatar.Field.MOTION​

The motion of the avatar image.

mbga.Avatar.Field.SCENE​

The scene of the avatar image.

mbga.Avatar.Field.FPS​

The fps of the avatar image (values between 0 and 35 may be specified)

mbga.Avatar.Field.MOVIE_CLIP​

The movie clip of the avatar image.

mbga.Avatar.Field.URL​

The URL of the avatar image.

mbga.AvatarRequestFields​

A list of fields that can be used with mbga.newFetchAvatarRequest and mbga.requestFetchAvatar opt_params.

mbga.AvatarRequestFields.SORT_BY​

mbga.BlackList.SortBy can be specified.

mbga.AvatarRequestFields.SORT_ORDER​

mbga.AvatarRequest.SortOrder can be specified.

mbga.AvatarRequestFields.FORMAT​

mbga.AvatarRequest.Format can be specified.

mbga.AvatarRequestFields.FIELDS​

Specifies arrays with fields to be acquired from those in mbga.Avatar.Fields arranged.

mbga.AvatarRequest.SortBy​

mbga.AvatarRequest.SortBy.ID​

Sorts avatar objects based on mbga.Avatar.Field.ID. Below is a sample of acquiring data that has been sorted in ascending order of ID.

Sample​
var idSpec = opensocial.newIdSpec();
idSpec.setField(opensocial.IdSpec.Field.USER_ID, [ opensocial.IdSpec.PersonId.VIEWER ]);
idSpec.setField(opensocial.IdSpec.Field.GROUP_ID, opensocial.IdSpec.GroupId.SELF);

var opt_params = {};
opt_params[mbga.AvatarRequestFields.SORT_ORDER] = mbga.AvatarRequest.SortOrder.ASCENDING;
opt_params[mbga.AvatarRequestFields.SORT_BY] = mbga.AvatarRequest.SortBy.ID;

mbga.requestFetchAvatar(idSpec, opt_params, function(data) {

if ( data.hadError() ) {
alert("response had error!");
}
else {
var avatars = data.getData();
// do something
}

});

mbga.AvatarRequest.SortOrder​

mbga.AvatarRequest.SortOrder.ASCENDING​

Sorts avatar objects in ascending order of key value.

mbga.AvatarRequest.SortOrder.DESCENDING​

Sorts avatar objects in the descending order of key value.

mbga.AvatarRequest.Format​

mbga.AvatarRequest.Format.JSON​

mbga.Enum.Avatar.Size​

mbga.Enum.Avatar.Size.X_LARGE​

Sets the size of the avatar image to extra large (150px × 200px).

mbga.Enum.Avatar.Size.LARGE​

Sets the size of the avatar image to large (120px × 160px).

mbga.Enum.Avatar.Size.MEDIUM​

Sets the size of the avatar image to medium (60px × 80px).

mbga.Enum.Avatar.Size.SMALL​

Sets the size of the avatar image to small (30px × 40px).

mbga.Enum.Avatar.View​

mbga.Enum.Avatar.View.ENTIRE​

The view that shows the entire avatar image.

mbga.Enum.Avatar.View.UPPER​

The view that shows the upper half of the avatar image.

mbga.Enum.Avatar.Emotion​

mbga.Enum.Avatar.Emotion.DEFINED​

Sets the emotion of the avatar image to the default value (specified by the user).

mbga.Enum.Avatar.Emotion.NORMAL​

Sets the emotion of the avatar image to normal.

mbga.Enum.Avatar.Emotion.SMILE​

Sets the emotion of the avatar image to smiling.

mbga.Enum.Avatar.Emotion.CRY​

Sets the emotion of the avatar image to crying.

mbga.Enum.Avatar.Emotion.ANGRY​

Sets the emotion of the avatar image to angry.

mbga.Enum.Avatar.Emotion.SHY​

Sets the emotion of the avatar image to shy.

mbga.Enum.Avatar.Dimension​

mbga.Enum.Avatar.Dimension.DEFINED​

Sets the dimension of the avatar image to the default value (specified by the user).

mbga.Enum.Avatar.Dimension.THREE_DIMENSION​

Sets the dimension of the avatar image to 3D.

mbga.Enum.Avatar.Type​

mbga.Enum.Avatar.Type.IMAGE​

Sets the type of the avatar image to normal image.

mbga.Enum.Avatar.Type.FLASH​

Sets the type of the avatar image to FLASH.

mbga.Enum.Avatar.Extension​

mbga.Enum.Avatar.Extension.GIF​

Sets the extension of the avatar image to gif.

mbga.Enum.Avatar.Extension.SWF​

Sets the extension of the avatar image to swf.

Revision History​

  • 12/2010
    • Initial Release.