2021-10-25 12:29 AM
Hi,
Is it possible to zoom in on a text?
I'm trying to create a scrollList with the selected element larger than the rest.
Thanks!
Solved! Go to Solution.
2021-10-25 02:56 AM
Hi,
Yes this is possible. One easy way if your text is already known and wont be changed would be to "cheat" by using an image of the text instead. You then use a TextureMapper widget to scale your image/text when you want.
The other solution I am not accustomed to :grinning_face_with_sweat:, I've never dived into the code. You can have a look at the Board Specific Demo called "STM32H7B3I Evaluation Board Text Animation". When running the demo look at the advanced animations. In TouchGFX Designer and the code look look at the Container "advancedAnimationContainer" and the "scalingTextTextureMapper" implementation.
/Romain
2021-10-25 02:56 AM
Hi,
Yes this is possible. One easy way if your text is already known and wont be changed would be to "cheat" by using an image of the text instead. You then use a TextureMapper widget to scale your image/text when you want.
The other solution I am not accustomed to :grinning_face_with_sweat:, I've never dived into the code. You can have a look at the Board Specific Demo called "STM32H7B3I Evaluation Board Text Animation". When running the demo look at the advanced animations. In TouchGFX Designer and the code look look at the Container "advancedAnimationContainer" and the "scalingTextTextureMapper" implementation.
/Romain
2021-10-25 02:59 AM
Otherwise if you are not looking for an animation but just have a different size you can also add use an additional typographie with the same font but just larger which you use for the selected element.
/Romain
2021-10-25 04:59 AM
Thanks for the quick anwsers!
It's going to be a kinda big menu, so I'd prefer to use text instead of a different image for each entry. But I'll keep it in mind.
I've tried with a differend typography, but it left some artifacts at the sides.
But as I wrote this, I had an idea what might be wrong. I did a resize on the smaller text before invalidating, which left everything that's outside of the new area as it was. Doing the resize later clears the entire area.
I will also take a look at the demo for animating, but for now, this does the trick!
Wisse