2020-05-15 01:36 AM
Hello,
I noticed that in TouchGFX Designer there are two ways of using a text resource in a text area:
Both ways seem to work just fine (as one would suspect).
But are there differences between the two (e.g. memory usage or available features) that would make one preferable in certain situations?
Kind regards
Christoph
2020-05-15 07:13 AM
Hello,
It's always better to create Resources because as you said you can change the ID to be understandable (T_SINGLEUSEID3 is not very self-explanatory).
Plus the point of Resources is that they can be reused. For every Single Use text you will allocate memory for it. But let's say you want to have the word "quit" on several screens. For this case, you will declare "quit" as a resource only once and use it for every occurrence. Therefore you save memory and text management becomes way easier.
/Alexandre
2020-05-15 07:18 AM
(I forgot to add the purpose of wildcard)
There are 2 main situations where wildcards are useful:
/Alexandre
2020-05-18 12:59 AM
Hello Alexandre,
thank you for your helpful explanation.
So the typography and alignment of the wildcard always takes precedence over the typography and alignment set in the recource.
One more question:
As you said, there is a new text created for every Single Use. So for every textarea that contains only a wildcard there will be a "<value>" single use ID. This means, if I have a lot of wildcards, I can save a bit of memory by choosing short or even empty wildcard names. Is that correct?
Christoph
2020-05-18 02:31 AM
Hello,
No, wildcard names are just there to help the user but they won't be taken into account in the program. They will be replaced by a placeholder number so you can even put a sentence like <This a very very long name for a wildcard> and it will take as much memory as <>.
Another thing to notice is that if you have 4 Single Use text "Hello World" in your application, they will be all merged into one after compilation. However, it is a very bad habit and resources should be prioritized.
You might find other information if you follow this link : https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/texts-and-fonts#wildcards
/Alexandre
2020-05-18 02:45 AM
Hello Alexandre,
thank you very much for those clarifications.
Best regards
Christoph