Hi,
I have a text asset with scrollable text. The text comes via binding from an excel file.
Sadly, the text asset remembers the scroll position when a new text is loaded. When a text thas been scrolled all the way down, the next loaded text is displayed at the same position and not scrolled all the way up.
Is there a way to reset the scroll position?
Loading a very short text first doesn‘t help.
Animating the height of the text asset doesn’t help either …
Any suggestions?
Thanks in advance
Micha
Hello @marnold,
This is an issue that the team is aware of and looking into a fix.
For now I could suggest a “workaround”.
When you do the set text action, if you include a send to back and then a move to front action on the text asset. It will bring the text back to the top.
Note the delayed start time of the move to front action. This is to give time for the send to back action complete.
Also note with this workaround that sometimes the text asset will go back to the top but the scroll indicator will not reset.
Thanks,
Ryan
I also have in my notes that if you change the text asset overflow behavior to “Clip”, then back to “Scrollbars” it should scroll it to the top.
If you have multiple text assets, you can bind the overflow behavior all to one asset, like text item, and set them all at once this way.
Just an alternative that I’ve used. Ryan or Seb may have suggested this to me in the past. Good luck!
I also have in my notes that if you change the text asset overflow behavior to “Clip”, then back to “Scrollbars” it should scroll it to the top.
This particular workaround only works with Player Classic.
The workaround I provided earlier in this thread will work with the current version of Player.
Thanks,
Ryan
Good to know! I’ll update my notes for this then.
Follow up question - is there any way to reset the scroll position using player next gen in a way using bindings? Then you could reset scroll positions of text items within a collection and data feed. With the solution above, you cannot target text items within the collection to send those actions. Thanks!
A way to do this would be to
- Add a global variable to the experience.
- Include a toggle button in your data feed template collection. It does not need to be in view of the scene.
- Bind the Checked value of the toggle button to the value of the global variable
- Add an is checked trigger to this toggle button and include the send back and move to front action on the text asset in the data feed template.
- Add another toggle button to the scene outside of the collection and out of view of the scene. Give this an is checked trigger with an action to uncheck it after a .5 sec delay.
- Bind the global variable value to the new toggle buttons Checked value.
Now anytime you want to trigger the workaround you just need to Check the toggle button outside of the collection.
Thanks,
Ryan
Ah yes, put the toggle in the collection and bind it out. Good idea. Thanks!
Hello, AlexB !
It works, I just had to find out that 0=Clip, 1=Ellipsis, 2=Scrollbars.
(I use Player classic on Windows).
Thanks!
Micha