2021-05-17 12:45 AM
I have an animation that the image is getting bigger by the tick. But I want that when it gets a "true" once from model , the animation gets started and continue until it gets a "false".
void IgnitionOnDemoScreenView::ShowUpLogo(bool Logo, bool Fade)
{
if (Logo == true) {
Tick++;
if (Tick % 2 == 0) {
if (LogoImage.getWidth() < 240 && LogoImage.getHeight() < 320) {
LogoImage.setPosition(LogoImage.getX() - 3, LogoImage.getY() - 4, LogoImage.getWidth() + 6, LogoImage.getHeight() + 8);
LogoImage.invalidate();
}
}
}
if (Fade == true) {
FadeLogo();
}
}
I know this one is wrong, but I can't handle it. Can I enable and disable the handleTickEvent? Could you help me?
2021-05-17 02:41 AM
where do you put this IgnitionOnDemoScreenView::ShowUpLogo() and where did you call it?
2021-05-17 06:22 AM
Hi,
You could do it directly within the handleTickEvent() function, like this for example:
void IgnitionOnDemoScreenView::handleTickEvent()
{
if (Logo == true) {
tickCounter++;
if (tickCounter == 2)
{
tickCounter = 0;
if ( LogoImage.getWidth() < 240 && LogoImage.getHeight() < 320 )
{
LogoImage.setPosition(LogoImage.getX() - 3, LogoImage.getY() - 4, LogoImage.getWidth() + 6, LogoImage.getHeight() + 8);
LogoImage.invalidate();
}
}
}
if (Fade == true) {
FadeLogo();
}
}
I believe that would be easier :grinning_face_with_sweat:
/Romain