Hi @WPrec,
Instead of coming up with a new example, i'd like to show you how this can be done using what we call "Mixins", that you can select for a widget (e.g. a box) through the designer. For the MoveAnimator mixin (touchgfx/mixins/MoveAnimator.hpp) it uses an easing equation to calculate both x and y and uses the moveTo() method to move and invalidate the widget. If we were to simply modify this code to also set a size this clearly shows how animating the size of a widget over time can be done.
So, you could create your own mixin (just copy the MoveAnimator) and do something like the following:
/**
* @fn void MoveAnimator::nextMoveAnimationStep()
*
* @brief Execute next step in move animation.
*
* Execute next step in move animation and stop the timer if necessary.
*/
void nextMoveAnimationStep()
{
...
T::moveTo(moveAnimationStartX + deltaX, moveAnimationStartY + deltaY);
// Besides moving, also set width and height to some value returned by the easingequation
T::setWidth(deltaX);
T::setHeight(deltaY);
T::invalidate();
moveAnimationCounter++;
}
....
}
Create an application with a moveanimator (interaction on screen-entry) to get a feel for what code gets generated and how to use it.
Best regards,
Martin