class ZoomAnimationBox : public Box
{
public:
ZoomAnimationBox();
virtual ~ZoomAnimationBox();
void startZoomAnimation(int16_t endWidth, int16_t endHeight, uint16_t duration, touchgfx::EasingEquation widthProgressionEquation = &touchgfx::EasingEquations::linearEaseNone, EasingEquation heightProgressionEquation = &touchgfx::EasingEquations::linearEaseNone);
virtual void handleTickEvent();
void setAnimationEndedCallback(touchgfx::GenericCallback<const ZoomAnimationBox&>& callback) { animationEndedAction = &callback; }
protected:
enum States
{
ANIMATE_ZOOM,
NO_ANIMATION
};
States currentState;
uint32_t animationCounter;
int16_t zoomAnimationStartWidth;
int16_t zoomAnimationStartHeight;
int16_t zoomAnimationEndWidth;
int16_t zoomAnimationEndHeight;
int16_t zoomAnimationStartX;
int16_t zoomAnimationStartY;
int16_t zoomAnimationDeltaX;
int16_t zoomAnimationDeltaY;
uint16_t animationDuration;
EasingEquation zoomAnimationWidthEquation;
EasingEquation zoomAnimationHeightEquation;
touchgfx::GenericCallback<const ZoomAnimationBox&>* animationEndedAction;
virtual void setCurrentState(States state);
};