cancel
Showing results for 
Search instead for 
Did you mean: 

touchgfx fade-in fade-out single button

PZamb.2
Associate III

Hi

I would like fade-in and fade-out of widget text, using a single button ,is possible?

How I can do?

Thank

1 ACCEPTED SOLUTION

Accepted Solutions

Hallo

Thank for your answer, i create fade botton on/off with option "Add C Code" and implemented a virtual function in screenView:

void screenView::function1()
{


if (ROI_Txt.getAlpha()>200) {
ROI_Txt.clearFadeAnimationEndedAction();
ROI_Txt.setFadeAnimationDelay(6);
ROI_Txt.startFadeAnimation(0, 120, touchgfx::EasingEquations::linearEaseIn);
}
else
{
ROI_Txt.clearFadeAnimationEndedAction();
ROI_Txt.setFadeAnimationDelay(6);
ROI_Txt.startFadeAnimation(255, 120, touchgfx::EasingEquations::linearEaseOut);
}
}

I'll Try your suggest.

Thank

 

View solution in original post

2 REPLIES 2
Osman SOYKURT
ST Employee

Hello @PZamb.2 ,

You can easily do it with a toggle button for example, but you can also do it with a regular button based on the pressed state (with the getPressedState() function) of it.
Do you want support to make the fade animation or is it the button part that you need help on?

Osman SOYKURT
ST Software Developer | TouchGFX

Hallo

Thank for your answer, i create fade botton on/off with option "Add C Code" and implemented a virtual function in screenView:

void screenView::function1()
{


if (ROI_Txt.getAlpha()>200) {
ROI_Txt.clearFadeAnimationEndedAction();
ROI_Txt.setFadeAnimationDelay(6);
ROI_Txt.startFadeAnimation(0, 120, touchgfx::EasingEquations::linearEaseIn);
}
else
{
ROI_Txt.clearFadeAnimationEndedAction();
ROI_Txt.setFadeAnimationDelay(6);
ROI_Txt.startFadeAnimation(255, 120, touchgfx::EasingEquations::linearEaseOut);
}
}

I'll Try your suggest.

Thank