Author Topic: ScrollingText module  (Read 3128 times)

arthurvalenca

  • Full Member
  • ***
  • Posts: 27
    • View Profile
Re: ScrollingText module
« Reply #15 on: June 27, 2018, 01:07:47 PM »
Thank you! I was able to correct the problem of the text going up, another problem that appears and that in the folder overview contains a .cfg file with a text of the description of the game, but the scroll is only reading three words, somebody knows how I can increase the number of words can the scroll read?

Dal1980

  • Full Member
  • ***
  • Posts: 38
    • View Profile
Re: ScrollingText module
« Reply #16 on: June 27, 2018, 03:02:21 PM »
Don't know if this helps but I ended up having an annoying problem with sending values created from functions over to the scrollingtext. It would either cull any text after the function call even if I had stored the value in a variable before including it in the string or stop all other variables from being populated and somehow write over existing string with a populated value much like how the insert key works on the keyboard. My only guess was that it picked up a new line "/n" or carriage return "/r" (which doesn't explain everything anyway) somewhere but even after sanitising data it still seemed to be an issue. I ended up leaving it alone and just working around the problem.

Code: [Select]
    //function simpleCat just spits out the first cat name from catver.ini
    function simpleCat( ioffset ) {
      local m = fe.game_info(Info.Category, ioffset);
      return split( m, " / " )[0];
    }

    local txtMarquee = "*** [Title] *** Manufactured by [Manufacturer] in [Year] *** Listed Category: [!simpleCat]";
    local scroller = ScrollingText.add( txtMarquee + " ***", flw*0.450, flh*0.001, flw*0.370, flh*0.055 );

    //the above produces something like the following
    //*** A game title *** Manufactured by SomeCo in 1980 *** Listed Category: Sports
    //notice even concatenating the extra 3 **** at the end does not show

    //but if I do this
    local txtMarquee = "*** [Title] *** Listed as [!simpleCat] and Manufactured by [Manufacturer] in [Year] *** Insert Coin";
    local scroller = ScrollingText.add( txtMarquee + " ***", flw*0.450, flh*0.001, flw*0.370, flh*0.055 );
    //I get weird results
    //*** A game title *** Listed as Sportsufactured by in *** Insert Coin ***
    //I've lost my [Manufacturer] and [Year] magic tokens


I don't think this will be a fix in your script, you may need to start pulling the scrollingtext module apart. Maybe someone could shed some light on this but for me I went with a cheap workaround for now.

arthurvalenca

  • Full Member
  • ***
  • Posts: 27
    • View Profile
Re: ScrollingText module
« Reply #17 on: July 11, 2018, 07:31:53 PM »
I had some result in scrolling the text up but still is not expected, it follows the scrolling code of the text as the photo shows, does anyone have a hunch?   



Code: [Select]
#------------------------------------------Overview---------------------------------------

::OBJECTS <- {
    logo = fe.add_text("[Overview]", flx*0.422, fly*0.85, flw*0.509, flh*0.56 ), 
}

local pac = {
    when = Transition.ToNewSelection,
property = "y",
start = fly*0.670,
end = fly*0.350,
tween = Tween.Linear,
time = 30000,
delay = 0,
loop = true
 }

animation.add ( PropertyAnimation( OBJECTS.logo, pac ) );
OBJECTS.logo.font = "zektonbo";
OBJECTS.logo.set_rgb ( 255, 255, 255 );
//OBJECTS.logo.set_bg_rgb ( 0, 80, 220 );
OBJECTS.logo.charsize = 14;
OBJECTS.logo.word_wrap = true;
OBJECTS.logo.align = Align.Centre;