- Create a folder for your twibbon in the root repository.
- Upload all the files that become your twibbon layers.
- Create a
metadata.json
file. - Twibbon is ready to use.
- Use alphanumeric characters, without spaces and any symbols.
- For twibbon image files, the name must follow the format
layer{index}
followed by commonly used image file types, such as.png
,.jpg
,.jpeg
. For example,layer1.png
. - Replace
{index}
with a number indicating the composition order of the image. See below for an example. - Index starts from 1.
- Photo uploaded by users will be placed on the last layer, or on the layer where the index is passed (see below for an example).
- Let's say, I want to upload my twibbon named
mytwibbon
with 4 twibbon layers. Later, the user's photo will be placed on layer 4. So, the file and folder structure will be like this. (See the layer composition)
root
├── mytwibbon
│ ├── layer1.png
│ ├── layer2.png
│ ├── layer3.png
│ ├── layer5.png
│ └── metadata.json
│
└── {other_twibbon}
canvas
├── layer1.png
├── layer2.png
├── layer3.png
│ {user_photo}
└── layer5.png
{
"title": "YOUR_TITLE",
"subtitle": "YOUR_SUBTITLE",
"width": 1080,
"height": 1080,
"lastLayerIndex": 5,
"caption": {
"template": "Hello, my name is <<NAME>> and I am <<AGE>> years old.",
"params": {
"NAME": {
"label": "Name",
"default": "[YOUR NAME]"
},
"AGE": {
"label": "Age",
"default": "[YOUR AGE]"
}
}
}
}
Explanation:
title
: The main title of the twibbon. In this example, the title isYOUR_TITLE
.subtitle
: A secondary title or description for the twibbon. This field can also be set tonull
if no subtitle is needed. In this example, the subtitle isYOUR_SUBTITLE
.width
: The width of the twibbon in pixels. Here, it is set to1080
pixels.height
: The height of the twibbon in pixels. Similar to the width, it is set to1080
pixels.lastLayerIndex
: Indicates the index of the last layer in the twibbon file. This helps to understand the layer stacking order. In this example, the last layer index is5
.caption
: Contains the template for the caption text and the parameters that can be replaced within the caption. This field is optional, so you can define it or not, based on your needs.template
: The template for the twibbon caption. It contains placeholders (in the format<<PLACEHOLDER>>
) that will be replaced with actual values. Here, the template isHello, my name is <<NAME>> and I am <<AGE>> years old.
.params
: Defines the placeholders and their attributes.PLACEHOLDER
: The placeholder name. Based on the template, the firstPLACEHOLDER
should beNAME
and the second should beAGE
label
: A descriptive label for the placeholder.default
: The default value to be used if no other value is provided.
It is not recommended to use more than 3 composition layers (including user photo), as it may affect the drawing performance performed by the system.
Therefore, it is best to only use a maximum of 3 layers of composition:
- 1 front layer (e.g.
layer1.png
) - 1 user photo layer
- 1 back layer (e.g.
layer3.png
)