The X and Y scale, the rotation, and the duration.
We have to know that as higher "_xScale" and "_yScale", more fast will scale our sprite, This is not the size that will be scaled. If we use a positive value as "16", the scale will be a magnify, if we use a negative one, as "-32", the scale will be of reduction.
We have to know that the value of scale, and the duration are strictly linked, and I've bothered to take out the formula.
First, I will shorten the variables to make the formula more comfortable (although it is very simple).
d = _duration
x = _xScale
d will be the value of _duration, x will be the value of _xScale (or _yScale, is the same), and finally, k will be the scale which we will give to the sprite. For example, if we want the sprite to be twice as large, k = 2. if we want the sprite to be 2/3 of the original, k = 2/3 (although I do not recommend this value much, the scale will not be too homogeneous)
Once we know that, let's see the formula (that you can clear to know the value that most interests you, or you can give values directly to know the duration)
LOOK OUT!.- If the result of the formula gives you a value with decimals, I recommend that you choose to use other values that give a similar visual result, but not decimals, since the floats will not be processed. You can play with the scale speed.
LOOK OUT! (2).- I will use the formula that you will see below, because I will work with a sprite that by default, is loaded with a size of 1x1 pixel, and there is a certain variation in the formula so that it can be scaled to its natural size, specifically the one below. But if you load the sprite directly with its original size, you have to use the previous one. Once you have applied this formula to scale it to its original size, you can apply the previous formula.
Right, now, before use AFFINEANIM, we have to know that we must use this before every new AffineAnimCmd function (at least to me without this, it does not work):
AFFINEANIMCMD_FRAME(_xScale, _yScale, 0, 0),
And later, We write the transformation we want to do.
For example, let's say that we have made the sprite load with dimensions of 1x1, and what we want to do is increase its size to the original, well we want that k = 1, a speed in x and y of about 16 (by default), so, let's calculate the necessary duration:
d = (240/16)*1 = 15
Right, so, now that we have all the parameters, let's write the necessary affineanims.