2023-10-18 12:46 AM
Hi
I would like fade-in and fade-out of widget text, using a single button ,is possible?
How I can do?
Thank
Solved! Go to Solution.
2023-10-18 07:40 AM
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
2023-10-18 07:31 AM
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?
2023-10-18 07:40 AM
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