How to add a new avatar
Here you will learn how to create a new avatar and we will explain the necessary configuration.
Last updated
Here you will learn how to create a new avatar and we will explain the necessary configuration.
Last updated
First we must understand how it works and what are the characteristics of an avatar.
skin-part - It is in charge of telling the symbols which part of the skin to paint, by default is HEAD_FRONT.
size - it is in charge of saying how many symbols you will paint in a pixel, you need the symbols to have the same amount of characters as the pixels of an image, this will be explained in a better way in the layout. this is used when you need to use more than one character to paint as is the case of this example, it uses one character to make the square and another to give it a spacing if I remove the size or if I put it in 1, the whole image will be deformed because it would be counting the characters that are spaced.
image - if you don't want to use a part of the skin, you can choose to use an image via url or via the folder plugins/MagicAvatar/backgrounds/your-image.png
background - This is useful to give a background to the images that are png, because if you do not give them a background, it will replace the transparent part of the image with a black background (if you place a background the layout of the symbols should take as reference the size of the background that is its pixels, height and width).
cut - this is mostly useful when in-line is activated, it serves to make for example the complete skin that is 14x32 and not all the skin can go only in this row of symbols, but it needs 2 or 4 rows. so this option will cut the 32 rows of symbols and divide them in 8 or 16 depending on how you have it, in this case it will divide the head in 2 parts because it is of a size of 8. in the first part will be the half of the head and in the last part the other half.
in-line - this option is used to say that all the symbols that are being added go on one line only. if this option is set to false, each line will be a part of the head.
layout - This is the most important thing of the avatars, the symbols, each line of symbols represents the size in height and each character of the symbols represents the size in width, if you have the size in 2 it will represent each 2 symbols as 1. You can add the size you want for each avatar, but keep in mind that it can be equal to the size of the skin part or bigger, if it is smaller it will be an error.
by the way, if you will notice in the layout there are 8 symbols of 2 but 1 stands out others in total there are 8 pairs and 1 odd, the last symbol is the spacing required to not deform the image.
It is very easy to enter the placeholder in a site that supports PlaceholderAPI in this way:
%magicavatar_player_smallHead%
If you want to get an image that is cropped, to get the parts is like this:
%magicavatar_player_smallHead_<index>%
- the index starts from 0