Skip to main content
Wisse Pielage
Associate II
October 25, 2021
Solved

TextAreaWithOneWildcard Scaling/Zooming

  • October 25, 2021
  • 3 replies
  • 1139 views

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!

This topic has been closed for replies.
Best answer by Romain DIELEMAN

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

3 replies

Romain DIELEMAN
Romain DIELEMANBest answer
ST Employee
October 25, 2021

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

Romain DIELEMAN
ST Employee
October 25, 2021

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

Wisse Pielage
Associate II
October 25, 2021

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