Kodi Community Forum
Scrolling text box - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Scrolling text box (/showthread.php?tid=303336)



Scrolling text box - jgauthier - 2017-01-06

I'm trying to implement a scrolling text box. Specifically, the text is going to be scrolling at uneven interval. (Song lyrics, like a karaoke machine).

I thought, I could get around this easily enough by building a small algorithm that compares the current line vs the entirety of the text, and scrolls to that percentage. However, using .scroll(percentage) results in the scrollbar always resetting to 0 before actually scrolling, which is unpleasant.

Any suggestions on how to accomplish this?

Thanks!


RE: Scrolling text box - jgauthier - 2017-01-06

Well, it seems that changing the value of the textbox causes it to reset to position 0. This certainly makes sense, but makes it extremely difficult to accomplish my task.


RE: Scrolling text box - jgauthier - 2017-01-06

I was able to achieve this almost perfectly with a list item. Then using selectItem() on the element scrolls right to it.


RE: Scrolling text box - pkscout - 2017-01-06

So glad we could help. '-)


RE: Scrolling text box - User 342716 - 2017-01-07

(2017-01-06, 23:59)pkscout Wrote: So glad we could help. '-)


hahSmile