Text node restore self value after layout changing (SOLVED)

Hi, looks like GUI text node override itself value to default in runtime when engine switched layouts.
Reproduce:

  1. create gui with text node and layouts portrait and landscape
  2. set node text to “TEST”
  3. change in runtime text to “…”
  4. change window resolution to layout’s switching
  5. text node restore self text value to “TEST”

Of course we can catch message LAYOUT_CHANGED and change text back, but…
So, question: is it a bug or a feature?

p.s. may be the similar question Text node is recreating after minimizing window (DEF-2520)

2 Likes

If you have multiple layouts you need to react to layout_changed messages and update your nodes with whatever dynamic data that you might need.
The node properties are reset to the original node properties for the layout.
Tracking those properties over layout changes is a difficult thing to get right, since there are many different cases where it would work against you instead of being helpful.
This is why we decided to reset to the original state and let the user handle the rest (in case of dynamic animations etc).

2 Likes