Author Topic: ScrollingText module doesn't work?  (Read 98 times)

cosmo

  • Full Member
  • ***
  • Posts: 48
    • View Profile
ScrollingText module doesn't work?
« on: July 21, 2017, 03:59:23 AM »
Hi, i'm trying to include a scrolling text in my layout, and not sure why but it's giving me an error on the scrollingtext.nut file

this is what i'm trying to include.

Code: [Select]
fe.load_module("objects/scrollingtext");
local scroller = ScrollingText.add("[Overview]",flx*0.355, fly*0.9, flw*0.3, flh*0.9);

and it's returning this on the debug screen

Code: [Select]
AN ERROR HAS OCCURED [cannot convert the string]

CALLSTACK
*FUNCTION [unknown()] E:\Attract\modules\objects\scrollingtext.nut line [255]
*FUNCTION [unknown()] E:\Attract\modules\objects\scrollingtext.nut line [97]

LOCALS
[playTime] ""
[actual] "[Overview]"
[var] 1
[obj] TABLE
[this] TABLE
[obj] TABLE
[i] 0
[ttime] 0
[var] 1
[ttype] 2
[this] TABLE
Script Error in transition function: transition_callback - cannot convert the string

any ideas?  :-\

jedione

  • Sr. Member
  • ****
  • Posts: 283
  • punktoe
    • View Profile
Re: ScrollingText module doesn't work?
« Reply #1 on: July 21, 2017, 05:46:20 AM »
i think it is not set up to use m-tokins

i notice if you use [DisplayName] it will only scroll the first letter
of the name.

i think the module needs to be updated, but liquid8 seems occupied
with his new online theme creator...
help a friend....

BOXXMAN

  • Full Member
  • ***
  • Posts: 38
    • View Profile
Re: ScrollingText module doesn't work?
« Reply #2 on: July 21, 2017, 08:13:24 AM »
i think it is not set up to use m-tokins

i notice if you use [DisplayName] it will only scroll the first letter
of the name.

i think the module needs to be updated, but liquid8 seems occupied
with his new online theme creator...

It will take magic tokens just fine, and I use the same code as shown above to use it.
Code: [Select]
fe.load_module("objects/scrollingtext");
local scroller = ScrollingText.add("[Overview]",flx*0.355, fly*0.9, flw*0.3, flh*0.9);

What you may be missing is the parameter to set width. If you do not set a width for the text it will get cut off after the first letter. Set parameter as follows.
Code: [Select]
scroller.settings.fixed_width= 9000;You can set the length for whatever you like, it just has to be set for your longest text field, and you will have to experiment to find out what works for you. I have mine set very high since I use ExoDos infos that I converted to .cfg for AM, and they are very lengthy.The only problem is that for short overviews, it causes a long delay before they stat again, because it will continue to scroll the fixed width value before starting again. Since there is no provision for calculating the string length in the module, it just has to be a fixed value. Also, don't forget
Code: [Select]
scroller.settings.loop =100;This will loop it so it doesn't only play once. All of this will work for horizontal scrolling text, however, vertical does seem to have issues working properly, and that may be a module flaw.

Arcadefan1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: ScrollingText module doesn't work?
« Reply #3 on: July 22, 2017, 11:47:26 AM »
Has someone figured out a way to calculate the width of a string (magic tokens)? I would love to repeat the scrolling immediately when the end is reached and not have to use a fixed width...

jedione

  • Sr. Member
  • ****
  • Posts: 283
  • punktoe
    • View Profile
Re: ScrollingText module doesn't work?
« Reply #4 on: July 22, 2017, 05:43:15 PM »
earlier in the year this is what liquid8d had to say abought it when i asked the same Q:

"So the problem here is when I wrote this, there wasn't a way to get accurate length in pixels of the text, based on the font and text size. By default it attempts to guess at the length based on the length of the text and the charsize set. This might not be accurate especially if you are using magic token variables, so you might have to set a fixed width of the actual text object using scroller.fixed_width = ? - Of course, then it may cut off longer text so you will have to decide what works best for you.

There is supposed to be a way now in AM to get a measurement, but when I was testing it I couldn't get it to work properly."


scroller.fixed_width =
not tested!
« Last Edit: July 22, 2017, 05:44:47 PM by jedione »
help a friend....