Creates masks (PNG images) for the given character customization.
Creates 2 masks for layer#0 and layer#1. Animation layer should be rendered in between by the client.
See module:constants.animationLayer_Z_Index
for more.
Image creation is done via a headless canvas. Selected options are first sorted by their z-index and drawn on the canvas one by one. Then canvases are converted to Base64 encoded PNG images.
Parameters:
Name | Type | Description |
---|---|---|
charParts |
Array.<UserCharPart> | character customization |
Returns:
Node buffers containing the binary data of the mask images
- Type
- Array.<Buffer>
- Source:
Methods
(static) getLongLivedAccessToken(fbAccessToken) → {Promise.<module:services/facebook.LongLivingAccessTokenContainer, Error>}
Fetches a long lived access token for the given short living token.
Parameters:
Name | Type | Description |
---|---|---|
fbAccessToken |
string | Short living access token provided by the client |
- Source:
Returns:
- Type
- Promise.<module:services/facebook.LongLivingAccessTokenContainer, Error>
(static) getUserInformation(longLivedToken) → {Promise.<module:services/facebook.FetchedFacebookUserInformation, Error>}
Fetches the user information from Facebook.
Parameters:
Name | Type | Description |
---|---|---|
longLivedToken |
string | long lived token for the user |
- Source:
Returns:
- Type
- Promise.<module:services/facebook.FetchedFacebookUserInformation, Error>
Type Definitions
FetchedFacebookUserInformation
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
string | |
name |
string | |
picture |
Object |
- Source:
Example
{
"id": "154116123456789",
"name": "John Doe",
"picture": {
"data": {
"is_silhouette": false,
"url": "https://...."
}
}
}
LongLivingAccessTokenContainer
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
longLivedAccessToken |
string | |
expires |
number |
- Source: